From d017f13c95bf66d1dd702edb30ac8466cea04a54 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: May 27 2020 16:09:23 +0000 Subject: Fix Python 3.9 compatibility (#1792055) --- diff --git a/0005-fix-python-3.9-compatibility.patch b/0005-fix-python-3.9-compatibility.patch new file mode 100644 index 0000000..3780816 --- /dev/null +++ b/0005-fix-python-3.9-compatibility.patch @@ -0,0 +1,28 @@ +diff --git a/blosc/toplevel.py b/blosc/toplevel.py +index 94cf4af..2fa2c49 100644 +--- a/blosc/toplevel.py ++++ b/blosc/toplevel.py +@@ -435,9 +435,9 @@ def compress(bytesobj, typesize=8, clevel=9, shuffle=blosc.SHUFFLE, + Examples + -------- + +- >>> import array ++ >>> import array, sys + >>> a = array.array('i', range(1000*1000)) +- >>> a_bytesobj = a.tostring() ++ >>> a_bytesobj = a.tobytes() if sys.version_info >= (3, 0, 0) else a.tostring() + >>> c_bytesobj = blosc.compress(a_bytesobj, typesize=4) + >>> len(c_bytesobj) < len(a_bytesobj) + True +@@ -574,9 +574,9 @@ def decompress(bytesobj, as_bytearray=False): + Examples + -------- + +- >>> import array ++ >>> import array, sys + >>> a = array.array('i', range(1000*1000)) +- >>> a_bytesobj = a.tostring() ++ >>> a_bytesobj = a.tobytes() if sys.version_info >= (3, 0, 0) else a.tostring() + >>> c_bytesobj = blosc.compress(a_bytesobj, typesize=4) + >>> a_bytesobj2 = blosc.decompress(c_bytesobj) + >>> a_bytesobj == a_bytesobj2 diff --git a/python-blosc.spec b/python-blosc.spec index 7f1abdd..ec59bc5 100644 --- a/python-blosc.spec +++ b/python-blosc.spec @@ -1,7 +1,7 @@ Summary: Python wrapper for the Blosc high performance compressor Name: python-blosc Version: 1.8.1 -Release: 6%{?dist} +Release: 7%{?dist} License: MIT URL: https://github.com/Blosc/python-blosc Source0: https://github.com/Blosc/python-blosc/archive/v%{version}/blosc-%{version}.tar.gz @@ -12,6 +12,9 @@ Patch2: 0002-setup.py-unbreak-build-on-architectures-which-don-t-.patch Patch3: 0003-setup.py-catch-import-error-for-cpuinfo.patch # https://github.com/Blosc/python-blosc/pull/202 Patch4: 0004-Read-os-release-instead-of-using-platform.linux_dist.patch +# Fix Python 3.9 compatibility +# https://github.com/Blosc/python-blosc/pull/218 +Patch5: 0005-fix-python-3.9-compatibility.patch BuildRequires: gcc BuildRequires: blosc-devel >= 1.16.0 @@ -57,6 +60,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %__python3 -c 'import sys, blosc; sys %doc README.rst RELEASE_NOTES.rst %changelog +* Wed May 27 2020 Charalampos Stratakis - 1.8.1-7 +- Fix Python 3.9 compatibility (#1792055) + * Tue May 26 2020 Miro HronĨok - 1.8.1-6 - Rebuilt for Python 3.9