forked from pool/python-future
- Add 619-test-zero-byte.patch to fix
gh#PythonCharmers/python-future#618. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-future?expand=0&rev=42
This commit is contained in:
parent
7b0aa62f05
commit
7f0c4e5978
69
619-test-zero-byte.patch
Normal file
69
619-test-zero-byte.patch
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
From a6135542dffb6b1b8254d6daac779d119d4fc08c Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
|
||||||
|
Date: Wed, 17 May 2023 14:03:26 +0200
|
||||||
|
Subject: [PATCH 1/2] Adjust tests to the repr changes in CPython
|
||||||
|
|
||||||
|
---
|
||||||
|
tests/test_future/test_backports.py | 16 ++++++++++++----
|
||||||
|
1 file changed, 12 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/test_future/test_backports.py b/tests/test_future/test_backports.py
|
||||||
|
index 63b1afea..5d46b115 100644
|
||||||
|
--- a/tests/test_future/test_backports.py
|
||||||
|
+++ b/tests/test_future/test_backports.py
|
||||||
|
@@ -599,8 +599,12 @@ def test_yaml_linkage(self):
|
||||||
|
|
||||||
|
def test_repr(self):
|
||||||
|
od = OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])
|
||||||
|
- self.assertEqual(repr(od),
|
||||||
|
- "OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])")
|
||||||
|
+ if sys.version_info[0] == 3 and sys.version_info[1] >= 12:
|
||||||
|
+ self.assertEqual(repr(od),
|
||||||
|
+ "OrderedDict({'c': 1, 'b': 2, 'a': 3, 'd': 4, 'e': 5, 'f': 6})")
|
||||||
|
+ else:
|
||||||
|
+ self.assertEqual(repr(od),
|
||||||
|
+ "OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])")
|
||||||
|
self.assertEqual(eval(repr(od)), od)
|
||||||
|
self.assertEqual(repr(OrderedDict()), "OrderedDict()")
|
||||||
|
|
||||||
|
@@ -608,8 +612,12 @@ def test_repr_recursive(self):
|
||||||
|
# See issue #9826
|
||||||
|
od = OrderedDict.fromkeys('abc')
|
||||||
|
od['x'] = od
|
||||||
|
- self.assertEqual(repr(od),
|
||||||
|
- "OrderedDict([('a', None), ('b', None), ('c', None), ('x', ...)])")
|
||||||
|
+ if sys.version_info[0] == 3 and sys.version_info[1] >= 12:
|
||||||
|
+ self.assertEqual(repr(od),
|
||||||
|
+ "OrderedDict({'a': None, 'b': None, 'c': None, 'x': ...})")
|
||||||
|
+ else:
|
||||||
|
+ self.assertEqual(repr(od),
|
||||||
|
+ "OrderedDict([('a', None), ('b', None), ('c', None), ('x', ...)])")
|
||||||
|
|
||||||
|
def test_setdefault(self):
|
||||||
|
pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
|
||||||
|
|
||||||
|
From d7dc44e88b77fea57b9001421428cd7d95abb3bf Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
|
||||||
|
Date: Wed, 17 May 2023 14:42:09 +0200
|
||||||
|
Subject: [PATCH 2/2] Adjust test to the change in CPython, parser now raises
|
||||||
|
SyntaxError instead of ValueError when source code contains null bytes
|
||||||
|
|
||||||
|
---
|
||||||
|
tests/test_future/test_builtins.py | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tests/test_future/test_builtins.py b/tests/test_future/test_builtins.py
|
||||||
|
index 3921a608..d41d1254 100644
|
||||||
|
--- a/tests/test_future/test_builtins.py
|
||||||
|
+++ b/tests/test_future/test_builtins.py
|
||||||
|
@@ -523,8 +523,8 @@ def test_compile(self):
|
||||||
|
self.assertRaises(TypeError, compile)
|
||||||
|
self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'badmode')
|
||||||
|
self.assertRaises(ValueError, compile, 'print(42)\n', '<string>', 'single', 0xff)
|
||||||
|
- # Raises TypeError in Python < v3.5, ValueError in v3.5:
|
||||||
|
- self.assertRaises((TypeError, ValueError), compile, chr(0), 'f', 'exec')
|
||||||
|
+ # Raises TypeError in Python < v3.5, ValueError in v3.5, SyntaxError in >= 3.12:
|
||||||
|
+ self.assertRaises((TypeError, ValueError, SyntaxError), compile, chr(0), 'f', 'exec')
|
||||||
|
self.assertRaises(TypeError, compile, 'pass', '?', 'exec',
|
||||||
|
mode='eval', source='0', filename='tmp')
|
||||||
|
compile('print("\xe5")\n', '', 'exec')
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jul 4 22:14:59 UTC 2023 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- Add 619-test-zero-byte.patch to fix
|
||||||
|
gh#PythonCharmers/python-future#618.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Apr 21 12:25:35 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
Fri Apr 21 12:25:35 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@ -33,8 +33,12 @@ Patch1: future-correct-mimetype.patch
|
|||||||
# PATCH-FIX-UPSTREAM python39-build.patch gh#PythonCharmers/python-future#578 mcepl@suse.com
|
# PATCH-FIX-UPSTREAM python39-build.patch gh#PythonCharmers/python-future#578 mcepl@suse.com
|
||||||
# Overcome incompatibilites with python 3.9
|
# Overcome incompatibilites with python 3.9
|
||||||
Patch2: python39-build.patch
|
Patch2: python39-build.patch
|
||||||
|
# PATCH-FIX-UPSTREAM 619-test-zero-byte.patch gh#PythonCharmers/python-future#618 mcepl@suse.com
|
||||||
|
# incompatibilities with 3.11.4
|
||||||
|
Patch3: 619-test-zero-byte.patch
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
%if 0%{suse_version} >= 1550 || (0%{suse_version} == 1500 && 0%{?sle_version} >= 150400)
|
%if 0%{suse_version} >= 1550 || (0%{suse_version} == 1500 && 0%{?sle_version} >= 150400)
|
||||||
@ -53,15 +57,14 @@ It allows you to use a single Python 3.x-compatible codebase to
|
|||||||
support both Python 2 and Python 3.
|
support both Python 2 and Python 3.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n future-%{version}
|
%autosetup -p1 -n future-%{version}
|
||||||
%autopatch -p1
|
|
||||||
sed -i -e '/^#!\//, 1d' src/future/backports/test/pystone.py
|
sed -i -e '/^#!\//, 1d' src/future/backports/test/pystone.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
|
|
||||||
%python_clone -a %{buildroot}%{_bindir}/futurize
|
%python_clone -a %{buildroot}%{_bindir}/futurize
|
||||||
%python_clone -a %{buildroot}%{_bindir}/pasteurize
|
%python_clone -a %{buildroot}%{_bindir}/pasteurize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user