#9 Declined
Repository
mitchellrj
Branch
py3.2
Repository
ianb
Branch
default
Author
  1. Richard Mitchell
Reviewers
Description

Adds support for Python 3 by way of distribute's use_2to3 flag. See http://packages.python.org/distribute/python3.html

Tested on Python 3.2 with zc.buildout 2.0.0a1.

Comments (17)

  1. Tiziano Müller

    One of the main problems I see with python3-support is the strict distinction between bytes and str. In wsgilib.py for example all the elements ending up in the output are expected to be strings and the result is a string. While for example in tests/test_urlparser.py a string is always converted to bytes because of:

      if isinstance(s, str):
        s = s.decode("utf-8")
    

    leading to a lot of the following errors:

    [...]
        return (self.body.find(s) != -1
    TypeError: Can't convert 'bytes' object to str implicitly
    

    What should it be: should the body be in bytes (requires a lot of work) or should the s be in bytes?

  2. Cyril Roelandt

    OK, I'm looking into this because I really need a working port to Python 3 for OpenStack :)

    The thing is, even in Python 2, I have a bunch of failures - is this normal ? Full log: http://paste.debian.net/87033/

    I have a gazillion patches for you to review - and I'm not done yet ;)

  3. Ian Bicking repo owner

    I'm not involved in any of my Python projects anymore, and was never able to find a person to fill in to maintain Paste. But would be happy to give write access to someone who wants to manage these changes.

  4. Cyril Roelandt

    Hey Ian! I'm working on bringing Python 3 compatibility to OpenStack, and getting Paste to work with Python 3 is one of the first steps. I think https://bitbucket.org/haypo and I could try and do the port, even though we cannot promise that we'd maintain Paste on the long term, though.

  5. Victor Stinner

    Hi, I'm working with Cyril. We retrieved Debian patches and Cyril wrote new patches on top of that. I reorganized patches by kind of changes and I forked paste: https://bitbucket.org/haypo/paste/

    I prefer to use the six module instead of 2to3 because it doesn't need a slow conversion process and you don't have two versions of the code. Development and debugging is easier.

    @Ian: Cyril and me are interested to get the commit grant and support Python 3.

    @Ian: Do you want to keep compatibility with Python < 2.6?

  6. Ian Bicking repo owner

    I think Python 2.6 support would be nice, but it's also a reasonable option for people not to upgrade, so it depends on how much trouble 2.6 support causes. You both have write now!

  7. Victor Stinner

    "I think Python 2.6 support would be nice, but it's also a reasonable option for people not to upgrade, so it depends on how much trouble 2.6 support causes. You both have write now!"

    Yeah, thanks! I pushed all these patches to make the source code compatible with Python 2 and 3 thanks to fix.

    There are failing tests, but it was already the case before my changes:

    Ran 135 tests in 0.677s
    FAILED (failures=10, errors=2)
    
  8. Victor Stinner

    "I think Python 2.6 support would be nice"

    Oh, I was asking for older Python version (2.4 and 2.5). The new code should still work in Python 2.6, even if I didn't test yet. But it doesn't work on Python 2.5 and older anymore.

  9. Berker Peksag

    Hi, thank you for porting Paste to Python 3. Any info when this will be available on PyPI? Some parts of GNU MediaGoblin may depend to Paste to port Python 3.

  10. Victor Stinner

    Hi, thank you for porting Paste to Python 3. Any info when this will be available on PyPI? Some parts of GNU MediaGoblin may depend to Paste to port Python 3.

    Right now, I'm looking for feedback. Could you please your your MediaGoblin application with the development version of paste and Python 3?