diff --git a/0010-Add-ServerAdapter-for-CherryPy-9.patch b/0010-Add-ServerAdapter-for-CherryPy-9.patch new file mode 100644 index 0000000000000000000000000000000000000000..21e86db948c322a599df54690f72b2e386435fa1 --- /dev/null +++ b/0010-Add-ServerAdapter-for-CherryPy-9.patch @@ -0,0 +1,46 @@ +From 888aa8e7b8f6490015463ee370ff4026fc951b1f Mon Sep 17 00:00:00 2001 +From: 06180339 +Date: Sat, 28 Jan 2017 23:29:29 +0100 +Subject: [PATCH] Add ServerAdapter for CherryPy >= 9 + +Since CherryPy >= 9, the server part of CherryPy has been extracted and named Cheroot. Thus the old CherryPy ServerAdapter does not work for CherryPy >= 9: the import fails, and the SSL part should be different too. Cheroot can be installed (git install cheroot) without CherryPy so that we can just have a CherootServer adapter in addition to the CherryPyServer adapter for the older versions. + +(cherry picked from commit b9229eef97ea246e3d0e0c455071d54435a1557d) +Signed-off-by: Juerg Haefliger +--- + bottle.py | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/bottle.py b/bottle.py +index 04ccf7d..73886a2 100644 +--- a/bottle.py ++++ b/bottle.py +@@ -2816,6 +2816,25 @@ class CherryPyServer(ServerAdapter): + server.stop() + + ++class CherootServer(ServerAdapter): ++ def run(self, handler): # pragma: no cover ++ from cheroot import wsgi ++ from cheroot.ssl import builtin ++ self.options['bind_addr'] = (self.host, self.port) ++ self.options['wsgi_app'] = handler ++ certfile = self.options.pop('certfile', None) ++ keyfile = self.options.pop('keyfile', None) ++ chainfile = self.options.pop('chainfile', None) ++ server = wsgi.Server(**self.options) ++ if certfile and keyfile: ++ server.ssl_adapter = builtin.BuiltinSSLAdapter( ++ certfile, keyfile, chainfile) ++ try: ++ server.start() ++ finally: ++ server.stop() ++ ++ + class WaitressServer(ServerAdapter): + def run(self, handler): + from waitress import serve +-- +2.39.0.windows.2 + diff --git a/python-bottle.spec b/python-bottle.spec index 532e064d892b3d6e087c7dec6cac9a5ad61d4510..5abc523b4c4ff528fa0de580b887cb33d1ae2e93 100644 --- a/python-bottle.spec +++ b/python-bottle.spec @@ -1,6 +1,6 @@ Name: python-bottle Version: 0.12.13 -Release: 18 +Release: 19 Summary: WSGI micro web-framework for Python. License: MIT URL: http://bottlepy.org @@ -17,6 +17,7 @@ Patch0007: 0006-1177-Bug-fix-of-missing-regex-escaped-back-slashes.patch Patch0008: 0007-Fix-the-Allow-header-value-in-405-Method-not-allowed.patch Patch0009: 0008-Fix-Multipart-file-uploads-with-empty-filename-not-d.patch Patch0010: 0009-Fix-for-Issue-586.patch +Patch0011: 0010-Add-ServerAdapter-for-CherryPy-9.patch BuildArch: noarch BuildRequires: python2-devel python2-setuptools python3-devel python3-setuptools @@ -71,6 +72,9 @@ sed -i '/^#!/d' bottle.py %{python3_sitelib}/* %changelog +* Thu Jan 18 2024 zhangliangpengkun - 0.12.13-19 +- Add ServerAdapter for CherryPy >= 9 + * Fri Jan 12 2024 zhangliangpengkun - 0.12.13-18 - The auth_basic() decorator doesn't use functools.wraps().