(editors: check NEWS.help for information about editing NEWS using ReST.)
Release date: 30-NOV-2004
Release date: 18-NOV-2004
Release date: 03-NOV-2004
The Python Software Foundation changed the license under which Python is released, to remove Python version numbers. There were no other changes to the license. So, for example, wherever the license for Python 2.3 said "Python 2.3", the new license says "Python". The intent is to make it possible to refer to the PSF license in a more durable way. For example, some people say they're confused by that the Open Source Initiative's entry for the Python Software Foundation License:
http://www.opensource.org/licenses/PythonSoftFoundation.php
says "Python 2.1.1" all over it, wondering whether it applies only to Python 2.1.1.
The official name of the new license is the Python Software Foundation License Version 2.
Release date: 15-OCT-2004
Release date: 02-SEP-2004
Release date: 05-AUG-2004
Patch #980695: Implements efficient string concatenation for statements of the form s=s+t and s+=t. This will vary across implementations. Accordingly, the str.join() method is strongly preferred for performance sensitive code.
PEP-0318, Function Decorators have been added to the language. These are implemented using the Java-style @decorator syntax, like so:
@staticmethod def foo(bar):
(The PEP needs to be updated to reflect the current state)
When importing a module M raises an exception, Python no longer leaves M in sys.modules. Before 2.4a2 it did, and a subsequent import of M would succeed, picking up a module object from sys.modules reflecting as much of the initialization of M as completed before the exception was raised. Subsequent imports got no indication that M was in a partially- initialized state, and the importers could get into arbitrarily bad trouble as a result (the M they got was in an unintended state, arbitrarily far removed from M's author's intent). Now subsequent imports of M will continue raising exceptions (but if, for example, the source code for M is edited between import attempts, then perhaps later attempts will succeed, or raise a different exception).
This can break existing code, but in such cases the code was probably working before by accident. In the Python source, the only case of breakage discovered was in a test accidentally relying on a damaged module remaining in sys.modules. Cases are also known where tests deliberately provoking import errors remove damaged modules from sys.modules themselves, and such tests will break now if they do an unconditional del sys.modules[M].
u'%s' % obj will now try obj.__unicode__() first and fallback to obj.__str__() if no __unicode__ method can be found.
Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to PyArg_VaParse(). Both are now documented. Thanks Greg Chapman.
Allow string and unicode return types from .encode()/.decode() methods on string and unicode objects. Added unicode.decode() which was missing for no apparent reason.
An attempt to fix the mess that is Python's behaviour with signal handlers and threads, complicated by readline's behaviour. It's quite possible that there are still bugs here.
Added C macros Py_CLEAR and Py_VISIT to ease the implementation of types that support garbage collection.
Compiler now treats None as a constant.
The type of values returned by __int__, __float__, __long__, __oct__, and __hex__ are now checked. Returning an invalid type will cause a TypeError to be raised. This matches the behavior of Jython.
Implemented bind_textdomain_codeset() in locale module.
Added a workaround for proper string operations in BSDs. str.split and str.is* methods can now work correctly with UTF-8 locales.
Bug #989185: unicode.iswide() and unicode.width() is dropped and the East Asian Width support is moved to unicodedata extension module.
Patch #941229: The source code encoding in interactive mode now refers sys.stdin.encoding not just ISO-8859-1 anymore. This allows for non-latin-1 users to write unicode strings directly.
Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and TIS-620
Thanks to Edward Loper, doctest has been massively refactored, and many new features were added. Full docs will appear later. For now the doctest module comments and new test cases give good coverage. The refactoring provides many hook points for customizing behavior (such as how to report errors, and how to compare expected to actual output). New features include a <BLANKLINE> marker for expected output containing blank lines, options to produce unified or context diffs when actual output doesn't match expectations, an option to normalize whitespace before comparing, and an option to use an ellipsis to signify "don't care" regions of output.
Tkinter now supports the wish -sync and -use options.
The following methods in time support passing of None: ctime(), gmtime(), and localtime(). If None is provided, the current time is used (the same as when the argument is omitted). [SF bug 658254, patch 663482]
nntplib does now allow to ignore a .netrc file.
urllib2 now recognizes Basic authentication even if other authentication schemes are offered.
Bug #1001053. wave.open() now accepts unicode filenames.
gzip.GzipFile has a new fileno() method, to retrieve the handle of the underlying file object (provided it has a fileno() method). This is needed if you want to use os.fsync() on a GzipFile.
imaplib has two new methods: deleteacl and myrights.
nntplib has two new methods: description and descriptions. They use a more RFC-compliant way of getting a newsgroup description.
Bug #993394. Fix a possible red herring of KeyError in 'threading' being raised during interpreter shutdown from a registered function with atexit when dummy_threading is being used.
Bug #857297/Patch #916874. Fix an error when extracting a hard link from a tarfile.
Patch #846659. Fix an error in tarfile.py when using GNU longname/longlink creation.
The obsolete FCNTL.py has been deleted. The builtin fcntl module has been available (on platforms that support fcntl) since Python 1.5a3, and all FCNTL.py did is export fcntl's names, after generating a deprecation warning telling you to use fcntl directly.
Several new unicode codecs are added: big5hkscs, euc_jis_2004, iso2022_jp_2004, shift_jis_2004.
Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new implementations, exploiting Conditions (which didn't exist at the time Queue was introduced). A minor semantic change is that the Full and Empty exceptions raised by non-blocking calls now occur only if the queue truly was full or empty at the instant the queue was checked (of course the Queue may no longer be full or empty by the time a calling thread sees those exceptions, though). Before, the exceptions could also be raised if it was "merely inconvenient" for the implementation to determine the true state of the Queue (because the Queue was locked by some other method in progress).
Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the case of comparing two empty lists. This affected both context_diff() and unified_diff(),
Bug #980938: smtplib now prints debug output to sys.stderr.
Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by returning the last point in the path that was not part of any loop. Thanks AM Kuchling.
Bug #980327: ntpath not handles compressing erroneous slashes between the drive letter and the rest of the path. Also clearly handles UNC addresses now as well. Thanks Paul Moore.
bug #679953: zipfile.py should now work for files over 2 GB. The packed data for file sizes (compressed and uncompressed) was being stored as signed instead of unsigned.
decimal.py now only uses signals in the IBM spec. The other conditions are no longer part of the public API.
codecs module now has two new generic APIs: encode() and decode() which don't restrict the return types (unlike the unicode and string methods of the same name).
Non-blocking SSL sockets work again; they were broken in Python 2.3. SF patch 945642.
doctest unittest integration improvements:
o Improved the unitest test output for doctest-based unit tests
DocTestSuites.
The threading module has a new class, local, for creating objects that provide thread-local data.
Bug #990307: when keep_empty_values is True, cgi.parse_qsl() no longer returns spurious empty fields.
Implemented bind_textdomain_codeset() in gettext module.
Introduced in gettext module the l*gettext() family of functions, which return translation strings encoded in the preferred encoding, as informed by locale module's getpreferredencoding().
optparse module (and tests) upgraded to Optik 1.5a1. Changes:
Release date: 08-JUL-2004