Fix Python 3.7 collections.abc DeprecationWarning

Signed-off-by: cherry530 <xuping33@huawei.com>
This commit is contained in:
cherry530 2022-03-31 11:32:46 +08:00
parent bdd8181008
commit 5f1ccba0fb
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From eff4960d941b51629f8378b1bd9498ed2aec92c7 Mon Sep 17 00:00:00 2001
From: Adam Johnson <me@adamj.eu>
Date: Wed, 8 May 2019 16:48:24 +0100
Subject: [PATCH] Fix Python 3.7 collections.abc DeprecationWarning
Should fix this
```
/.../bin/bottle.py:87: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it wil
l stop working
from collections import MutableMapping as DictMixin
```
---
bottle.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bottle.py b/bottle.py
index 3a51b38..f8398f1 100644
--- a/bottle.py
+++ b/bottle.py
@@ -84,7 +84,7 @@ if py3k:
from urllib.parse import urlencode, quote as urlquote, unquote as urlunquote
urlunquote = functools.partial(urlunquote, encoding='latin1')
from http.cookies import SimpleCookie
- from collections import MutableMapping as DictMixin
+ from collections.abc import MutableMapping as DictMixin
import pickle
from io import BytesIO
from configparser import ConfigParser

View File

@ -1,11 +1,14 @@
Name: python-bottle Name: python-bottle
Version: 0.12.13 Version: 0.12.13
Release: 9 Release: 10
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
Source0: https://github.com/bottlepy/bottle/archive/%{version}/bottle-%{version}.tar.gz Source0: https://github.com/bottlepy/bottle/archive/%{version}/bottle-%{version}.tar.gz
Patch0000: CVE-2020-28473.patch Patch0000: CVE-2020-28473.patch
#https://github.com/bottlepy/bottle/commit/eff4960d941b51629f8378b1bd9498ed2aec92c7
Patch0001: Fix-Python-3.7-collections.abc-DeprecationWarning.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel python3-setuptools BuildRequires: python3-devel python3-setuptools
@ -43,6 +46,9 @@ sed -i '/^#!/d' bottle.py
%exclude %{_bindir}/bottle.py %exclude %{_bindir}/bottle.py
%changelog %changelog
* Thu Mar 31 2022 xu_ping <xuping33@huawei.com> - 0.12.13-10
- Fix Python 3.7 collections.abc DeprecationWarning
* Fri Feb 19 2021 zhanghua <zhanghua40@huawei.com> - 0.12.13-9 * Fri Feb 19 2021 zhanghua <zhanghua40@huawei.com> - 0.12.13-9
- fix CVE-2020-28473 - fix CVE-2020-28473