Preliminary Python 3.x support, using 2to3 #52

Open
wants to merge 16 commits into
from

Conversation

Projects
None yet
3 participants
@necaris

necaris commented Dec 3, 2012

Add:

  • support for running 2to3 as part of the build process
  • a custom 2to3 fixer to ensure tests are patched too
  • minor changes to modules to ensure they work with Python 3
  • metadata to declare Python 3 support

The existing test suite passes under Python 3.2 on Linux (Fedora 17, x86_64)

@pythonmobile

This comment has been minimized.

Show comment Hide comment
@pythonmobile

pythonmobile Dec 9, 2012

were these added to the codebase yet?

were these added to the codebase yet?

@necaris

This comment has been minimized.

Show comment Hide comment
@necaris

necaris Dec 9, 2012

It doesn't look like the pull request has been merged, if that's what you mean?

Note that this doesn't actually make things work under Python 3, it just makes them work enough to be importable. If this is something more people need I could put some more effort into making it work, but for my current project I've simply started a port since backward compatibility is a bit more work (especially as there are a lot of issues with str / bytes boundaries in this project).

necaris commented Dec 9, 2012

It doesn't look like the pull request has been merged, if that's what you mean?

Note that this doesn't actually make things work under Python 3, it just makes them work enough to be importable. If this is something more people need I could put some more effort into making it work, but for my current project I've simply started a port since backward compatibility is a bit more work (especially as there are a lot of issues with str / bytes boundaries in this project).

@pythonmobile

This comment has been minimized.

Show comment Hide comment
@pythonmobile

pythonmobile Dec 10, 2012

necaris: I am having this wierd problem that when I use flask openid with one machine, When I click the login button, I get an internal server error. I cant pin point the error. Any ideas how to do this?

necaris: I am having this wierd problem that when I use flask openid with one machine, When I click the login button, I get an internal server error. I cant pin point the error. Any ideas how to do this?

@mitchellrj

This comment has been minimized.

Show comment Hide comment
@mitchellrj

mitchellrj Mar 26, 2013

@necaris It may be better to just add the use_2to3 flag to the setup.py and let distribute handle the rest as appropriate. Better still, hand-tune the Python 3 adaptations so that Python < 2.6 is still supported.

@necaris It may be better to just add the use_2to3 flag to the setup.py and let distribute handle the rest as appropriate. Better still, hand-tune the Python 3 adaptations so that Python < 2.6 is still supported.

@necaris

This comment has been minimized.

Show comment Hide comment
@necaris

necaris Mar 26, 2013

@mitchellrj cheers for the tip -- unfortunately this patch doesn't actually come close to making it work on Python 3, it just fixes the most glaring of the SyntaxErrors you get even after 2to3 runs.

Since this package works separately with text and bytestrings, and the boundaries between them aren't well-defined, I found it too painful to try and make all of the code upgradable with 2to3 while remaining compatible with older versions of Python. I'm keeping this pull request open just in case there's some interest from upstream, but I've moved most of my effort over to actually porting the library (https://pypi.python.org/pypi/python3-openid/3.0.1) and maybe slowly cleaning it up and modernizing things.

necaris commented Mar 26, 2013

@mitchellrj cheers for the tip -- unfortunately this patch doesn't actually come close to making it work on Python 3, it just fixes the most glaring of the SyntaxErrors you get even after 2to3 runs.

Since this package works separately with text and bytestrings, and the boundaries between them aren't well-defined, I found it too painful to try and make all of the code upgradable with 2to3 while remaining compatible with older versions of Python. I'm keeping this pull request open just in case there's some interest from upstream, but I've moved most of my effort over to actually porting the library (https://pypi.python.org/pypi/python3-openid/3.0.1) and maybe slowly cleaning it up and modernizing things.

@brianray brianray referenced this pull request in chicagopython/chipy.org Oct 30, 2015

Open

Update site to Python3 #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment