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

escape_string() broken with Python 2.x #23

Closed
jmuchemb opened this issue Feb 23, 2015 · 1 comment · Fixed by #24
Closed

escape_string() broken with Python 2.x #23

jmuchemb opened this issue Feb 23, 2015 · 1 comment · Fixed by #24

Comments

@jmuchemb
Copy link

$ python -c 'import MySQLdb; print(MySQLdb.escape_string(b"foo"))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: must be impossible<bad format char>, not str
$ python3 -c 'import MySQLdb; print(MySQLdb.escape_string(b"foo"))'
b'foo'

Tested on Debian with version 1.3.4-1 (packaged in experimental), MariaDB 10.0.16-1 and Python 2.7.9-1
I also tried 1.3.5 but it's not better.

@methane
Copy link
Member

methane commented Feb 24, 2015

Good catch!

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 a pull request may close this issue.

2 participants