git: c875ddba98af - main - security/zeronet: Fix runtime by replacing the deprecated function
Yuri Victorovich
yuri at FreeBSD.org
Sat May 22 06:02:37 UTC 2021
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=c875ddba98af41ee5a88f221f340e7a5d563629c
commit c875ddba98af41ee5a88f221f340e7a5d563629c
Author: Yuri Victorovich <yuri at FreeBSD.org>
AuthorDate: 2021-05-22 06:00:53 +0000
Commit: Yuri Victorovich <yuri at FreeBSD.org>
CommitDate: 2021-05-22 06:02:35 +0000
security/zeronet: Fix runtime by replacing the deprecated function
Python-38 has cgi.parse_qsl deprecated. It is replaced with urllib.parse.parse_qsl.
---
security/zeronet/Makefile | 2 +-
security/zeronet/files/patch-src_Ui_UiServer.py | 31 +++++++++++++++++--------
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/security/zeronet/Makefile b/security/zeronet/Makefile
index f6fc805f39d2..25b553c71621 100644
--- a/security/zeronet/Makefile
+++ b/security/zeronet/Makefile
@@ -3,7 +3,7 @@
PORTNAME= zeronet
DISTVERSIONPREFIX= v
DISTVERSION= 0.7.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security net-p2p
MAINTAINER= yuri at FreeBSD.org
diff --git a/security/zeronet/files/patch-src_Ui_UiServer.py b/security/zeronet/files/patch-src_Ui_UiServer.py
index 8db78e50e5a4..cd9ce3363e4f 100644
--- a/security/zeronet/files/patch-src_Ui_UiServer.py
+++ b/security/zeronet/files/patch-src_Ui_UiServer.py
@@ -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):
More information about the dev-commits-ports-all
mailing list