fix make check failed
This commit is contained in:
parent
9a77032d67
commit
20846c1c21
@ -2,12 +2,14 @@
|
||||
|
||||
Name: python-sqlalchemy
|
||||
Version: 1.3.22
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: SQL toolkit and object relational mapper for Python
|
||||
License: MIT
|
||||
URL: http://www.sqlalchemy.org/
|
||||
Source0: https://files.pythonhosted.org/packages/source/S/SQLAlchemy/SQLAlchemy-%{version}.tar.gz
|
||||
|
||||
Patch0: tests_overcome_bpo42967.patch
|
||||
|
||||
BuildRequires: python3-devel python3-setuptools python3-pytest
|
||||
|
||||
%description
|
||||
@ -62,6 +64,12 @@ PYTHONPATH=. %{__python3} -m pytest test
|
||||
%doc doc examples
|
||||
|
||||
%changelog
|
||||
* Tue Mar 16 2021 tianwei <tianwei12@huawei.com> - 1.3.22-2
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix make check failed
|
||||
|
||||
* Mon Feb 1 2021 yuanxin <yuanxin24@huawei.com> - 1.3.22-1
|
||||
- Upgrade version to 1.3.22
|
||||
|
||||
|
||||
65
tests_overcome_bpo42967.patch
Normal file
65
tests_overcome_bpo42967.patch
Normal file
@ -0,0 +1,65 @@
|
||||
---
|
||||
lib/sqlalchemy/engine/url.py | 14 ++++++++++----
|
||||
test/dialect/mssql/test_engine.py | 3 ++-
|
||||
2 files changed, 12 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/lib/sqlalchemy/engine/url.py
|
||||
+++ b/lib/sqlalchemy/engine/url.py
|
||||
@@ -14,6 +14,7 @@ argument; alternatively, the URL is a pu
|
||||
be used directly and is also accepted directly by ``create_engine()``.
|
||||
"""
|
||||
|
||||
+import inspect
|
||||
import re
|
||||
|
||||
from .interfaces import Dialect
|
||||
@@ -218,7 +219,7 @@ class URL(object):
|
||||
return translated
|
||||
|
||||
|
||||
-def make_url(name_or_url):
|
||||
+def make_url(name_or_url, separator='&'):
|
||||
"""Given a string or unicode instance, produce a new URL instance.
|
||||
|
||||
The given string is parsed according to the RFC 1738 spec. If an
|
||||
@@ -226,12 +227,12 @@ def make_url(name_or_url):
|
||||
"""
|
||||
|
||||
if isinstance(name_or_url, util.string_types):
|
||||
- return _parse_rfc1738_args(name_or_url)
|
||||
+ return _parse_rfc1738_args(name_or_url, separator)
|
||||
else:
|
||||
return name_or_url
|
||||
|
||||
|
||||
-def _parse_rfc1738_args(name):
|
||||
+def _parse_rfc1738_args(name, qs_sep):
|
||||
pattern = re.compile(
|
||||
r"""
|
||||
(?P<name>[\w\+]+)://
|
||||
@@ -261,7 +262,12 @@ def _parse_rfc1738_args(name):
|
||||
if len(tokens) > 1:
|
||||
query = {}
|
||||
|
||||
- for key, value in util.parse_qsl(tokens[1]):
|
||||
+ if 'separator' in inspect.signature(util.parse_qsl).parameters:
|
||||
+ qs_dict = util.parse_qsl(tokens[1], separator=qs_sep)
|
||||
+ else:
|
||||
+ qs_dict = util.parse_qsl(tokens[1])
|
||||
+
|
||||
+ for key, value in qs_dict:
|
||||
if util.py2k:
|
||||
key = key.encode("ascii")
|
||||
if key in query:
|
||||
--- a/test/dialect/mssql/test_engine.py
|
||||
+++ b/test/dialect/mssql/test_engine.py
|
||||
@@ -164,7 +164,8 @@ class ParseConnectTest(fixtures.TestBase
|
||||
u = url.make_url(
|
||||
"mssql+pyodbc://@server_name/db_name?"
|
||||
"driver=ODBC+Driver+17+for+SQL+Server;"
|
||||
- "authentication=ActiveDirectoryIntegrated"
|
||||
+ "authentication=ActiveDirectoryIntegrated",
|
||||
+ separator=';'
|
||||
)
|
||||
connection = dialect.create_connect_args(u)
|
||||
eq_(connection[1], {})
|
||||
Loading…
x
Reference in New Issue
Block a user