-
Notifications
You must be signed in to change notification settings - Fork 61
Conversation
Thanks for the patch. Beyond just adding Python 3 support, it looks like a worthwhile clean-up of the code. Before merging, we need to discuss internally whether we are ready to drop Python 2.5 support, but I suspect that we are. |
2.6 is the oldest Python I can conveniently test, but I suspect 2.5 will If you do still need 2.5 internally and my changes don't work as is, I can |
I just tried building it on 2.5 using pyenv and received the following:
|
I got some free time to look into that failure and fixed it in the branch greg/py3. We will review the rest of the changes and hopefully merge this. |
Also flip one piece of compatibility logic around, so the ifdefs at the top of the file consistently define new stuff in terms of old stuff when necessary, allowing the bulk of the code to be written new-style.
Thanks for the pointer to pyenv; that makes backward compatibility testing much much easier. I just pushed another batch of changes which should fix the py2.5 failures and also the CI failures (all of the CI failures appear to be because of -Wmissing-field-initializers, which is not in any of my pythons' default CFLAGS). Now works for me with 2.5, 2.6, 2.7, 3.3, and 3.4. |
Everything looks great. Thanks! 👍 |
I released this to PyPI. |
Awesome! Thanks for the quick turnaround. |
I realized that non-ascii strings were broken in Python 3 with these changes as they are encoded in Latin1 by default. I fixed this in #13 and will release that once someone here reviews it. |
Please consider these changes, which collectively add Python 3 support. The bulk of the work is modernizing CAPI use to the >=2.6 standard; the only Py3-specific changes are related to str/unicode and the different signature for module initialization.