Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Enhancements for Py3K support #3

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
1 participant

I am working on getting supervisord to run on Python 3. I started with meld3 and made the minimum changes required to allow it to run on both Py2 and Py3. The oldest version of Python I have on my Mac is 2.5, but I believe that all changes should at least run on 2.4. It may work on 2.3 but I don't know enough about the differences between 2.3 and 2.4 to say for sure. I made simple inline changes rather than using six.

Interestingly, getting meld3 to run on Py3 exposed a segfault in the latest Python 3.3.0 when processing XML. I have verified this with the pre-built version on my Mac and a source-built version on Linux.

Anyway, I hope you will consider accepting my changes. It was a bit more work than I had expected due to changes in the XML library.

Best,

Scott Maxwell

scottkmaxwell added some commits Oct 12, 2012

Enhance to run on Python 3
Replace mimetools with a simple parse.
Fix imports
Add aliases for basestring, unicode and unichr
Add encode function and replace str.encode(encoding) with encode(str,encoding) so that we can do nothing on Py3
Create stub for _encode_entity if we don't have it
Always return False for is_not_ascii on Py3
Wrap keys() and values() in list() for Py3
Enhance __setitem__ and __delitem__ to handle slices since Py3 doesn't use __setslice__ and __delslice__
Change MeldTreeBuilder from a function to a class so we can provide the comment method for Py3
Change all raise exception statements to be ValueError(msg) rather than ValueError, msg
Replace back ticks with repr()

@mnaberez mnaberez closed this in 66fd6e0 Oct 27, 2013

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