Open
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. |
pedmon
added a commit
to fasrc/Diamond
that referenced
this pull request
Jun 16, 2021
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)