mirror of
https://git.freebsd.org/ports.git
synced 2025-05-25 07:26:29 -04: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
2 changed files with 22 additions and 11 deletions
|
@ -3,7 +3,7 @@
|
||||||
PORTNAME= zeronet
|
PORTNAME= zeronet
|
||||||
DISTVERSIONPREFIX= v
|
DISTVERSIONPREFIX= v
|
||||||
DISTVERSION= 0.7.1
|
DISTVERSION= 0.7.1
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= security net-p2p
|
CATEGORIES= security net-p2p
|
||||||
|
|
||||||
MAINTAINER= yuri@FreeBSD.org
|
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.orig 2019-09-04 18:16:57 UTC
|
||||||
+++ src/Ui/UiServer.py
|
+++ 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
|
from werkzeug.debug import DebuggedApplication
|
||||||
handler = DebuggedApplication(self.handleRequest, evalex=True)
|
handler = DebuggedApplication(self.handleRequest, evalex=True)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
@ -9,12 +29,3 @@
|
||||||
from Debug import DebugReloader
|
from Debug import DebugReloader
|
||||||
self.log.write = lambda msg: self.log.debug(msg.strip()) # For Wsgi access.log
|
self.log.write = lambda msg: self.log.debug(msg.strip()) # For Wsgi access.log
|
||||||
self.log.info("--------------------------------------")
|
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…
Add table
Reference in a new issue