From 94ef54d2c1aa2535fc93f505b8472927c7fa8399 Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Jan 06 2020 13:35:10 +0000 Subject: Fix compatibility with Python 3.9 https://github.com/bottlepy/bottle/commit/eff4960d941b51629f8378b1bd9498ed2aec92c7 Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1788121 --- diff --git a/python-bottle.spec b/python-bottle.spec index 0ae5247..f46688b 100644 --- a/python-bottle.spec +++ b/python-bottle.spec @@ -9,6 +9,10 @@ License: MIT URL: http://bottlepy.org Source0: https://github.com/bottlepy/%{srcname}/archive/%{version}.tar.gz#/%{srcname}-%{version}.tar.gz +# Python 3.9 compatibility +# https://github.com/bottlepy/bottle/commit/eff4960d941b51629f8378b1bd9498ed2aec92c7 +Patch1: python39.patch + BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel @@ -33,7 +37,7 @@ template engines. All in a single file and with no dependencies other than the Python Standard Library. %prep -%setup -q -n %{srcname}-%{version} +%autosetup -p1 -n %{srcname}-%{version} sed -i '/^#!/d' bottle.py %build diff --git a/python39.patch b/python39.patch new file mode 100644 index 0000000..97f46e9 --- /dev/null +++ b/python39.patch @@ -0,0 +1,28 @@ +From eff4960d941b51629f8378b1bd9498ed2aec92c7 Mon Sep 17 00:00:00 2001 +From: Adam Johnson +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 will 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