From 2e38555ae5d12b6825710c79540c017bccc5dc02ca1ed79b29236a6d5daa918e Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 14 Oct 2019 07:14:40 +0000 Subject: [PATCH] * Update to 0.18.0 * Add a patch to correct MIME type detection for Python 3.8 * Drop python38-compat.patch, included in the new release OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-future?expand=0&rev=24 --- future-0.17.1.tar.gz | 3 -- future-0.18.0.tar.gz | 3 ++ future-correct-mimetype.patch | 22 +++++++++++++++ python-future.spec | 15 +++++----- python38-compat.patch | 53 ----------------------------------- 5 files changed, 32 insertions(+), 64 deletions(-) delete mode 100644 future-0.17.1.tar.gz create mode 100644 future-0.18.0.tar.gz create mode 100644 future-correct-mimetype.patch delete mode 100644 python38-compat.patch diff --git a/future-0.17.1.tar.gz b/future-0.17.1.tar.gz deleted file mode 100644 index 6e9cd6f..0000000 --- a/future-0.17.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:67045236dcfd6816dc439556d009594abf643e5eb48992e36beac09c2ca659b8 -size 829119 diff --git a/future-0.18.0.tar.gz b/future-0.18.0.tar.gz new file mode 100644 index 0000000..e029c87 --- /dev/null +++ b/future-0.18.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6142ef79e2416e432931d527452a1cab3aa4a754a0a53d25b2589f79e1106f34 +size 830016 diff --git a/future-correct-mimetype.patch b/future-correct-mimetype.patch new file mode 100644 index 0000000..803daa4 --- /dev/null +++ b/future-correct-mimetype.patch @@ -0,0 +1,22 @@ +--- a/tests/test_future/test_urllib2.py 2019-10-14 12:22:14.230684473 +1100 ++++ b/tests/test_future/test_urllib2.py 2019-10-14 12:35:31.722438625 +1100 +@@ -691,6 +691,10 @@ + h = NullFTPHandler(data) + h.parent = MockOpener() + ++ # MIME guessing works in Python 3.8! ++ guessed_mime = None ++ if sys.hexversion >= 0x03080000: ++ guessed_mime = "image/gif" + for url, host, port, user, passwd, type_, dirs, filename, mimetype in [ + ("ftp://localhost/foo/bar/baz.html", + "localhost", ftplib.FTP_PORT, "", "", "I", +@@ -709,7 +714,7 @@ + ["foo", "bar"], "", None), + ("ftp://localhost/baz.gif;type=a", + "localhost", ftplib.FTP_PORT, "", "", "A", +- [], "baz.gif", None), # XXX really this should guess image/gif ++ [], "baz.gif", guessed_mime), + ]: + req = Request(url) + req.timeout = None diff --git a/python-future.spec b/python-future.spec index 513ea67..8f14f4e 100644 --- a/python-future.spec +++ b/python-future.spec @@ -12,25 +12,24 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-future -Version: 0.17.1 +Version: 0.18.0 Release: 0 Summary: Single-source support for Python 3 and 2 -# See https://github.com/PythonCharmers/python-future/issues/242 for PSF licensing License: MIT AND Python-2.0 -URL: https://python-future.org +# See https://github.com/PythonCharmers/python-future/issues/242 for PSF licensing +Url: https://python-future.org Source0: https://files.pythonhosted.org/packages/source/f/future/future-%{version}.tar.gz Source100: python-future-rpmlintrc -# PATCH-FIX-UPSTREAM python38-compat.patch gh#PythonCharmers/python-future#447 mcepl@suse.com -# Python 3.8 removed urllib.request.splitattr -Patch0: python38-compat.patch # PATCH-FIX-UPSTREAM python38-pow.patch gh#PythonCharmers/python-future#474 mcepl@suse.com -Patch1: python38-pow.patch +Patch0: python38-pow.patch +# UPSTREAM ISSUE https://github.com/PythonCharmers/python-future/issues/508 +Patch1: future-correct-mimetype.patch BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes diff --git a/python38-compat.patch b/python38-compat.patch deleted file mode 100644 index 1c22c85..0000000 --- a/python38-compat.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 4b1ddb49e8e7d4c812c50ac38d2c11db64ac9c1e Mon Sep 17 00:00:00 2001 -From: Chih-Hsuan Yen -Date: Fri, 28 Sep 2018 14:39:32 +0800 -Subject: [PATCH] Fix urllib.request imports for Python 3.8 compatibility - -Fixes https://github.com/PythonCharmers/python-future/issues/447 ---- - src/future/moves/urllib/request.py | 23 ++++++++++++----------- - 1 file changed, 12 insertions(+), 11 deletions(-) - -diff --git a/src/future/moves/urllib/request.py b/src/future/moves/urllib/request.py -index 60e440a..972aa4a 100644 ---- a/src/future/moves/urllib/request.py -+++ b/src/future/moves/urllib/request.py -@@ -11,19 +11,8 @@ - proxy_bypass, - quote, - request_host, -- splitattr, -- splithost, -- splitpasswd, -- splitport, -- splitquery, -- splittag, -- splittype, -- splituser, -- splitvalue, - thishost, -- to_bytes, - unquote, -- unwrap, - url2pathname, - urlcleanup, - urljoin, -@@ -32,6 +21,18 @@ - urlretrieve, - urlsplit, - urlunparse) -+ -+ from urllib.parse import (splitattr, -+ splithost, -+ splitpasswd, -+ splitport, -+ splitquery, -+ splittag, -+ splittype, -+ splituser, -+ splitvalue, -+ to_bytes, -+ unwrap) - else: - __future_module__ = True - with suspend_hooks():