From 71d09c01114543af387a7f043be8b02d7b691aaa Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Thu, 9 Nov 2023 17:16:55 +0800 Subject: [PATCH] fix #1065 gevent-1.3.0 removes 'fast' wsgi implementation. Signed-off-by: zhang-liang-pengkun (cherry picked from commit 440be8ab765ab43a51cde79b625856878f580bea) --- ...1.3.0-removes-fast-wsgi-implementati.patch | 37 +++++++++++++++++++ python-bottle.spec | 6 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-fix-1065-gevent-1.3.0-removes-fast-wsgi-implementati.patch diff --git a/0001-fix-1065-gevent-1.3.0-removes-fast-wsgi-implementati.patch b/0001-fix-1065-gevent-1.3.0-removes-fast-wsgi-implementati.patch new file mode 100644 index 0000000..5b358c1 --- /dev/null +++ b/0001-fix-1065-gevent-1.3.0-removes-fast-wsgi-implementati.patch @@ -0,0 +1,37 @@ +From 19a12f898b7343e16f0d08821de6aac169143752 Mon Sep 17 00:00:00 2001 +From: Marcel Hellkamp +Date: Tue, 27 Nov 2018 19:27:54 +0100 +Subject: [PATCH] fix #1065 gevent-1.3.0 removes 'fast' wsgi implementation. + +--- + bottle.py | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/bottle.py b/bottle.py +index 3a51b38..cb46893 100644 +--- a/bottle.py ++++ b/bottle.py +@@ -2904,14 +2904,16 @@ class GeventServer(ServerAdapter): + * See gevent.wsgi.WSGIServer() documentation for more options. + """ + def run(self, handler): +- from gevent import wsgi, pywsgi, local ++ from gevent import pywsgi, local + if not isinstance(threading.local(), local.local): + msg = "Bottle requires gevent.monkey.patch_all() (before import)" + raise RuntimeError(msg) +- if not self.options.pop('fast', None): wsgi = pywsgi +- self.options['log'] = None if self.quiet else 'default' ++ if self.options.pop('fast', None): ++ depr('The "fast" option has been deprecated and removed by Gevent.') ++ if self.quiet: ++ self.options['log'] = None + address = (self.host, self.port) +- server = wsgi.WSGIServer(address, handler, **self.options) ++ server = pywsgi.WSGIServer(address, handler, **self.options) + if 'BOTTLE_CHILD' in os.environ: + import signal + signal.signal(signal.SIGINT, lambda s, f: server.stop()) +-- +2.39.0.windows.2 + diff --git a/python-bottle.spec b/python-bottle.spec index c3e8ef6..cf945ef 100644 --- a/python-bottle.spec +++ b/python-bottle.spec @@ -1,6 +1,6 @@ Name: python-bottle Version: 0.12.13 -Release: 10 +Release: 11 Summary: WSGI micro web-framework for Python. License: MIT URL: https://github.com/bottlepy/bottle @@ -8,6 +8,7 @@ Source0: https://github.com/bottlepy/bottle/archive/%{version}/bottle-%{v Patch0000: CVE-2020-28473.patch #https://github.com/bottlepy/bottle/commit/e140e1b54da721a660f2eb9d58a106b7b3ff2f00 Patch0001: CVE-2022-31799.patch +Patch0002: 0001-fix-1065-gevent-1.3.0-removes-fast-wsgi-implementati.patch BuildArch: noarch BuildRequires: python3-devel python3-setuptools @@ -45,6 +46,9 @@ sed -i '/^#!/d' bottle.py %exclude %{_bindir}/bottle.py %changelog +* Thu Nov 09 2023 zhangliangpengkun - 0.12.13-11 +- fix #1065 gevent-1.3.0 removes 'fast' wsgi implementation. + * Tue Jun 14 2022 yaoxin - 0.12.13-10 - Fix CVE-2022-31799 -- Gitee