!32 [sync] PR-22: fix #1065 gevent-1.3.0 removes 'fast' wsgi implementation.

From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2023-11-27 02:52:32 +00:00 committed by Gitee
commit e61c5c5e57
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,37 @@
From 19a12f898b7343e16f0d08821de6aac169143752 Mon Sep 17 00:00:00 2001
From: Marcel Hellkamp <marc@gsites.de>
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

View File

@ -1,6 +1,6 @@
Name: python-bottle Name: python-bottle
Version: 0.12.13 Version: 0.12.13
Release: 10 Release: 11
Summary: WSGI micro web-framework for Python. Summary: WSGI micro web-framework for Python.
License: MIT License: MIT
URL: https://github.com/bottlepy/bottle 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 Patch0000: CVE-2020-28473.patch
#https://github.com/bottlepy/bottle/commit/e140e1b54da721a660f2eb9d58a106b7b3ff2f00 #https://github.com/bottlepy/bottle/commit/e140e1b54da721a660f2eb9d58a106b7b3ff2f00
Patch0001: CVE-2022-31799.patch Patch0001: CVE-2022-31799.patch
Patch0002: 0001-fix-1065-gevent-1.3.0-removes-fast-wsgi-implementati.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel python3-setuptools BuildRequires: python3-devel python3-setuptools
@ -45,6 +46,9 @@ sed -i '/^#!/d' bottle.py
%exclude %{_bindir}/bottle.py %exclude %{_bindir}/bottle.py
%changelog %changelog
* Thu Nov 09 2023 zhangliangpengkun<zhangliangpengkun@xfusion.com> - 0.12.13-11
- fix #1065 gevent-1.3.0 removes 'fast' wsgi implementation.
* Tue Jun 14 2022 yaoxin <yaoxin30@h-partners.com> - 0.12.13-10 * Tue Jun 14 2022 yaoxin <yaoxin30@h-partners.com> - 0.12.13-10
- Fix CVE-2022-31799 - Fix CVE-2022-31799