Join GitHub today
Python 3 Compatibility #57
There is a warning in the docs about
which does indeed appear to happen with
>>> try: ... raise Exception() ... except: ... _, a, _ = sys.exc_info() ... print(_) ... <traceback object at 0x1073eedd0>
I think compatibility with 2.4 should be dropped by using the
Thanks for your work on this, @seveas. The continued support for Python 2.4 is much appreciated, I know from a few beanstalkc users who rely on Python 2.4; so also thanks for that on their behalf. I cherry-picked your exception handling fix, so that we have at least this part settled.
As for the other parts introducing Py3 compatibility, there's this design issue I mentioned in #13 with 8-bit transparency in combination with cross-Python 2/3 support. Your "PY3" version switch nicely manages to keep 8-bit transparency working properly on Py2, but doesn't provide similar functionality on Py3. How to do that nicely on Py3 is mainly a question of design. Since this issue seems to be little known, I'll write it up in a separate ticket. I'll leave your pull request pending, for the time being, as it's quite conceivable to implement whatever 8-bit transparency design we come of for Py3 on top of it.
For what it is worth, an other project facing a similar issue, redis-py, chose to go accept either
By the way, it may be worth it to look at how they implement Python2/3 compatibility.
I think it is fine to do the encoding/decoding automagically, as long as the user is able to bypass it if she chooses to do so (here by setting
I've added some inline comments, but good job, take my