Académique Documents
Professionnel Documents
Culture Documents
Python News
+++++++++++
(editors: check NEWS.help for information about editing NEWS using ReST.)
- Added test case to ensure attempts to read from a file opened for writing
fail.
Build
-----
- In the OSX installer, update SQLite to 3.6.7, and change bsddb URL.
Build against system Tcl framework.
- Issue #4048: The parser module now correctly validates relative imports.
- Issue #3967: Fixed a crash in the count() and find() methods of string-like
objects, when the "start" parameter is a huge value.
- Issue #3936: The parser warnings for using "as" and "with" as variable names
didn't fire after import statements.
- Issue #3537: Fix an assertion failure when an empty but presized dict
object was stored in the freelist.
- Issue #2242: Fix a crash when decoding invalid utf-7 input on certain
Windows / Visual Studio versions.
- Issue #1686386: Tuple's tp_repr did not take into account the possibility of
having a self-referential tuple, which is possible from C code. Nor did
object's tp_str consider that a type's tp_str could do something that could
lead to an inifinite recursion. Py_ReprEnter() and Py_EnterRecursiveCall(),
respectively, fixed the issues. (Backport of r58288 from trunk.)
- Issue #1477: With narrow Unicode builds, the unicode escape sequence
\Uxxxxxxxx did not accept values outside the Basic Multilingual Plane. This
affected raw unicode literals and the 'raw-unicode-escape' codec. Now
UTF-16 surrogates are generated in this case, like normal unicode literals
and the 'unicode-escape' codec.
- Issue #2321: use pymalloc for unicode object string data to reduce
memory usage in some circumstances.
- Issue #2238: Some syntax errors in *args and **kwargs expressions could give
bogus error messages.
- Issue #1204: The configure script now tests for additional libraries
that may be required when linking against readline. This fixes issues
with x86_64 builds on some platforms (a few Linux flavors and OpenBSD).
- Issue #3678: Correctly pass LDFLAGS and LDLAST to the linker on shared
library targets in the Makefile.
Library
-
-------
- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to
give correct results in the case where one argument is a quiet NaN
and the other is a finite number that requires rounding.
- Issue #3774: Fixed an error when create a Tkinter menu item without command
and then remove it.
- Issue #3895: _lsprof could be crashed with an external timer that did not
return a float when a Profiler object is garbage collected.
- Issue #2234: distutils failed for some versions of the cygwin compiler. The
version reported by these tools does not necessarily follow the python
version numbering scheme, so the module is less strict when parsing it.
- Issue #1747858: Fix chown to work with large uid's and gid's on 64-bit
platforms.
- Bug #1725737: In distutil's sdist, exclude RCS, CVS etc. also in the
root directory, and also exclude .hg, .git, .bzr, and _darcs.
- Issue #874900: after an os.fork() call the threading module state is cleaned
up in the child process to prevent deadlock and report proper thread counts
if the new process uses the threading module.
Extension Modules
-
-----------------
- Issue #4228: Pack negative values the same way as 2.4 in struct's L format.
- Security Issue #2: imageop did not validate arguments correctly and could
segfault as a result.
- Issue #3205: When iterating over a BZ2File fails allocating memory, raise
a MemoryError rather than silently stop the iteration.
- Issue #3120: On 64-bit Windows the subprocess module was truncating handles.
Tests
-----
- Issue #3863: Disabled a unit test of fork being called from a thread
when running on platforms known to exhibit OS bugs when attempting that.
Documentation
-
-------------
Build
-
-----
Windows
-
-------
Extension Modules
-
-----------------
- Issue #1920: "while 0" statements were completely removed by the compiler,
even in the presence of an "else" clause, which is supposed to be run when
the condition is false. Now the compiler correctly emits bytecode for the
"else" suite.
- Issue #1678380: distinction between 0.0 and -0.0 was lost during constant
folding optimization. This was a regression from Python 2.4.
- Issue #1882: when compiling code from a string, encoding cookies in the
second line of code were not always recognized correctly.
- Issue #1265: Fix a problem with sys.settrace, if the tracing function uses a
generator expression when at the same time the executed code is closing a
paused generator.
- Patch #1031213: Decode source line in SyntaxErrors back to its original source
encoding.
- #1507247, #2004: tarfile.py: Use mode 0700 for temporary directories and
default permissions for missing directories.
- Bug #1687: Fixed plistlib.py restricts <integer> to Python int when writing.
- Issue #1182: many arithmetic bugs in the decimal module have been
fixed, and the decimal module has been updated to comply with the
latest IBM Decimal Arithmetic specification (version 1.66) and
testsuite (version 2.57). (Backported from Python 2.6a0.)
- Issue #1695: Fixed typo in the docstrings for time.localtime() and gmtime().
- Issue #1642: Fix segfault in ctypes when trying to delete attributes.
- Issue #1531: tarfile.py: Read fileobj from the current offset, do not
seek to the start.
- Issue 1429818: patch for trace and doctest modules so they play nicely
together.
- Bug #1307: Fix smtpd so it doesn't raise an exception when there is no arg.
- Bug #1153: repr.repr() now doesn't require set and dictionary items
to be orderable to properly represent them.
- Reverted the fix for bug #1548891 because it broke compatibility with
arbitrary read buffers. Added a note in the documentation.
- Fix bug in marshal where bad data would cause a segfault due to
lack of an infinite recursion check.
- Bug #1290505: Properly clear time.strptime's locale cache when the locale
changes between calls. Backport of r54646 and r54647.
- Bug #1706381: Specifying the SWIG option "-c++" in the setup.py file
(as opposed to the command line) will now write file names ending in
".cpp" too.
- Bug #1693258: IDLE would show two "Preferences" menu's with some versions
of Tcl/Tk
- Issue1385: The hmac module now computes the correct hmac when using hashes
with a block size other than 64 bytes (such as sha384 and sha512).
Extension Modules
-
-----------------
- Patch #1114: fix curses module compilation on 64-bit AIX, & possibly
other 64-bit LP64 platforms where attr_t is not the same size as a long.
(Contributed by Luke Mewburn.)
- Added support for linking the bsddb module against BerkeleyDB 4.6.x.
Documentation
-
-------------
- Bug #1569057: Document that calling file.next() on a file open for writing
has undefined behaviour. Backport of r54712.
Build
-
-----
- Have the search path for building extensions follow the declared order in
$CPPFLAGS and $LDFLAGS.
- Bug #1608: use -fwrapv when GCC supports it. This is important,
newer GCC versions may optimize away overflow buffer overflow checks
without this option!
Windows
-
-------
- 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.
- Patch #1654417: make operator.{get,set,del}slice use the full range
of Py_ssize_t.
- 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
-----
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 #1599782: fix segfault on bsddb.db.DB().type().
- Bug #1551427: fix a wrong NULL pointer check in the win32 version
of os.urandom().
Tests
-
-----
- Fix utf-8-sig incremental decoder, which didn't recognise a BOM when the
first chunk fed to the decoder started with a BOM, but was longer than 3 bytes.
Documentation
-
-------------
- 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.
Tests
-----
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.
- 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
Extension Modules
-
-----------------
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
-
-------
- 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 #1180296: Two new functions were added to the locale module:
format_string() to get the effect of "format % items" but locale-aware,
and currency() to format a monetary number with currency sign.
- 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
-------------
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
-----------------
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))
- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
- 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 #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
- 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.
- 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.
- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
languages.
- 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 #1100201: Cross-site scripting was possible on BaseHTTPServer via
error messages.
- 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.
- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
- 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
-----------
- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
directory for syntax highlighting in Vim. Vim directory was added and placed
vimrc to it (was previous up a level).
- Fixed a display glitch in Pynche, which could cause the right arrow to
wiggle over by a pixel.
----