5 ms·
I've said before and will say again: The holdup here is not technical. It's great that we've got people like Alex willing to port code, but that's not the hard
by ubernostrum 16y ago
I've said before and will say again:
The holdup here is not technical. It's great that we've got people like Alex willing to port code, but that's not the hard part. The hard part is people who are using and want to continue using Django on platforms where Python 2.5 or even 2.4 is still the standard.
More on this forthcoming, once I've had a proper weekend off.
- glenjamin 16y agoHow feasible is it to have support from 2.4 to 3.x? Either with or without 3to2/2to3 as part of the packaging process? EDIT: I'd have thought upgrading the codebase to 3.x and making sure that 3to2 produces a working 2.4 version would be better than using 2to3. Thoughts?
- kingkilr 16y agoThat is precisely my goal, I think it's eminently feasible using 2to3.
- koenigdavidmj 16y agoThe problem there is that 2.4's exception statements and 3.0's have two different meanings. 2.4 only supports this: try: do stuff except FooError, e: do stuff with e 3.0 and up choke on this; they interpret it as "catch exceptions of type FooError or e and do not give the exception object a name". 2.5 through 2.7 interpret like 2.4 but also support explicit parentheses to do what Python 3 does: try: do stuff except (FooError, BarError) as e: do stuff except (BazError, QuxError): do other stuff 2to3 requires that you use the new exception syntax only, to avoid confusion.
- briancurtin 16y agoThe following will work across 3 and 2 versions going back pretty far. It's necessary if you want to support pre-2.5 versions (where `as` was introduced): import sys try: fn() except (IOError, TypeError): err = sys.exc_info()[1] print(err) http://docs.pythonsprints.com/python3_porting/py-porting.html#exceptions http://docs.pythonsprints.com/python3_porting/py-porting.htm...
- koenigdavidmj 16y agoStill kind of ugly, and not something which you want to litter than Django sources. Especially if you are going to put them all back when 2.4 support is dropped.
- oreilly 16y agoFor platforms where an older version of python is standard, can that not be worked around by using virtualenv?
- scorpion032 16y agoI think django should include magic to fall back to 2.x version when and where 3.x is not available. May be via configuring multiple virtualenvs.