mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-20 04:02:27 +00:00
security/zeronet: Fix runtime by replacing the deprecated function
Python-38 has cgi.parse_qsl deprecated. It is replaced with urllib.parse.parse_qsl.
This commit is contained in:
parent
d2a4b6c40a
commit
c875ddba98
@ -3,7 +3,7 @@
|
||||
PORTNAME= zeronet
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 0.7.1
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= security net-p2p
|
||||
|
||||
MAINTAINER= yuri@FreeBSD.org
|
||||
|
@ -1,6 +1,26 @@
|
||||
- replace the deprecated function cgi.parse_qsl -> urllib.parse.parse_qsl
|
||||
- alter message about debugging
|
||||
|
||||
--- src/Ui/UiServer.py.orig 2019-09-04 18:16:57 UTC
|
||||
+++ src/Ui/UiServer.py
|
||||
@@ -133,7 +133,7 @@ class UiServer:
|
||||
@@ -4,6 +4,7 @@ import cgi
|
||||
import socket
|
||||
import sys
|
||||
import gevent
|
||||
+import urllib
|
||||
|
||||
from gevent.pywsgi import WSGIServer
|
||||
from gevent.pywsgi import WSGIHandler
|
||||
@@ -95,7 +96,7 @@ class UiServer:
|
||||
def handleRequest(self, env, start_response):
|
||||
path = bytes(env["PATH_INFO"], "raw-unicode-escape").decode("utf8")
|
||||
if env.get("QUERY_STRING"):
|
||||
- get = dict(cgi.parse_qsl(env['QUERY_STRING']))
|
||||
+ get = dict(urllib.parse.parse_qsl(env['QUERY_STRING']))
|
||||
else:
|
||||
get = {}
|
||||
ui_request = UiRequest(self, get, env, start_response)
|
||||
@@ -133,7 +134,7 @@ class UiServer:
|
||||
from werkzeug.debug import DebuggedApplication
|
||||
handler = DebuggedApplication(self.handleRequest, evalex=True)
|
||||
except Exception as err:
|
||||
@ -9,12 +29,3 @@
|
||||
from Debug import DebugReloader
|
||||
self.log.write = lambda msg: self.log.debug(msg.strip()) # For Wsgi access.log
|
||||
self.log.info("--------------------------------------")
|
||||
@@ -192,7 +192,7 @@ class UiServer:
|
||||
|
||||
self.server.socket.close()
|
||||
self.server.stop()
|
||||
- self.running = False
|
||||
+ time.sleep(1)
|
||||
time.sleep(1)
|
||||
|
||||
def updateWebsocket(self, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user