-
Notifications
You must be signed in to change notification settings - Fork 601
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
Python3 support #615
base: master
Are you sure you want to change the base?
Python3 support #615
Conversation
This is a first step towards achieving compatibility with py2.6/2.7 and py3.3+ out of the same codebase.
Also get rid of basestring so tests can start to be run on py3k.
The performance impact of this should be fairly limited but it allows to run the same code with py3k.
None of the callsites is performance critical (the ranges in question are tiny) and this allows for the same code to be run on py3k.
The callsites seemed to all parse the config, making them just strings instead of possibly unicode string on py2.x
We now import the most suitable StringIO to the platform from a single place instead of from n files.
…import on py3k The name needs to be different from the package name so the test can import the correct name.
This is done so we can keep the existing long() typecasts in place, though it's unclear if they're still needed. This commit just replaces the existing logic without taking a stance on that.
We always assume a utf8 encoding which is the case almost everywhere these days, and even in the places where it's not, the command line tools called actually mostly return just ASCII test which converts correctly anyway.
Also add __pycache__ files of py3k into the clean Makefile target.
Update several compat changes that were missed or added since origional commits - StringIO - urllib - print function
this needs in addition:
I don't know how to add those to this PR without creating a new one. I'd be cool if we could get some traction on merging Python3 compatibility. |
Hello guys. Any updates on this PR? Do you have some information about Python3 support? |
Oh, I need Python 3 support as well. It would be great. |
Is this the best place to revive the python3 support discussion? |
Just check the number of forks. I believe everybody just doing it's own fork now and upgrading to p3 |
Rebased version of #259:
This PR makes it possible to run and build Diamond with Python3.
Note that this breaks compatility with Pythons before 2.6 but that has mostly been the de facto state for a lot of the collectors even before this. (they depend on things like subprocess.check_output)