Professional Documents
Culture Documents
NEWS Newer
NEWS Newer
Python News
+++++++++++
(editors: check NEWS.help for information about editing NEWS using ReST.)
- Patch #1638879: don't accept strings with embedded NUL bytes in long().
- Bug #1377858: Fix the segfaulting of the interpreter when an object created
a weakref on itself during a __del__ call for new-style classes (classic
classes still have the bug).
- Bug #1579370: Make PyTraceBack_Here use the current thread, not the
frame's thread state.
- Bug #1590891: random.randrange don't return correct value for big number
- Bug #1456209: In some obscure cases it was possible for a class with a
custom ``__eq__()`` method to confuse set internals when class instances
were used as a set's elements and the ``__eq__()`` method mutated the set.
- The repr for self-referential sets and fronzensets now shows "..." instead
of falling into infinite recursion.
- Bug #1576657: when setting a KeyError for a tuple key, make sure that
the tuple isn't used as the "exception arguments tuple". Applied to
both sets and dictionaries.
- Bug #1545497: when given an explicit base, int() did ignore NULs
embedded in the string to convert.
- Bug #1566800: make sure that EnvironmentError can be called with any
number of arguments, as was the case in Python 2.4.
- Fix a bug in the parser's future statement handling that led to "with"
not being recognized as a keyword after, e.g., this statement:
from __future__ import division, with_statement
- Bug #1557232: fix seg fault with def f((((x)))) and def f(((x),)).
Extension Modules
-----------------
- Bug #1647541: Array module's buffer interface can now handle empty arrays.
- Bug #1693079: The array module can now successfully pickle empty arrays.
- Bug #1622896: fix a rare corner case where the bz2 module raised an
error in spite of a succesful compression.
- Bug #1588217: don't parse "= " as a soft line break in binascii's
a2b_qp() function, instead leave it in the string as quopri.decode()
does.
- Bug #1572832: fix a bug in ISO-2022 codecs which may cause segfault
when encoding non-BMP unicode characters.
- fixed a bug with bsddb.DB.stat: the flags and txn keyword arguments
were transposed.
- Added support for linking the bsddb module against BerkeleyDB 4.5.x.
Library
-------
- Bug #1675967: re patterns pickled with Python 2.4 and earlier can
now be unpickled with Python 2.5.
- Bug #1684254: webbrowser now uses shlex to split any command lines
given to get(). It also detects when you use '&' as the last argument
and creates a BackgroundBrowser then.
- Patch #1681153: the wave module now closes a file object it opened if
initialization failed.
- Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap
the IndexError caused by passing in an invalid breakpoint number.
- Bugs #1676321: the empty() function in sched.py returned the wrong result
- Bug #1600860: Search for shared python library in LIBDIR, not lib/python/config,
on "linux" and "gnu" systems.
- Patch #1504073: Fix tarfile.open() for mode "r" with a fileobj argument.
- Patch #1583880: fix tarfile's problems with long names and posix/
GNU modes.
- Bug #813342: Start the IDLE subprocess with -Qnew if the parent
is started with that option.
- Bug #1560617: in pyclbr, return full module name not only for classes,
but also for functions.
- Patch #1617413: fix urllib's support for HTTP Basic authentication via HTTPS
(patch by Dug Song).
Tools/Demos
-----------
- idle: Honor the "Cancel" action in the save dialog (Debian bug #299092).
Tests
-----
Build
-----
Windows
-------
Documentation
-------------
- Patch #1546288: fix seg fault in dict_equal due to ref counting bug.
Library
-------
- Patch #1553314: Fix the inspect.py slowdown that was hurting IPython & SAGE
by adding smarter caching in inspect.getmodule().
Extension Modules
-----------------
- Bug #1551427: fix a wrong NULL pointer check in the win32 version
of os.urandom().
Tests
-----
- Bug #1629125: fix wrong data type (int -> Py_ssize_t) in PyDict_Next
docs.
Tools
-----
Build
-----
C API
-----
Instead, the equal (==) and unequal (!=) comparison operators will
now issue a UnicodeWarning and interpret the two objects as
unequal. The UnicodeWarning can be filtered as desired using
the warning framework, e.g. silenced completely, turned into an
exception, logged, etc.
Note that compare operators other than equal and unequal will still
raise UnicodeDecodeError exceptions as they've always done.
- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
with new-style classes.
- Bug #1536021: __hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
- Bug #1191458: tracing over for loops now produces a line event
on each iteration. Fixing this problem required changing the .pyc
magic number. This means that .pyc files generated before 2.5c1
will be regenerated.
Library
-------
- Patch #1536071: trace.py should now find the full module name of a
file correctly even on Windows.
- logging's atexit hook now runs even if the rest of the module has
already been cleaned up.
Extension Modules
-----------------
- Ignore data that arrives before the opening start tag in C etree.
- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now
uses the _as_parameter_ attribute when objects are passed to foreign
function calls. The ctypes version number was changed to 1.0.1.
Documentation
-------------
Build
-----
C API
-----
- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance
with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is
used in ``sys.path_importer_cache`` to cache non-directory paths and avoid
excessive filesystem operations during imports.
- Patch #1521179: Python now accepts the standard options ``--help`` and
``--version`` as well as ``/?`` on Windows.
- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works
again. Fixing this problem required changing the .pyc magic number.
This means that .pyc files generated before 2.5b3 will be regenerated.
Library
-------
- The renaming of the xml package to xmlcore, and the import hackery done
to make it appear at both names, has been removed. Bug #1511497,
#1513611, and probably others.
- Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
- The distutils version has been changed to 2.5.0, and is now kept
in sync with sys.version_info[:3].
- Bug #1459963: urllib and urllib2 now normalize HTTP header names with
title().
- Bug #1520914: Change time.strftime() to accept a zero for any position in its
argument tuple. For arguments where zero is illegal, the value is forced to
the minimum value that is correct. This is to support an undocumented but
common way people used to fill in inconsequential information in the time
tuple pre-2.4.
- The email package has improved RFC 2231 support, specifically for
recognizing the difference between encoded (name*0*=<blah>) and non-encoded
(name*0=<blah>) parameter continuations. This may change the types of
values returned from email.message.Message.get_param() and friends.
Specifically in some cases where non-encoded continuations were used,
get_param() used to return a 3-tuple of (None, None, string) whereas now it
will just return the string (since non-encoded continuations don't have
charset and language parts).
Also, whereas % values were decoded in all parameter continuations, they are
now only decoded in encoded parameter parts.
- Bug #1517996: IDLE now longer shows the default Tk menu when a
path browser, class browser or debugger is the frontmost window on MacOS X
Tests
-----
Build
-----
Mac
---
- PythonLauncher now works correctly when the path to the script contains
characters that are treated specially by the shell (such as quotes).
- Bug #1527397: PythonLauncher now launches scripts with the working directory
set to the directory that contains the script instead of the user home
directory. That latter was an implementation accident and not what users
expect.
- Bug #1501934: The scope of global variables that are locally assigned
using augmented assignment is now correctly determined.
- On 64 bit systems, int literals that use less than 64 bits are
now ints rather than longs.
Library
-------
- Bug #1514703: Only setup canvas window in turtle when the canvas
is created.
- The sqlite3 module did cut off data from the SQLite database at the first
null character before sending it to a custom converter. This has been fixed
now.
Extension Modules
-----------------
Build
-----
- 'configure' now detects the zlib library the same way as distutils.
Previously, the slight difference could cause compilation errors of the
'zlib' module on systems with more than one version of zlib.
Tests
-----
- Call os.waitpid() at the end of tests that spawn child processes in order
to minimize resources (zombies).
Documentation
-------------
- Bug #992017: A classic class that defined a __coerce__() method that returned
its arguments swapped would infinitely recurse and segfault the interpreter.
- The string and unicode methods startswith() and endswith() now accept
a tuple of prefixes/suffixes to look for. Implements RFE #1491485.
- Patch #1346214: Statements like "if 0: suite" are now again optimized
away like they were in Python 2.4.
- Bug #1462152: file() now checks more thoroughly for invalid mode
strings and removes a possible "U" before passing the mode to the
C library function.
- WindowsError now has two error code attributes: errno, which carries
the error values from errno.h, and winerror, which carries the error
values from winerror.h. Previous versions put the winerror.h values
(from GetLastError()) into the errno attribute.
- Patch #1479181: split open() and file() from being aliases for each other.
- Bug #1456209: In some obscure cases it was possible for a class with a
custom ``__eq__()`` method to confuse dict internals when class instances
were used as a dict's keys and the ``__eq__()`` method mutated the dict.
No, you don't have any code that did this ;-)
Extension Modules
-----------------
- Patch #1454481: thread stack size is now tunable at runtime for thread
enabled builds on Windows and systems with Posix threads support.
- bsddb: added an interface for the BerkeleyDB >= 4.3 DBSequence class.
[pybsddb project SF patch number 1466734]
- bsddb: fix DBCursor.pget() bug with keyword argument names when no data
parameter is supplied. [SF pybsddb bug #1477863]
- bsddb: the __len__ method of a DB object has been fixed to return correct
results. It could previously incorrectly return 0 in some cases.
Fixes SF bug 1493322 (pybsddb bug 1184012).
- bsddb: the bsddb.dbtables Modify method now raises the proper error and
aborts the db transaction safely when a modifier callback fails.
Fixes SF python patch/bug #1408584.
Library
-------
- Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
- Patch #1455898: The MBCS codec now supports the incremental mode for
double-byte encodings.
- The functions update_wrapper() and wraps() have been added to the functools
module. These make it easier to copy relevant metadata from the original
function when writing wrapper functions.
- Patch #1497027: try HTTP digest auth before basic auth in urllib2
(thanks for J. J. Lee).
- Patch #1486962: Several bugs in the turtle Tk demo module were fixed
and several features added, such as speed and geometry control.
- Patch #1488881: add support for external file objects in bz2 compressed
tarfiles.
- Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
- Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
- Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler
package.
Build
-----
- Bug/Patch #1481770: Use .so extension for shared libraries on HP-UX for ia64.
C API
-----
Tests
-----
Tools
-----
Documentation
-------------
What's New in Python 2.5 alpha 2?
=================================
def __hash__(self):
return id(self) # WRONG
because a hash result must be a (short) Python int but it was always
possible for ``id()`` to return a Python long. However, because ``id()``
could return negative values before, on a 32-bit box an ``id()`` result
was always usable as a hash value before this patch. That's no longer
necessarily so.
Extension Modules
-----------------
- Patch #1191065: Fix preprocessor problems on systems where recvfrom
is a macro.
Library
-------
- The pkgutil module now has several new utility functions, such
as ``walk_packages()`` to support working with packages that are either
in the filesystem or zip files.
- The mailbox module can now modify and delete messages from
mailboxes, in addition to simply reading them. Thanks to Gregory
K. Johnson for writing the code, and to the 2005 Google Summer of
Code for funding his work.
Build
-----
Tests
-----
- The test_contextlib test in 2.5a1 wasn't actually run unless you ran
it separately and by hand. It also wasn't cleaning up its changes to
the current Decimal context.
- regrtest.py now has a -M option to run tests that test the new limits of
containers, on 64-bit architectures. Running these tests is only sensible
on 64-bit machines with more than two gigabytes of memory. The argument
passed is the maximum amount of memory for the tests to use.
Tools
-----
Documentation
-------------
- PEP 357, patch 1436368: add an __index__ method to int/long and a matching
nb_index slot to the PyNumberMethods struct. The slot is consulted instead
of requiring an int or long in slicing and a few other contexts, enabling
other objects (e.g. Numeric Python's integers) to be used as slice indices.
- PEP 352, patch #1104669: Make exceptions new-style objects. Introduced the
new exception base class, BaseException, which has a new message attribute.
KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
Raising a string exception now raises a DeprecationWarning.
- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
explicitly relative, using 'from .module import name' to mean 'from the same
package as this module is in. Imports without dots still default to the
old relative-then-absolute, unless 'from __future__ import
absolute_import' is used.
- Patch 1433928:
- The copy module now "copies" function objects (as atomic objects).
- dict.__getitem__ now looks for a __missing__ hook before raising
KeyError.
- Patch #1400181, fix unicode string formatting to not use the locale.
This is how string objects work. u'%f' could use , instead of .
for the decimal point. Now both strings and unicode always use periods.
- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
configure would break checking curses.h.
- Bug #959576: The pwd module is now builtin. This allows Python to be
built on UNIX platforms without $HOME set.
- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
- Bug #1281408: Py_BuildValue now works correctly even with unsigned longs
and long longs.
- Replaced most Unicode charmap codecs with new ones using the
new Unicode translate string feature in the builtin charmap
codec; the codecs were created from the mapping tables available
at ftp.unicode.org and contain a few updates (e.g. the Mac OS
encodings now include a mapping for the Apple logo)
- SF bug #1167751: fix incorrect code being produced for generator expressions.
The following code now raises a SyntaxError: foo(a = i for i in range(10))
- All iterators now have a Boolean value of True. Formerly, some iterators
supported a __len__() method which evaluated to False when the iterator
was empty.
- SF bug #893549: parsing keyword arguments was broken with a few format
codes.
- Disallow keyword arguments for type constructors that don't use them
(fixes bug #1119418).
- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
exceptions that cause a function to exit.
- SF bug #1224347: hex longs now print with lowercase letters just
like their int counterparts.
- SF bug #1163563: the original fix for bug #1010677 ("thread Module
Breaks PyGILState_Ensure()") broke badly in the case of multiple
interpreter states; back out that fix and do a better job (see
http://mail.python.org/pipermail/python-dev/2005-June/054258.html
for a longer write-up of the problem).
- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
278.
- patch #1109424: int, long, float, complex, and unicode now check for the
proper magic slot for type conversions when subclassed. Previously the
magic slot was ignored during conversion. Semantics now match the way
subclasses of str always behaved. int/long/float, conversion of an instance
to the base class has been moved to the proper nb_* magic slot and out of
PyNumber_*().
Thanks Walter D�rwald.
- Bug #1155938: new style classes did not check that __init__() was
returning None.
- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
- min() and max() now support key= arguments with the same meaning as in
list.sort().
Extension Modules
-----------------
- Patch #1309579: wait3 and wait4 were added to the posix module.
- RFE #567972: Socket objects' family, type and proto properties are
now exposed via new attributes.
- Everything under lib-old was removed. This includes the following modules:
Para, addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep,
lockfile, newdir, ni, packmail, poly, rand, statcache, tb, tzparse,
util, whatsound, whrandom, zmod
- re and sre were swapped, so help(re) provides full help. importing sre
is deprecated. The undocumented re.engine variable no longer exists.
- Bug #1448490: Fixed a bug that ISO-2022 codecs could not handle
SS2 (single-shift 2) escape sequences correctly.
- The unicodedata module was updated to the 4.1 version of the Unicode
database. The 3.2 version is still available as unicodedata.db_3_2_0
for applications that require this specific version (such as IDNA).
- Patch #1422385: The nis module now supports access to domains other
than the system default domain.
- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
but Python incorrectly assumes it is in UTF-8 format
- Fix parse errors in the readline module when compiling without threads.
- Patches #1298449 and #1298499: Add some missing checks for error
returns in cStringIO.c.
- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
the request code argument, which results in more C-like behaviour
for large or negative values.
- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
implementation treated all integer values except 1 as false.
- Patches #925152, #1118602: Avoid reading after the end of the buffer
in pyexpat.GetInputContext.
- The spwd module has been added, allowing access to the shadow password
database.
- the cPickle module no longer accepts the deprecated None option in the
args tuple returned by __reduce__().
- itertools.islice() now accepts None for the start and step arguments.
This allows islice() to work more readily with slices:
islice(s.start, s.stop, s.step)
- Patch #1117961: Replace the MD5 implementation from RSA Data Security Inc
with the implementation from http://sourceforge.net/projects/libmd5-rfc/.
Library
-------
- The email module's parsedate_tz function now sets the daylight savings
flag to -1 (unknown) since it can't tell from the date whether it should
be set.
- Patch #1462313, bug #1443328: the pickle modules now can handle classes
that have __private names in their __slots__.
- email 4.0 package now integrated. This is largely the same as the email 3.0
package that was included in Python 2.3, except that PEP 8 module names are
now used (e.g. mail.message instead of email.Message). The MIME classes
have been moved to a subpackage (e.g. email.mime.text instead of
email.MIMEText). The old names are still supported for now. Several
deprecated Message methods have been removed and lots of bugs have been
fixed. More details can be found in the email package documentation.
- Patch #1446372: quit and exit can now be called from the interactive
interpreter to exit.
- The function get_count() has been added to the gc module, and gc.collect()
grew an optional 'generation' argument.
- The compiler package now supports future imports after the module docstring.
- Bug #1413790: zipfile now sanitizes absolute archive names that are
not allowed by the specs.
- Patch #1215184: FileInput now can be given an opening hook which can
be used to control how files are opened.
- Patch #1215184: fileinput now has a fileno() function for getting the
current file number.
- Patch #1373643: The chunk module can now read chunks larger than
two gigabytes.
- Bug #1432260: The names of lambda functions are now properly displayed
in pydoc.
- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
- Added the hashlib module. It provides secure hash functions for MD5 and
SHA1, 224, 256, 384, and 512. Note that recent developments make the
historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
Ronald L. Rivest offered this advice for Python:
- Bug #1296004: httplib.py: Limit maximal amount of data read from the
socket to avoid a MemoryError on Windows.
- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
to get the correct encoding.
- Bug #1163178: Make IDNA return an empty string when the input is empty.
- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
separator and do not output trailing semicolon.
- Bug #1015140: disambiguated the term "article id" in nntplib docs and
docstrings to either "article number" or "message id".
- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
to W3C name (404 -> 'Not Found'). RFE #1216944.
- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
as this can cause problems with apps closing all file descriptors.
- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
component of the path.
- Patch #918101: Add tarfile open mode r|* for auto-detection of the
stream compression; add, for symmetry reasons, r:* as a synonym of r.
- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
Fixed by reading the HTTP body in chunks instead of one big socket.read().
- the pickle module no longer accepts the deprecated None option in the
args tuple returned by __reduce__().
- optparse now optionally imports gettext. This allows its use in setup.py.
- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
about illegal code points. The codec now supports PEP 293 style error
handlers.
- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
considering it exactly like a '*'.
- Bug #947906: An object oriented interface has been added to the calendar
module. It's possible to generate HTML calendar now and the module can be
called as a script (e.g. via ``python -mcalendar``). Localized month and
weekday names can be ouput (even if an exotic encoding is used) using
special classes that use unicode.
Build
-----
- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
The zlib module is now builtin on Windows.
- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
and linking has changed (prebinding is now deprecated, and libcc_dynamic
no longer exists). This configure patch makes things right.
- setup.py now uses the directories specified in LDFLAGS using the -L option
and in CPPFLAGS using the -I option for adding library and include
directories, respectively, for compiling extension modules against. This has
led to the core being compiled using the values in CPPFLAGS. It also removes
the need for the special-casing of both DarwinPorts and Fink for darwin since
the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
Fink, ``-I/opt/local/include`` for DarwinPorts).
C API
-----
- Removed PyRange_New().
Tests
-----
Documentation
-------------
- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
- Remove all latent references for "Macintosh" that referred to semantics for
Mac OS 9 and change to reflect the state for OS X.
Closes patch #1095802. Thanks Jack Jansen.
Mac
---
New platforms
-------------
Tools/Demos
-----------
- Fixed a display glitch in Pynche, which could cause the right arrow to
wiggle over by a pixel.
----