-
Notifications
You must be signed in to change notification settings - Fork 442
Django KeyError <class 'bytes'> in version 1.4.0rc1 #306
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
Comments
Thank you for testing RC. It's intended, minor backward incompatible chage. You need to update Django if you want to use new mysqlclient. |
How to resolve this? |
Update Django. |
If you're like me and want to stay on long term Django release 1.11, don't update this library to version 1.4. |
I met the same problem,
salved by update mysqlclient from 1.4.1 to 1.3.14 |
Upstream changes are incompatible with older Django versions, see: PyMySQL/mysqlclient#306
mysqlclient 1.4.0 has a problem with Django below version 2. See PyMySQL/mysqlclient#306
* Pin mysqlclient to 1.3.14 PyMySQL/mysqlclient#306
I would like to formally protest to the "Upgrade Django" sentimentality, on two fronts. First, 1.4.0 is a minor release. According to Semver, introducing backwards-incompatible changes in a minor release is not permitted. By putting a breaking change in 1.4.0, and then denying this is a problem and telling people to upgrade Django, this project is publicly stating that it does not care about / does not adhere to Semver. Second, Django 1.11 is still a supported version of Django. It is in LTS. Telling people to "Upgrade Django" might be warranted if this error appeared only in a very old, unsupported version of Django (such as 1.5, 1.6, etc.), but Django 1.11 is still LTS until April 2020. In fact, Django 1.11 is the newest version of Django that is in LTS. Django 2.0 and 2.1 support will actually end before Django 1.11 support ends. Django 2.2 isn't out yet. So, one can rightly argue that Django 1.11 is the "current" version of Django, support-wise. Literally tens of thousands, maybe hundreds of thousands, of developers and sys admins worldwide depend on either Django 1.11 or MySQLClient-Python, and a substantial subset of those depend on both of them together. This cavalier disregard for those developers by introducing a breaking change in a minor release is disheartening. In my strongly-held opinion, this breaking change should be reverted and that revert immediately released in 1.4.2, and the breaking change should be introduced only in MySQLClient-Python 2.0, in accordance with Semver. |
Django touched many undocumented or private part of mysqlclient. It caused this crash. But I don't think it's a serious backward incompatibility of mysqlclient-python. Backward compatibility is supported only when public APIs are used, and don't relay on internal strucutre. Additionally, Django 1.11 doesn't support mysqlclient-1.3.14+ already. See these commit and comment.
Since Django 1.11 doesn't support mysqlclient-1.4 at first, there are no reason to add workaround for Django 1.11 in mysqlclient 1.4. If Django maintainer want Django works with mysqlclient-1.3.14+ and 1.4.1+, I am OK to add some workaround in mysqlclient. If you want to use Django 1.11 with mysqlclient 1.4+, discuss with Django maintainers about it and backport django/django#10726 to Django 1.11. |
It is not trully supported. It is security fix only mode. It doesn't fix any issues including this.
It is impossible. When I change query slightly for bugfix, it can be "breaking change" for some people. If I follow semver strongly, it means I need to increment major number every time. It doesn't make happy anyone. So this project never follow semver. It doesn't make any sense. But I'm thinking how to work around these breakage, not for semver, but for Django 1.11 users. If you're interested in contributing this project for Django user, please send pull request to add |
Everyone complain when theoricary backward-compatible change caused crash OSS maintainer is very frustrating job. |
Yes, it is. And your efforts are appreciated (at least by me!) as well as all your past hard work. If you want, I can test your PR with my setup which has the same error. To be fair, Django developers should use you API not private variables. Doing so is beyond stupid. LTR are great because you do not have to justify work to "update to the latest release" every time a new one is released. It is bad because you have to do a whole chunk later on but at least it's a one off. |
1.4.2post1 fixed this issue. Passes Django 1.11 test suite. |
* Pin prometheus-client to <0.4.0 Fixes #83 Simple dependency change that will fix tests and can be released as a working package. Follow up can adapt to the interface and metric name changes in 0.4.0 and depend on that version. * Pin mysqlclient to <1.4 Upstream changes are incompatible with older Django versions, see: PyMySQL/mysqlclient#306
Hi,
Just updated my dev server to the latest version (1.4.0rc1) and my Django server crashed when trying to connect to the local MySQL DB installed on Ubuntu server v16
The error occurs in the code below from django/db/backends/mysql/base.py
Specifically this line
conn.encoders[SafeBytes] = conn.encoders[bytes]
I've reverted back to 1.13.14 and all is well in the world again, hope this helps
Thanks
Omar
The text was updated successfully, but these errors were encountered: