forked from pool/python-mysqlclient
- Add liberally-accept-charsets.patch:
* Support multibyte utf8 return values with new versions of MariaDB. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mysqlclient?expand=0&rev=26
This commit is contained in:
23
liberally-accept-charsets.patch
Normal file
23
liberally-accept-charsets.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
Index: mysqlclient-2.0.3/tests/test_MySQLdb_capabilities.py
|
||||
===================================================================
|
||||
--- mysqlclient-2.0.3.orig/tests/test_MySQLdb_capabilities.py
|
||||
+++ mysqlclient-2.0.3/tests/test_MySQLdb_capabilities.py
|
||||
@@ -189,12 +189,14 @@ VALUES (1,
|
||||
with closing(connection_factory(**kwargs)) as conn:
|
||||
with closing(conn.cursor()) as c:
|
||||
c.execute("SELECT CHARSET(%s)", (MySQLdb.Binary(b"raw bytes"),))
|
||||
- self.assertEqual(
|
||||
- c.fetchall()[0][0], "binary" if binary_prefix else "utf8"
|
||||
- )
|
||||
+ res = ("utf8", "utf8mb3", "utf8mb4")
|
||||
+ if binary_prefix:
|
||||
+ self.assertEqual(c.fetchall()[0][0], "binary")
|
||||
+ else:
|
||||
+ self.assertIn(c.fetchall()[0][0], res)
|
||||
# normal strings should not get prefix
|
||||
c.execute("SELECT CHARSET(%s)", ("str",))
|
||||
- self.assertEqual(c.fetchall()[0][0], "utf8")
|
||||
+ self.assertIn(c.fetchall()[0][0], res)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 10 07:48:36 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Add liberally-accept-charsets.patch:
|
||||
* Support multibyte utf8 return values with new versions of MariaDB.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 16 20:42:57 UTC 2021 - Matthias Fehring <buschmann23@opensuse.org>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package python-mysqlclient-test
|
||||
# spec file
|
||||
#
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
#
|
||||
@@ -35,6 +35,7 @@ Summary: Python interface to MySQL
|
||||
License: GPL-2.0-or-later
|
||||
URL: https://github.com/PyMySQL/mysqlclient-python
|
||||
Source: https://files.pythonhosted.org/packages/source/m/mysqlclient/mysqlclient-%{version}.tar.gz
|
||||
Patch0: liberally-accept-charsets.patch
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
@@ -69,6 +70,7 @@ This package adds Python 3 support and bug fixes to MySQLdb1.
|
||||
|
||||
%prep
|
||||
%setup -q -n mysqlclient-%{version}
|
||||
%autopatch -p1
|
||||
|
||||
%build
|
||||
%if !%{with test}
|
||||
|
||||
Reference in New Issue
Block a user