15
0
forked from pool/python-apsw

- Add more py3.8 patches:

* 0001-py3.8-avoid-invalid-escapes.patch
  * 0002-Skip-one-test-on-python3.8.patch
- Remove patch obsoleted by above python38.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-apsw?expand=0&rev=13
This commit is contained in:
Tomáš Chvátal
2019-09-10 13:41:49 +00:00
committed by Git OBS Bridge
parent 5f7d88c5e8
commit 240ffd9795
5 changed files with 87 additions and 26 deletions

View File

@@ -0,0 +1,53 @@
From 746197f51ecb229acd75bcd566a1199ebe5fafe8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
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",
<string>:1: SyntaxWarning: invalid escape sequence \i
<string>:1: SyntaxWarning: invalid escape sequence \i
<string>:1: SyntaxWarning: invalid escape sequence \i
<string>:1: SyntaxWarning: invalid escape sequence \i
<string>:1: SyntaxWarning: invalid escape sequence \i
<string>:1: SyntaxWarning: invalid escape sequence \i
<string>:1: SyntaxWarning: invalid escape sequence \i
<string>: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()

View File

@@ -0,0 +1,23 @@
From 8085e786afa0661418a8cefe5a1eaf7a535a5089 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
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

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Sep 10 13:32:46 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Add more py3.8 patches:
* 0001-py3.8-avoid-invalid-escapes.patch
* 0002-Skip-one-test-on-python3.8.patch
- Remove patch obsoleted by above python38.patch
-------------------------------------------------------------------
Thu Jul 4 13:10:16 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -26,7 +26,8 @@ License: Zlib
Group: Development/Libraries/Python
URL: https://github.com/rogerbinns/apsw/
Source: https://github.com/rogerbinns/apsw/archive/%{tarver}.tar.gz
Patch0: python38.patch
Patch0: 0001-py3.8-avoid-invalid-escapes.patch
Patch1: 0002-Skip-one-test-on-python3.8.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: pkgconfig
@@ -42,7 +43,7 @@ complete SQLite API into Python.
%prep
%setup -q -n apsw-%{tarver}
%patch0 -p1
%autopatch -p1
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"

View File

@@ -1,24 +0,0 @@
@@ -69,6 +69,9 @@ static void AddTraceBackHere(const char *filename, int lineno, const char *funct
/* make the dummy code object */
code = PyCode_New(
0, /*int argcount,*/
+#if PY_VERSION_HEX >= 0x030800A4
+ 0, /*int posonlyargcount*/
+#endif
#if PY_VERSION_HEX >= 0x03000000
0, /*int kwonlyargcount*/
#endif
Index: apsw-3.28.0-r1/src/traceback.c
===================================================================
--- apsw-3.28.0-r1.orig/src/traceback.c
+++ apsw-3.28.0-r1/src/traceback.c
@@ -69,6 +69,9 @@ static void AddTraceBackHere(const char
/* make the dummy code object */
code = PyCode_New(
0, /*int argcount,*/
+#if PY_VERSION_HEX >= 0x030800A4
+ 0, /*int posonlyargcount*/
+#endif
#if PY_VERSION_HEX >= 0x03000000
0, /*int kwonlyargcount*/
#endif