-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
[RFC] Remove Python 2 compatibility #1660
Conversation
Some of our modules use The modules:
The only one of those that offers an alternative that works in Python 3 is |
Well, I think that is it for now. I am using this branch in my desktop to look for any regressions, however as far I tested for my configuration it is working very well. I don't really know what you @ultrabug (and the other maintainers) will want to do with this PR. It was most for experiment, however it can be merged without problems. |
Thanks for this amazing work @m45t3r ! So far, 4.0 dev has not started so we will not be dropping python2 support until we work on the 4 branch. Your preliminary work will help a lot tho and could very well be the start of the 4.0 branch when we feel ready to move on this! |
50218cf breaks the people that already use py3status with mysqldb, they will need to change there config |
@cereal2nd if this PR is merged it would break anyway since AFAIK there is no port for Unless I am wrong. |
I'm talking about the sql module, |
@cereal2nd Huh, yeah, I understand that, however this incompatibility is unavoidable. Probably we should document it somewhere (in release notes or something). |
This is only used by Python 2 to define Unicode strings. In Python 3 all strings are already Unicode.
Not necessary anymore in Python 3 since it default file encoding to UTF-8.
MySQLdb does not support Python 3, so we need to drop it. Instead, use pymysql that should be compatible replacement of MySQLdb. WARNING: I did not test if this works.
Rebased and add a preliminary changelog. |
@thiagokokada hi mate as you may have noticed, we have worked on removing support for PY2 now thx to @hugovk does that sound okay to close this PR so you can maybe add your own new ideas on it if you wish to? |
This is mostly a PR to RFC a removal of Python 2 compatibility, as discussed in issue #1584.
What I basically did:
2to3
tool to help detect places where useless compatibility code was being used:u""
, imports with old name,__future__
imports, etc.Probably this should be missing things and also may introduce new bugs. However this PR serves as a benchmark on how much code can be simplified.