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
Replace MySQL-python with mysqlclient. #2609
Conversation
@rodrigc, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tardyp, @rutsky and @tomprince to be potential reviewers. |
I can see in http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#py3k-support that sqlalchemy confirms it supported. So the problem should be easy. Do you need me to take a look? |
@rodrigc docs contains info about running Buildbot test suite using MySQL database from Docker (quite easy to setup on Linux): https://docs.buildbot.net/latest/developer/database.html#run-databases-in-docker You can use these docs for testing locally, plus please update examples there to use |
MySQL-python does not work on Python 3. On the Python Wall of Superpowers ( https://python3wos.appspot.com/ ), mysqlclient is listed as the Python 3 alternative to MySQL-python.
mysqlclient supports Python 3
updated the PR with some fixes for mysqlclient |
try: | ||
from _mysql_exceptions import Warning | ||
import mysqlclient | ||
[mysqlclient] # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try following:
import mysqlclient # noqa pylint: disable=unused-import
instead of
import mysqlclient
[mysqlclient] # noqa
# we swap _mysql_exceptions.Warning arguments so that the code is in second place | ||
|
||
def patched_init(self, *args): | ||
if isinstance(args[0], long): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tardyp I just noticed this change that you did. This causes a problem on Python 3, because
there is no long
type there. Can you fix this?
As you are introducing new patches, can you run the tests in a Python3 virtualenv, just to double check
that new Python 3 regressions are being introduced as we move forward?
Thanks.
MySQL-python does not work on Python 3.
On the Python Wall of Superpowers ( https://python3wos.appspot.com/ ),
mysqlclient is listed as the Python 3 alternative to MySQL-python.