Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sqlite 8-bit bytestrings with unicode coercion #1099

Merged
merged 4 commits into from Dec 4, 2017
Merged

Fix sqlite 8-bit bytestrings with unicode coercion #1099

merged 4 commits into from Dec 4, 2017

Conversation

gunthercox
Copy link
Owner

Closes #1089
Closes #1020

This will cause an error in SqlAlchemy in Python 2.7

ProgrammingError: (sqlite3.ProgrammingError) You must not use
8-bit bytestrings unless you use a text_factory that can interpret
8-bit bytestrings (like text_factory = str). It is highly
recommended that you instead just switch your application
to Unicode strings. [SQL: u'SELECT statement.id AS statement_id,
statement.text AS statement_text, statement.extra_data AS
statement_extra_data \nFROM statement \nWHERE statement.text
= ?\n LIMIT ? OFFSET ?']
[parameters: ('\xe4\xbd\xa0\xe5\xa5\xbd\xe5\x90\x97', 1, 0)]
Copy link
Collaborator

@vkosuri vkosuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@gunthercox gunthercox merged commit 1a2ab56 into master Dec 4, 2017
@gunthercox gunthercox deleted the byte branch December 4, 2017 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants