mySQL JSON not handled by drivers in py3
Issue #3754
resolved
the test suite itself reveals this, which was generally not being run against JSON here because it's not in mariadb:
#!
__________________________________________________ JSONTest_mysql_pymysql.test_rudimental_round_trip ___________________________________________________
[gw1] linux -- Python 3.5.1 /home/classic/dev/sqlalchemy/.tox/py35-mysql/bin/python
Traceback (most recent call last):
File "/home/classic/dev/sqlalchemy/test/dialect/mysql/test_types.py", line 645, in test_rudimental_round_trip
conn.scalar(select([mysql_json.c.foo])),
File "/home/classic/dev/sqlalchemy/.tox/py35-mysql/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 877, in scalar
return self.execute(object, *multiparams, **params).scalar()
File "/home/classic/dev/sqlalchemy/.tox/py35-mysql/lib/python3.5/site-packages/sqlalchemy/engine/result.py", line 1224, in scalar
return row[0]
File "/home/classic/dev/sqlalchemy/.tox/py35-mysql/lib/python3.5/site-packages/sqlalchemy/dialects/mysql/json.py", line 65, in process
return json_deserializer(value)
File "/opt/python3.5/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
Comments (4)
-
reporter -
reporter it's inconsistent vs. mysqldb, tracking at https://github.com/PyMySQL/PyMySQL/issues/488 so far.
-
reporter upstream is fixed, running through at https://gerrit.sqlalchemy.org/#/c/158/
-
reporter - changed status to resolved
Enable JSON testing for pymysql
PyMySQL upstream has released 0.7.6 which should resolve JSON encoding issues.
Change-Id: Icf543d48dace1419a0aac78bdb15ec666f0edafe Fixes:
#3754→ <<cset 6f9e8f482c13>>
- Log in to comment
seems to be a pymysql bug