7

Or should I just stick with Python2.5 for a bit longer?

2
  • 2
    Define "stable enough", please. What "instability" are you worried about? What's your threshold for "enough"?
    – S.Lott
    May 6, 2009 at 12:40
  • I am using it in production at an investment bank to host a pylons based reporting system.
    – Ravi
    May 6, 2009 at 21:24

6 Answers 6

18

From python.org:

The current production versions are Python 2.6.2 and Python 3.0.1.

So, yes.

Python 3.x contains some backwards incompatible changes, so python.org also says:

start with Python 2.6 since more existing third party software is compatible with Python 2 than Python 3 right now

1
  • 3
    +1: Quote the documentation. A link would have been even better.
    – S.Lott
    May 6, 2009 at 10:28
10

Ubuntu has switched to 2.6 in it's latest release, and has not had any significant problems. So I would say "yes, it's stable".

6

It depends from libraries you use. For example there is no precompiled InformixDB package for 2.6 if you have to use Python on Windows.

Also web2py framework sticks with 2.5 because of some bug in 2.6.

Personally I use CPython 2.6 (workhorse) and 3.0 (experimental), and Jython 2.5 beta (for my test with JDBC and ODBC).

4

Yes it it, but this is not the right question. The right question is "can I use Python 2.6, taking in consideration the incompatibilities it introduces ?". And the short answser is "most probably yes, unless you use a specific lib that wouldn't work with 2.6, which is pretty rare".

4
  • E.G : the os.popen2 and os.popen3 implementationq in python 2.6expects the cmd argument to be a string. The documentation - help(os.popen3) - states that the cmd argument can be a sequence on Unix. There for it's incompatible with os.popen* in python 2.5
    – Bite code
    May 6, 2009 at 11:59
  • I think you're misinterpreting the docs. python.org/doc/2.5.4/lib/os-newstreams.html#l2h-2628 says: "Also, for each of these variants, on Unix, cmd may be a sequence, in which case arguments will be passed directly to the program without shell intervention (as with os.spawnv()). If cmd is a string it will be passed to the shell (as with os.system()). " May 6, 2009 at 13:30
  • Well, I am not talking about what I've read in the doc. I just remember that there was known bugs causing incompatibilities between V2.5 and v2.6 and this is one of them. Don't have the link at hand but I'm sure you can still find it on the python bug tracker, I doubt it will be corrected before 2.7.
    – Bite code
    May 6, 2009 at 16:06
1

I've found 2.6 to be fairly good with two exceptions:

  1. If you're using it on a server, I've had trouble in the past with some libraries which are used by elements of the server (Debian Etch IIRC). It's possible with a bit of jiggery pokery to maintain several versions of python in unison though if you're careful :-)
  2. This is no-longer true, but the last time I tried 2.6, wxPython had not been updated which meant all my gui tools I've written broke. There's now a version available that's built against 2.6.

So I'd suggest you check all the modules you use and check their compatibility with 2.6...

1

I recently switched from python2.5 to 2.6 for my research project involving lots of 3rd party libs (scipy, pydot, etc.) and swig related stuff.

The only thing I had to change was to convert all strings with

s = unicode(s, "utf-8")

before I fed them into the logging module.

Otherwise, I got everytime

Traceback (most recent call last):
File "/usr/lib/python2.6/logging/__init__.py", line 773, in emit
stream.write(fs % msg.encode("UTF-8"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 31: ordinal not in range(128)

1
  • I've got that UnicodeDecodeError too,can you tell me how to convert strings with "s = unicode(s, "utf-8")"?
    – erical
    Dec 20, 2011 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.