You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/tmp/tester.py", line 28, in
session.query(MyTable).all()
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3161, in all
return list(self)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 105, in instances
util.raise_from_cause(err)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
raise value
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 85, in instances
rows = [proc(row) for row in fetch]
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 85, in
rows = [proc(row) for row in fetch]
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 572, in _instance
populators,
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 693, in populate_full
dict[key] = getter(row)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/sql/type_api.py", line 1247, in process
return process_value(impl_processor(value), dialect)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/sql/sqltypes.py", line 943, in process
value = bytes(value)
TypeError: string argument without an encoding
The text was updated successfully, but these errors were encountered:
More digging shows that the LargeBinary type is broken in sqlalchemy==1.3.1 (at least for python3 and mysql backend), as I am able to reproduce the error using just a LargeBinary type column in place of the EncryptedType.
When querying a record with a column of EncryptedType in python3.7 with a MySQL backend and packages
The query fails with TypeError: 'string argument without an encoding'.
The issue appears to be that EncryptedType has an
impl
of LargeBinary which in python3 processes the returned value with the commandHowever the value is an Unicode string and therefore the above call is not valid. The following code reproduces the error
Traceback (most recent call last):
File "/tmp/tester.py", line 28, in
session.query(MyTable).all()
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3161, in all
return list(self)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 105, in instances
util.raise_from_cause(err)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
raise value
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 85, in instances
rows = [proc(row) for row in fetch]
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 85, in
rows = [proc(row) for row in fetch]
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 572, in _instance
populators,
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/orm/loading.py", line 693, in populate_full
dict[key] = getter(row)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/sql/type_api.py", line 1247, in process
return process_value(impl_processor(value), dialect)
File "/tmp/python/lib/python3.7/site-packages/sqlalchemy/sql/sqltypes.py", line 943, in process
value = bytes(value)
TypeError: string argument without an encoding
The text was updated successfully, but these errors were encountered: