From 6c0bc7eb01966825c1fcb70cde7753aeb00a759c Mon Sep 17 00:00:00 2001 From: wang--ge Date: Tue, 28 May 2024 10:38:12 +0800 Subject: [PATCH] fix #1115 and rebuild for openEuler-22.03-LTS-SP4 --- ...15-Some-modules-set-__file__-as-None.patch | 27 +++++++++++++++++++ python-bottle.spec | 9 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0003-fix-1115-Some-modules-set-__file__-as-None.patch diff --git a/0003-fix-1115-Some-modules-set-__file__-as-None.patch b/0003-fix-1115-Some-modules-set-__file__-as-None.patch new file mode 100644 index 0000000..4908cae --- /dev/null +++ b/0003-fix-1115-Some-modules-set-__file__-as-None.patch @@ -0,0 +1,27 @@ +From 076f41759ceacb1a804517270392f0ef75adb07f Mon Sep 17 00:00:00 2001 +From: Marcel Hellkamp +Date: Thu, 13 Dec 2018 08:26:27 +0100 +Subject: [PATCH] fix #1115: Some modules set __file__ as None + +This is not allowed (the __file__ attribute MUST be either a string, or unset), +but seems to happen anyway and is easy to work around in bottle. +--- + bottle.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bottle.py b/bottle.py +index 01b581e..f254bac 100644 +--- a/bottle.py ++++ b/bottle.py +@@ -3156,7 +3156,7 @@ class FileCheckerThread(threading.Thread): + files = dict() + + for module in list(sys.modules.values()): +- path = getattr(module, '__file__', '') ++ path = getattr(module, '__file__', '') or '' + if path[-4:] in ('.pyo', '.pyc'): path = path[:-1] + if path and exists(path): files[path] = mtime(path) + +-- +2.39.0.windows.2 + diff --git a/python-bottle.spec b/python-bottle.spec index 39a06b1..74b8cd5 100644 --- a/python-bottle.spec +++ b/python-bottle.spec @@ -1,6 +1,6 @@ Name: python-bottle Version: 0.12.13 -Release: 12 +Release: 14 Summary: WSGI micro web-framework for Python. License: MIT URL: https://github.com/bottlepy/bottle @@ -10,6 +10,7 @@ Patch0000: CVE-2020-28473.patch Patch0001: CVE-2022-31799.patch Patch0002: 0001-fix-1065-gevent-1.3.0-removes-fast-wsgi-implementati.patch Patch0003: 0002-Fix-930-DeprecationWarning-Flags-not-at-the-start-of.patch +Patch0004: 0003-fix-1115-Some-modules-set-__file__-as-None.patch BuildArch: noarch BuildRequires: python3-devel python3-setuptools @@ -47,6 +48,12 @@ sed -i '/^#!/d' bottle.py %exclude %{_bindir}/bottle.py %changelog +* Tue May 28 2024 Ge Wang - 0.12.13-14 +- rebuild for openEuler-22.03-LTS-SP4 + +* Tue May 28 2024 Ge Wang - 0.12.13-13 +- Fix #1115: Some modules set __file__ as None + * Wed Nov 22 2023 zhangliangpengkun - 0.12.13-12 - Fix #930: DeprecationWarning: Flags not at the start of the expression -- Gitee