MySQL SQLAlchemy 1.4 URL() is constructed incorrectly
_________________________________________________ test_sqlalchemy_mysql_url __________________________________________________
def test_sqlalchemy_mysql_url():
with mock.patch.dict(os.environ, {"AUR_CONFIG": "conf/config.defaults"}):
aurweb.config.rehash()
> assert db.get_sqlalchemy_url()
test/test_db.py:55:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
aurweb/db.py:21: in get_sqlalchemy_url
return sqlalchemy.engine.url.URL(
venv/lib/python3.8/site-packages/sqlalchemy/engine/url.py:100: in __new__
return URL.create(*arg, **kw)
venv/lib/python3.8/site-packages/sqlalchemy/engine/url.py:152: in create
cls._str_dict(query),
venv/lib/python3.8/site-packages/sqlalchemy/engine/url.py:207: in _str_dict
{
venv/lib/python3.8/site-packages/sqlalchemy/engine/url.py:208: in <dictcomp>
_assert_str(key): _assert_value(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
val = True
def _assert_value(val):
if isinstance(val, str):
return val
elif isinstance(val, collections_abc.Sequence):
return tuple(_assert_value(elem) for elem in val)
else:
> raise TypeError(
"Query dictionary values must be strings or "
"sequences of strings"
)
E TypeError: Query dictionary values must be strings or sequences of strings
venv/lib/python3.8/site-packages/sqlalchemy/engine/url.py:191: TypeError
SQLAlchemy Version 1.4.12
This is caused due to passing True
as the buffered
key's value. Removing the buffered
key pair completely removes this error, but I am not certain of all of the ramifications of that at this time.
This needs to be looked into and fixed.
Edited by Kevin Morris