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
Python 3 compatibility #242
Comments
So you're trying to use PyGithub with Python 3 directly from the source code without using 2to3 first. Until now, the "correct" (understand "simple" and "supported") way to use PyGithub with Python 3 is to run "python3 setup.py install" and then use the installed version, because the use2to3 setuptools option will fix the code for you. If you really want to work in the source tree, you can run ./manage/2to3.sh first. I'm not sure writing code compatible with both python 2 and 3 is worth it; I will keep this issue open until I've more time to think about it, but things like "iteritems" on dictionaries becoming "items", or name changes for imports may make it cumbersome, while the use2to3=True has proved to be reliable and easy to manage in v1 of PyGithub. And by the way, Travis verifies PyGithub works with Python 3: https://travis-ci.org/jacquev6/PyGithub/builds/21856204 |
I faced the same problems with python3 following the installation guide http://jacquev6.github.io/PyGithub/v2/introduction.html#installation . The problem is that at the end of the installation process we are inside the source tree and the execution of Adding Thank you. |
That's very true, thank you! I will make this change soon. |
Closing this issue now: I'll continue to use the use2to3 option and not try to write code that can be used as-is with the two major versions of Python. |
These lines cause errors in Python 3:
https://github.com/jacquev6/PyGithub/blob/develop_v2/PyGithub/Blocking/_receive.py#L68
https://github.com/jacquev6/PyGithub/blob/develop_v2/PyGithub/Blocking/_receive.py#L120
If I'm reading http://python3porting.com/noconv.html correctly, they could be written like this, which would work for Python 2.6 and later:
The text was updated successfully, but these errors were encountered: