简体   繁体   中英

Is Python2.6 stable enough for production use?

还是我应该坚持使用Python2.5更长的时间?

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

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".

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).

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".

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...

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM