Skip to content

Missing encoder when using Django 1.11 #326

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

Closed
jjmurre opened this issue Jan 21, 2019 · 2 comments
Closed

Missing encoder when using Django 1.11 #326

jjmurre opened this issue Jan 21, 2019 · 2 comments

Comments

@jjmurre
Copy link

jjmurre commented Jan 21, 2019

When using mysqlclient-python > 1.4.0 with Django 1.11, I get this error:

In /django/db/backends/mysql/base.py", line 276, in get_new_connection
    conn.encoders[SafeBytes] = conn.encoders[bytes]

KeyError: <type 'str'>

This can be easily reproduced as follows:

make a virtualenv
pip install mysqlclient-python  # version 1.4.0 or higher


>>> import MySQLdb
>>> conn = MySQLdb.connection('localhost')  # some connection
>>> conn.encoders[bytes]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: <type 'str'>
@methane
Copy link
Member

methane commented Jan 21, 2019

See #306.
Django touches many private areas of mysqlclient.

@methane methane closed this as completed Jan 21, 2019
@jjmurre
Copy link
Author

jjmurre commented Jan 21, 2019

Ok, tx for the quick reply! I have to stay on Django 1.11 LTS (organization policy), I will pin mysqlclient accordingly.

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

No branches or pull requests

2 participants