Today we had a bug report that one of the tests failed. The as
-keyword was used in exception handling, which is only supported since Python v2.6.
Currently, MySQL Connector/Python should work with Python v2.4 and greater, but not Python v3.x. The Connector/Python README said we supported v2.3, but that’s not the case (anymore) since decorators are used, e.g. @classmethod.
I’ll have to pull the trigger, but I think it’s safe to say that we’re only going to support Python v2.4 and greater. For Python v3 we’ll probably have to make an additional branch and release later on. I still have to check what the impact is.
If anyone has compelling reasons why we still should support Python v2.3 or earlier, please let us know. Also, tips on making it backward compatible are welcome.
Currently, the status of compatibility is as follows (output of shell script):
Checking Python v2.3.. Failed!
Checking Python v2.4.. Success!
Checking Python v2.5.. Success!
Checking Python v2.6.. Success!
Checking Python v3.0.. Failed!
Checking Python v3.1.. Failed!
Comments
….try:
……..raise Exception(“Oops!”)
….except:
……..e = sys.exc_info()[1]
……..# Do things with
e
As for Py3K I'd honestly do it the other way around. Start developing for Py3K and then backport to 2.x.
Maintaining forwards compatibility is more of a nightmare than maintaining backwards compatibility…
However, you still do find old pythons on old web hosts…
cpanel in 2008 had python2.3 being used as the default python (but also had 2.4 available as a separate path).
2.4 onwards is a nice balance at this point I think.
Everyone who supports py3k gets a special prize!
There is no need to use sys.exc_info(), and porting to Python 3 and then backporting means you can't use 2to3.
Hopefully the January Issue of Python Magazine should come out sometime in February (in typical Python Magazine style), I start an article series on Python 3 porting there.