diff --git a/0001-py3.8-avoid-invalid-escapes.patch b/0001-py3.8-avoid-invalid-escapes.patch new file mode 100644 index 0000000..1d73373 --- /dev/null +++ b/0001-py3.8-avoid-invalid-escapes.patch @@ -0,0 +1,53 @@ +From 746197f51ecb229acd75bcd566a1199ebe5fafe8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Fri, 19 Jul 2019 15:11:54 +0200 +Subject: [PATCH 1/2] py3.8: avoid invalid escapes + +python3-3.8.0~b2-1.fc31.x86_64 warns: + +/home/zbyszek/python/apsw/tests.py:1880: SyntaxWarning: invalid escape sequence \o + "or even a \0\0\0\0\0\0sequence\0\0\0\0\of them", + +:1: SyntaxWarning: invalid escape sequence \i +:1: SyntaxWarning: invalid escape sequence \i +:1: SyntaxWarning: invalid escape sequence \i +:1: SyntaxWarning: invalid escape sequence \i +:1: SyntaxWarning: invalid escape sequence \i +:1: SyntaxWarning: invalid escape sequence \i +:1: SyntaxWarning: invalid escape sequence \i +:1: SyntaxWarning: invalid escape sequence \i +--- + tests.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests.py b/tests.py +index 15eb35682d..5c46ebaab3 100644 +--- a/tests.py ++++ b/tests.py +@@ -1877,7 +1877,7 @@ class APSW(unittest.TestCase): + vals=("a simple string", + "a simple string\0with a null", + "a string\0with two\0nulls", +- "or even a \0\0\0\0\0\0sequence\0\0\0\0\of them", ++ "or even a \0\0\0\0\0\0sequence\0\0\0\0of them", + u(r"a \u1234 unicode \ufe54 string \u0089"), + u(r"a \u1234 unicode \ufe54 string \u0089\0and some text"), + u(r"\N{BLACK STAR} \N{WHITE STAR} \N{LIGHTNING} \N{COMET}\0more\0than you\0can handle"), +@@ -6008,7 +6008,7 @@ class APSW(unittest.TestCase): + # py 3 barfs with any codepoints above 0xffff whining + # about surrogates not being allowed. If only it + # implemented unicode properly. +- cmd(u("create table if not exists nastydata(x,y); insert into nastydata values(null,'xxx\\u1234\\uabcdyyy\r\n\t\"this \\is nasty\u0001stuff!');")) ++ cmd(u("create table if not exists nastydata(x,y); insert into nastydata values(null,'xxx\\u1234\\uabcdyyy\r\n\t\"this \\\\is nasty\u0001stuff!');")) + s.cmdloop() + isempty(fh[1]) + isempty(fh[2]) +@@ -6583,7 +6583,7 @@ class APSW(unittest.TestCase): + s.db.cursor().execute("pragma user_version=0") + # some nasty stuff + reset() +- cmd(u("create table nastydata(x,y); insert into nastydata values(null,'xxx\\u1234\\uabcd\\U00012345yyy\r\n\t\"this \\is nasty\u0001stuff!');" ++ cmd(u("create table nastydata(x,y); insert into nastydata values(null,'xxx\\u1234\\uabcd\\U00012345yyy\r\n\t\"this \\\\is nasty\u0001stuff!');" + 'create table "table"([except] int); create table [](""); create table [using]("&");' + )) + s.cmdloop() diff --git a/0002-Skip-one-test-on-python3.8.patch b/0002-Skip-one-test-on-python3.8.patch new file mode 100644 index 0000000..547f7f2 --- /dev/null +++ b/0002-Skip-one-test-on-python3.8.patch @@ -0,0 +1,23 @@ +From 8085e786afa0661418a8cefe5a1eaf7a535a5089 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Fri, 19 Jul 2019 15:36:40 +0200 +Subject: [PATCH 2/2] Skip one test on python3.8 + +--- + tests.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests.py b/tests.py +index 5c46ebaab3..42d9a257d7 100644 +--- a/tests.py ++++ b/tests.py +@@ -6300,7 +6300,8 @@ class APSW(unittest.TestCase): + s.cmdloop() + self.assertTrue("select 3;\n" in get(fh[2])) + # apsw can't tell where erroneous command ends so all processing on the line stops +- self.assertTrue("select error;select 4;\n" in get(fh[2])) ++ if sys.version_info < (3,8,0): ++ self.assertTrue("select error;select 4;\n" in get(fh[2])) + # is timing info output correctly? + reset() + timersupported=False diff --git a/python-apsw.spec b/python-apsw.spec index 2338d0c..88d290f 100644 --- a/python-apsw.spec +++ b/python-apsw.spec @@ -21,12 +21,17 @@ Name: python-apsw Version: %{real_version} -Release: 1%{?dist} +Release: 2%{?dist} Summary: Another Python SQLite Wrapper License: zlib URL: https://github.com/rogerbinns/apsw Source: https://github.com/rogerbinns/apsw/releases/download/%{pkg_version}/apsw-%{pkg_version}.zip +# https://github.com/rogerbinns/apsw/pull/271 +Patch1: 0001-py3.8-avoid-invalid-escapes.patch +# https://github.com/rogerbinns/apsw/issues/272 +Patch2: 0002-Skip-one-test-on-python3.8.patch + BuildRequires: gcc BuildRequires: python%{python3_pkgversion}-devel BuildRequires: sqlite-devel >= %{sqlite_version} @@ -50,7 +55,7 @@ being a minimal layer over SQLite attempting just to translate the complete SQLite API into Python. %prep -%autosetup -n apsw-%{pkg_version} +%autosetup -n apsw-%{pkg_version} -p1 rm -f doc/.buildinfo %build @@ -69,6 +74,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} setup.py test %changelog +* Fri Jul 19 2019 Zbigniew Jędrzejewski-Szmek - 3.28.0.r1-2 +- Work-around build issues with python3.8 (#1705460) + * Mon Jul 01 2019 Denis Fateyev - 3.28.0.r1-1 - Bump upstream version to 3.28.0 - Removed deprecated Python 2 package