python-openid icon indicating copy to clipboard operation
python-openid copied to clipboard

Preliminary Python 3.x support, using 2to3

Open necaris opened this issue 12 years ago • 5 comments

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)

necaris avatar Dec 03 '12 14:12 necaris

were these added to the codebase yet?

pythonmobile avatar Dec 09 '12 02:12 pythonmobile

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 avatar Dec 09 '12 06:12 necaris

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?

pythonmobile avatar Dec 10 '12 00:12 pythonmobile

@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.

mitchellrj avatar Mar 26 '13 14:03 mitchellrj

@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 avatar Mar 26 '13 18:03 necaris