"string argument without an encoding" when using EncryptedType #5365
Labels
question
issue where a "fix" on the SQLAlchemy side is unlikely, hence more of a usage question
third party integration issues
issues to do with other libraries and frameworks
Describe the bug
EncryptedType throws an error when using with
mysql+pymysql
connection.The example works on
sqlite
type of connections but throwsTypeError: string argument without an encoding
when using with mysql. The cause of the error is this line of codevalue = bytes(value)
Expected behavior
Should be able to properly use EncryptedTypes with mysql database.
To Reproduce
We've had a complex system using sql alchemy so first, I just tried to reproduce it using the example code from the documentation
Error
Versions.
Additional context
It is also worth noting that the entries are properly inserted in the database. This observation is consistent with what we encounter in our system. The inserts seem to work. But when you try to access the object or query the object using encrypted columns as filter, it doesn't seem to work. It throws the same error as above.
Thank you! 🙇🏻♂️🙇🏻♂️🙇🏻♂️
The text was updated successfully, but these errors were encountered: