Professional Documents
Culture Documents
NEWS
NEWS
Python News
+++++++++++
What's New in Python 2.7.8?
===========================
*Release date: 2014-06-29*
Core and Builtins
----------------- Issue #4346: In PyObject_CallMethod and PyObject_CallMethodObjArgs, don't
overwrite the error set in PyObject_GetAttr.
- Issue #21831: Avoid integer overflow when large sizes and offsets are given to
the buffer type.
- Issue #1856: Avoid crashes and lockups when daemon threads run while the
interpreter is shutting down; instead, these threads are now killed when they
try to take the GIL.
- Issue #19656: Running Python with the -3 option now also warns about
non-ascii bytes literals.
- Issue #21642: If the conditional if-else expression, allow an integer written
with no space between itself and the ``else`` keyword (e.g. ``True if 42else
False``) to be valid syntax.
- Issue #21523: Fix over-pessimistic computation of the stack effect of
some opcodes in the compiler. This also fixes a quadratic compilation
time issue noticeable when compiling code with a large number of "and"
and "or" operators.
Library
------- Issue #21652: Prevent mimetypes.type_map from containing unicode keys on
Windows.
- Issue #21729: Used the "with" statement in the dbm.dumb module to ensure
files closing.
- Issue #21672: Fix the behavior of ntpath.join on UNC-style paths.
- Issue #19145: The times argument for itertools.repeat now handles
negative values the same way for keyword arguments as it does for
positional arguments.
- Issue #21832: Require named tuple inputs to be exact strings.
- Issue #8343: Named group error messages in the re module did not show
the name of the erroneous group.
- Issue #21491: SocketServer: Fix a race condition in child processes reaping.
- Issue #21635: The difflib SequenceMatcher.get_matching_blocks() method
cache didn't match the actual result. The former was a list of tuples
and the latter was a list of named tuples.
- Issue #21722: The distutils "upload" command now exits with a non-zero
return code when uploading fails. Patch by Martin Dengler.
- Issue #21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths
before checking for a CGI script at that path.
- Issue #21310: Fixed possible resource leak in failed open().
- Issue #21304: Backport the key derivation function hashlib.pbkdf2_hmac from
Python 3 per PEP 466.
- Issue #11709: Fix the pydoc.help function to not fail when sys.stdin is not a
valid file.
- Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods
that use 'self' in the example code is generated correctly.
- Issue #21552: Fixed possible integer overflow of too long string lengths in
the tkinter module on 64-bit platforms.
- Issue #14315: The zipfile module now ignores extra fields in the central
directory that are too short to be parsed instead of letting a struct.unpack
error bubble up as this "bad data" appears in many real world zip files in
the wild and is ignored by other zip tools.
- Issue #21402: Tkinter.ttk now works when default root window is not set.
- Issue #10203: sqlite3.Row now truly supports sequence protocol. In particulr
it supports reverse() and negative indices. Original patch by Claudiu Popa.
- Issue #8743: Fix interoperability between set objects and the
collections.Set() abstract base class.
- Issue #21481: Argparse equality and inequality tests now return
NotImplemented when comparing to an unknown type.
IDLE
---- Issue #21686: add unittest for HyperParser. Original patch by Saimadhav
Heblikar.
- Issue #12387: Add missing upper(lower)case versions of default Windows key
bindings for Idle so Caps Lock does not disable them. Patch by Roger Serwy.
- Issue #21695: Closing a Find-in-files output window while the search is
still in progress no longer closes Idle.
- Issue #18910: Add unittest for textView. Patch by Phil Webster.
- Issue #18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar.
- Issue #18409: Add unittest for AutoComplete. Patch by Phil Webster.
Tests
----- Issue #20155: Changed HTTP method names in failing tests in test_httpservers
so that packet filtering software (specifically Windows Base Filtering Engine)
does not interfere with the transaction semantics expected by the tests.
- Issue #19493: Refactored the ctypes test package to skip tests explicitly
rather than silently.
- Issue #18492: All resources are now allowed when tests are not run by
regrtest.py.
- Issue #21605: Added tests for Tkinter images.
- Issue #21493: Added test for ntpath.expanduser(). Original patch by
Claudiu Popa.
- Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
- Issue #13355: random.triangular() no longer fails with a ZeroDivisionError
when low equals high.
- Issue #21522: Added Tkinter tests for Listbox.itemconfigure(),
PanedWindow.paneconfigure(), and Menu.entryconfigure().
- Issue #20635: Added tests for Tk geometry managers.
Windows
------- Issue #21671, CVE-2014-0224: The bundled version of OpenSSL has been
updated to 1.0.1h.
What's New in Python 2.7.7
==========================
*Release date: 2014-05-31*
Build
----- Issue #21462: Build the Windows installers with OpenSSL 1.0.1g.
- Issue #19866: Include some test data in the Windows installers, so tests don't
fail.
What's New in Python 2.7.7 release candidate 1?
===============================================
*Release date: 2014-05-17*
Core and Builtins
----------------- Issue #21350: Fix file.writelines() to accept arbitrary buffer objects,
as advertised. Patch by Brian Kearns.
- Issue #20437: Fixed 43 potential bugs when deleting objects references.
- Issue #21134: Fix segfault when str is called on an uninitialized
UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object.
- Issue #20494: Ensure that free()d memory arenas are really released on POSIX
systems supporting anonymous memory mappings. Patch by Charles-Franois
Natali.
- Issue #17825: Cursor "^" is correctly positioned for SyntaxError and
IndentationError.
- Raise a better error when non-unicode codecs are used for a file's coding
cookie.
- Issue #17976: Fixed potential problem with file.write() not detecting IO error
by inspecting the return value of fwrite(). Based on patches by Jaakko Moisio
and Victor Stinner.
- Issue #14432: Generator now clears the borrowed reference to the thread
state. Fix a crash when a generator is created in a C thread that is
destroyed while the generator is still used. The issue was that a generator
contains a frame, and the frame kept a reference to the Python state of the
destroyed C thread. The crash occurs when a trace function is setup.
- Issue #19932: Fix typo in import.h, missing whitespaces in function prototypes
.
- Issue #19638: Fix possible crash / undefined behaviour from huge (more than 2
billion characters) input strings in _Py_dg_strtod.
- Issue #12546: Allow \x00 to be used as a fill character when using str, int,
float, and complex __format__ methods.
Library
------- Issue #10744: Fix PEP 3118 format strings on ctypes objects with a nontrivial
shape.
- Issue #7776: Backport Fix ``Host:'' header and reconnection when using
http.client.HTTPConnection.set_tunnel() from Python 3. Patch by Nikolaus
Rath.
- Issue #21306: Backport hmac.compare_digest from Python 3. This is part of PEP
466.
- Issue #21470: Do a better job seeding the random number generator by
using enough bytes to span the full state space of the Mersenne Twister.
- Issue #21469: Reduced the risk of false positives in robotparser by
checking to make sure that robots.txt has been read or does not exist
prior to returning True in can_fetch().
- Issue #21321: itertools.islice() now releases the reference to the source
iterator when the slice is exhausted. Patch by Anton Afanasyev.
- Issue #9291: Do not attempt to re-encode mimetype data read from registry in
ANSI mode. Initial patches by Dmitry Jemerov & Vladimir Iofik.
- Issue #21349: Passing a memoryview to _winreg.SetValueEx now correctly raises
a TypeError where it previously crashed the interpreter. Patch by Brian Kearns
- Fix arbitrary memory access in JSONDecoder.raw_decode with a negative second
parameter. Bug reported by Guido Vranken.
- Issue #21172: isinstance check relaxed from dict to collections.Mapping.
- Issue #21191: In os.fdopen, never close the file descriptor when an exception
happens.
- Issue #21149: Improved thread-safety in logging cleanup during interpreter
shutdown. Thanks to Devin Jeanpierre for the patch.
- Fix possible overflow bug in strop.expandtabs. You shouldn't be using this
module!
- Issue #20145: `assertRaisesRegex` now raises a TypeError if the second
argument is not a string or compiled regex.
- Issue #21058: Fix a leak of file descriptor in tempfile.NamedTemporaryFile(),
close the file descriptor if os.fdopen() fails
- Issue #20283: RE pattern methods now accept the string keyword parameters
as documented. The pattern and source keyword parameters are left as
deprecated aliases.
- Issue #11599: When an external command (e.g. compiler) fails, distutils now
prints out the whole command line (instead of just the command name) if the
environment variable DISTUTILS_DEBUG is set.
- Issue #4931: distutils should not produce unhelpful "error: None" messages
anymore. distutils.util.grok_environment_error is kept but doc-deprecated.
- Improve the random module's default seeding to use 256 bits of entropy
from os.urandom(). This was already done for Python 3, mildly improving
security with a bigger seed space.
- Issue #15618: Make turtle.py compatible with 'from __future__ import
unicode_literals'. Initial patch by Juancarlo Aez.
- Issue #20501: fileinput module no longer reads whole file into memory when usi
ng
fileinput.hook_encoded.
- Issue #6815: os.path.expandvars() now supports non-ASCII Unicode environment
variables names and values.
- Issue #20635: Fixed grid_columnconfigure() and grid_rowconfigure() methods of
Tkinter widgets to work in wantobjects=True mode.
- Issue #17671: Fixed a crash when use non-initialized io.BufferedRWPair.
Based on patch by Stephen Tu.
- Issue #8478: Untokenizer.compat processes first token from iterator input.
Patch based on lines from Georg Brandl, Eric Snow, and Gareth Rees.
- Issue #20594: Avoid name clash with the libc function posix_close.
- Issue #19856: shutil.move() failed to move a directory to other directory
on Windows if source name ends with os.altsep.
- Issue #14983: email.generator now always adds a line end after each MIME
boundary marker, instead of doing so only when there is an epilogue. This
fixes an RFC compliance bug and solves an issue with signed MIME parts.
- Issue #20013: Some imap servers disconnect if the current mailbox is
deleted, and imaplib did not handle that case gracefully. Now it
handles the 'bye' correctly.
- Issue #20426: When passing the re.DEBUG flag, re.compile() displays the
debug output every time it is called, regardless of the compilation cache.
- Issue #20368: The null character now correctly passed from Tcl to Python (in
unicode strings only). Improved error handling in variables-related commands.
- Issue #20435: Fix _pyio.StringIO.getvalue() to take into account newline
translation settings.
- Issue #20288: fix handling of invalid numeric charrefs in HTMLParser.
- Issue #19456: ntpath.join() now joins relative paths correctly when a drive
is present.
- Issue #8260: The read(), readline() and readlines() methods of
codecs.StreamReader returned incomplete data when were called after
readline() or read(size). Based on patch by Amaury Forgeot d'Arc.
- Issue #20374: Fix build with GNU readline >= 6.3.
- Issue #14548: Make multiprocessing finalizers check pid before
running to cope with possibility of gc running just after fork.
(Backport from 3.x.)
- Issue #20262: Warnings are raised now when duplicate names are added in the
ZIP file or too long ZIP file comment is truncated.
- Issue #20270: urllib and urlparse now support empty ports.
- Issue #20243: TarFile no longer raise ReadError when opened in write mode.
- Issue #20245: The open functions in the tarfile module now correctly handle
empty mode.
- Issue #20086: Restored the use of locale-independent mapping instead of
locale-dependent str.lower() in locale.normalize().
- Issue #20246: Fix buffer overflow in socket.recvfrom_into.
- Issue #19082: Working SimpleXMLRPCServer and xmlrpclib examples, both in
modules and documentation.
- Issue #13107: argparse and optparse no longer raises an exception when output
a help on environment with too small COLUMNS. Based on patch by
Elazar Gershuni.
- Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly
asked for.
- Issue #20072: Fixed multiple errors in tkinter with wantobjects is False.
- Issue #1065986: pydoc can now handle unicode strings.
- Issue #16039: CVE-2013-1752: Change use of readline in imaplib module to
limit line length. Patch by Emil Lind.
- Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl
module, rather than silently let them emit clear text data.
- Issue #20027: Fixed locale aliases for devanagari locales.
- Issue #20067: Tkinter variables now work when wantobjects is false.
- Issue #19020: Tkinter now uses splitlist() instead of split() in configure
methods.
- Issue #12226: HTTPS is now used by default when connecting to PyPI.
- Issue #20048: Fixed ZipExtFile.peek() when it is called on the boundary of
the uncompress buffer and read() goes through more than one readbuffer.
- Issue #20034: Updated alias mapping to most recent locale.alias file
from X.org distribution using makelocalealias.py.
- Issue #5815: Fixed support for locales with modifiers. Fixed support for
locale encodings with hyphens.
- Issue #20026: Fix the sqlite module to handle correctly invalid isolation
level (wrong type).
- Issue #18829: csv.Dialect() now checks type for delimiter, escapechar and
quotechar fields. Original patch by Vajrasky Kok.
- Issue #19855: uuid.getnode() on Unix now looks on the PATH for the
executables used to find the mac address, with /sbin and /usr/sbin as
fallbacks.
- Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
- Issue #19912: Fixed numerous bugs in ntpath.splitunc().
- Issue #19623: Fixed writing to unseekable files in the aifc module.
Fixed writing 'ulaw' (lower case) compressed AIFC files.
- Issue #17919: select.poll.register() again works with poll.POLLNVAL on AIX.
Fixed integer overflow in the eventmask parameter.
- Issue #17200: telnetlib's read_until and expect timeout was broken by the
fix to Issue #14635 in Python 2.7.4 to be interpreted as milliseconds
instead of seconds when the platform supports select.poll (ie: everywhere).
It is now treated as seconds once again.
- Issue #19099: The struct module now supports Unicode format strings.
- Issue #19878: Fix segfault in bz2 module after calling __init__ twice with
non-existent filename. Initial patch by Vajrasky Kok.
- Issue #16373: Prevent infinite recursion for ABC Set class comparisons.
- Issue #19138: doctest's IGNORE_EXCEPTION_DETAIL now allows a match when
no exception detail exists (no colon following the exception's name, or
a colon does follow but no text follows the colon).
- Issue #16231: Fixed pickle.Pickler to only fallback to its default pickling
behaviour when Pickler.persistent_id returns None, but not for any other
false values. This allows false values other than None to be used as
IDLE
---- Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin
consolidating and improving human-validated tests of Idle. Change other files
as needed to work with htest. Running the module as __main__ runs all tests.
- Issue #21139: Change default paragraph width to 72, the PEP 8 recommendation.
- Issue #21284: Paragraph reformat test passes after user changes reformat width
.
- Issue #20406: Use Python application icons for Idle window title bars.
Patch mostly by Serhiy Storchaka.
- Issue #21029: Occurrences of "print" are now consistently colored as
being a keyword (the colorizer doesn't know if print functions are
enabled in the source).
- Issue #17721: Remove non-functional configuration dialog help button until we
make it actually gives some help when clicked. Patch by Guilherme Simes.
- Issue #17390: Add Python version to Idle editor window title bar.
Original patches by Edmond Burnett and Kent Johnson.
- Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
- Issue #19481: print() of unicode, str or bytearray subclass instance in IDLE
no more hangs.
- Issue #18270: Prevent possible IDLE AttributeError on OS X when no initial
shell window is present.
- Issue #17654: Ensure IDLE menus are customized properly on OS X for
non-framework builds and for all variants of Tk.
Tests
----- Issue #17752: Fix distutils tests when run from the installed location.
- Issue #18604: Consolidated checks for GUI availability. All platforms now
at least check whether Tk can be instantiated when the GUI resource is
requested.
- Issue #20946: Correct alignment assumptions of some ctypes tests.
- Issue #20743: Fix a reference leak in test_tcl.
- Issue #20510: Rewrote test_exit in test_sys to match existing comments,
use modern unittest features, and use helpers from test.script_helper
instead of using subprocess directly. Initial patch by Gareth Rees.
- Issue #20532: Tests which use _testcapi now are marked as CPython only.
- Issue #19920: Added tests for TarFile.list(). Based on patch by Vajrasky Kok.
- Issue #19990: Added tests for the imghdr module. Based on patch by
Claudiu Popa.
compressed streams.
- Issue #19158: a rare race in BoundedSemaphore could allow .release() too
often.
- Issue #18037: 2to3 now escapes '\u' and '\U' in native strings.
- Issue #19137: The pprint module now correctly formats empty set and frozenset
and instances of set and frozenset subclasses.
- Issue #16040: CVE-2013-1752: nntplib: Limit maximum line lengths to 2048 to
prevent readline() calls from consuming too much memory. Patch by Jyrki
Pulliainen.
- Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except
when necessary. Patch by Oscar Benjamin.
- Properly initialize all fields of a SSL object after allocation.
- Issue #4366: Fix building extensions on all platforms when --enable-shared
is used.
- Issue #18950: Fix miscellaneous bugs in the sunau module.
Au_read.readframes() now updates current file position and reads correct
number of frames from multichannel stream. Au_write.writeframesraw() now
correctly updates current file position. Au_read and Au_write now correctly
work with file object if start file position is not a zero.
- Issue #18050: Fixed an incompatibility of the re module with Python 2.7.3
and older binaries.
- Issue #19037: The mailbox module now makes all changes to maildir files
before moving them into place, to avoid race conditions with other programs
that may be accessing the maildir directory.
- Issue #14984: On POSIX systems, when netrc is called without a filename
argument (and therefore is reading the user's $HOME/.netrc file), it now
enforces the same security rules as typical ftp clients: the .netrc file must
be owned by the user that owns the process and must not be readable by any
other user.
- Issue #17324: Fix http.server's request handling case on trailing '/'. Patch
contributed by Vajrasky Kok.
- Issue #19018: The heapq.merge() function no longer suppresses IndexError
in the underlying iterables.
- Issue #18784: The uuid module no more attempts to load libc via ctypes.CDLL,
if all necessary functions are already found in libuuid.
Patch by Evgeny Sologubov.
- Issue #14971: unittest test discovery no longer gets confused when a function
has a different __name__ than its name in the TestCase class dictionary.
- Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
the _sre module.
- Issue #18830: inspect.getclasstree() no more produces duplicated entries even
when input list contains duplicates.
- Issue #17192: Restore the patch for Issue #10309 which was ommitted
in 2.7.4 when updating the bundled version of libffi used by ctypes.
- Issue #17843: Removed test data file that was triggering false-positive virus
warnings with certain antivirus software.
- Issue #17353: Plistlib emitted empty data tags with deeply nested datastructur
es
- Issue #11714: Use 'with' statements to assure a Semaphore releases a
condition variable. Original patch by Thomas Rachel.
- Issue #17795: Reverted backwards-incompatible change in SysLogHandler with
Unix domain sockets.
- Issue #17555: Fix ForkAwareThreadLock so that size of after fork
registry does not grow exponentially with generation of process.
- Issue #17710: Fix cPickle raising a SystemError on bogus input.
- Issue #17341: Include the invalid name in the error messages from re about
invalid group names.
- Issue #17016: Get rid of possible pointer wraparounds and integer overflows
in the re module. Patch by Nickolai Zeldovich.
- Issue #17536: Add to webbrowser's browser list: xdg-open, gvfs-open,
www-browser, x-www-browser, chromium browsers, iceweasel, iceape.
- Issue #17656: Fix extraction of zip files with unicode member paths.
- Issue #17666: Fix reading gzip files with an extra field.
- Issue #13150, #17512: sysconfig no longer parses the Makefile and config.h
files when imported, instead doing it at build time. This makes importing
sysconfig faster and reduces Python startup time by 20%.
- Issue #13163: Rename operands in smtplib.SMTP._get_socket to correct names;
fixes otherwise misleading output in tracebacks and when when debug is on.
- Issue #17526: fix an IndexError raised while passing code without filename to
inspect.findsource(). Initial patch by Tyler Doyle.
Build
----- Issue #17547: In configure, explicitly pass -Wformat for the benefit for GCC
4.8.
- Issue #17682: Add the _io module to Modules/Setup.dist (commented out).
- Issue #17086: Search the include and library directories provided by the
compiler.
Tests
----- Issue #17928: Fix test_structmembers on 64-bit big-endian machines.
----------------- Issue #15801 (again): With string % formatting, relax the type check for a
mapping such that any type with a __getitem__ can be used on the right hand
side.
IDLE
---- Issue #17625: In IDLE, close the replace dialog after it is used.
Tests
----- Issue #17835: Fix test_io when the default OS pipe buffer size is larger
than one million bytes.
- Issue #17531: Fix tests that thought group and user ids were always the int
type. Also, always allow -1 as a valid group and user id.
- Issue #17533: Fix test_xpickle with older versions of Python 2.5.
Documentation
------------- Issue 17538: Document XML vulnerabilties
What's New in Python 2.7.4 release candidate 1
==============================================
*Release date: 2013-03-23*
Core and Builtins
----------------- Issue #10211: Buffer objects expose the new buffer interface internally
- Issue #16445: Fixed potential segmentation fault when deleting an exception
message.
- Issue #17275: Corrected class name in init error messages of the C version of
BufferedWriter and BufferedRandom.
- Issue #7963: Fixed misleading error message that issued when object is
called without arguments.
- Issue #5308: Raise ValueError when marshalling too large object (a sequence
with size >= 2**31), instead of producing illegal marshal data.
- Issue #17043: The unicode-internal decoder no longer read past the end of
input buffer.
- Issue #16979: Fix error handling bugs in the unicode-escape-decode decoder.
- Issue #10156: In the interpreter's initialization phase, unicode globals
are now initialized dynamically as needed.
- Issue #16975: Fix error handling bug in the escape-decode decoder.
- Issue #14775: Fix a potential quadratic dict build-up due to the garbage
collector repeatedly trying to untrack dicts.
- Issue #14494: Fix __future__.py and its documentation to note that
absolute imports are the default behavior in 3.0 instead of 2.7.
Patch by Sven Marnach.
- Issue #14761: Fix potential leak on an error case in the import machinery.
- Issue #14699: Fix calling the classmethod descriptor directly.
- Issue #11603 (again): Setting __repr__ to __str__ now raises a RuntimeError
when repr() or str() is called on such an object.
- Issue #14658: Fix binding a special method to a builtin implementation of a
special method with a different name.
- Issue #14612: Fix jumping around with blocks by setting f_lineno.
- Issue #13889: Check and (if necessary) set FPU control word before calling
any of the dtoa.c string <-> float conversion functions, on MSVC builds of
Python. This fixes issues when embedding Python in a Delphi app.
- Issue #14505: Fix file descriptor leak when deallocating file objects
created with PyFile_FromString().
- Issue #14474: Save and restore exception state in thread.start_new_thread()
while writing error message if the thread leaves a unhandled exception.
- Issue #13019: Fix potential reference leaks in bytearray.extend(). Patch
by Suman Saha.
- Issue #14378: Fix compiling ast.ImportFrom nodes with a "__future__" string as
the module name that was not interned.
- Issue #14331: Use significantly less stack space when importing modules by
allocating path buffers on the heap instead of the stack.
- Issue #14334: Prevent in a segfault in type.__getattribute__ when it was not
passed strings. Also fix segfaults in the __getattribute__ and __setattr__
methods of old-style classes.
- Issue #14161: fix the __repr__ of file objects to escape the file name.
- Issue #1469629: Allow cycles through an object's __dict__ slot to be
collected. (For example if ``x.__dict__ is x``).
- Issue #13521: dict.setdefault() now does only one lookup for the given key,
making it "atomic" for many purposes. Patch by Filip Gruszczy ski.
- Issue #1602133: on Mac OS X a shared library build (``--enable-shared``)
now fills the ``os.environ`` variable correctly.
- Issue #10538: When using the "s*" code with PyArg_ParseTuple() to fill a
Py_buffer structure with data from an object supporting only the old
PyBuffer interface, a reference to the source objects is now properly added
to the Py_buffer.obj member.
Library
-------
- Issue #4844: ZipFile now raises BadZipfile when opens a ZIP file with an
incomplete "End of Central Directory" record. Original patch by Guilherme
Polo and Alan McIntyre.
- Issue #15505: `unittest.installHandler` no longer assumes SIGINT handler is
set to a callable object.
- Issue #17051: Fix a memory leak in os.path.isdir() on Windows. Patch by
Robert Xiao.
- Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
if all other iterators were very advanced before.
- Issue #16992: On Windows in signal.set_wakeup_fd, validate the file
descriptor argument.
- Issue #15861: tkinter now correctly works with lists and tuples containing
strings with whitespaces, backslashes or unbalanced braces.
- Issue #10527: Use poll() instead of select() for multiprocessing pipes.
- Issue #9720: zipfile now writes correct local headers for files larger than
4 GiB.
- Issue #13899: \A, \Z, and \B now correctly match the A, Z, and B literals
when used inside character classes (e.g. '[\A]'). Patch by Matthew Barnett.
- Issue #16398: Optimize deque.rotate() so that it only moves pointers
and doesn't touch the underlying data with increfs and decrefs.
- Issue #15109: Fix regression in sqlite3's iterdump method where it would
die with an encoding error if the database contained string values
containing non-ASCII. (Regression was introduced by fix for 9750).
- Issue #15545: Fix regression in sqlite3's iterdump method where it was
failing if the connection used a row factory (such as sqlite3.Row) that
produced unsortable objects. (Regression was introduced by fix for 9750).
- Issue #16828: Fix error incorrectly raised by bz2.compress(''). Patch by
Martin Packman.
- Issue #9586: Redefine SEM_FAILED on MacOSX to keep compiler happy.
- Issue #10527: make multiprocessing use poll() instead of select() if available
.
- Issue #16485: Now file descriptors are closed if file header patching failed
on closing an aifc file.
- Issue #12065: connect_ex() on an SSL socket now returns the original errno
when the socket's timeout expires (it used to return None).
- Issue #16713: Fix the parsing of tel url with params using urlparse module.
- Issue #16443: Add docstrings to regular expression match objects.
Patch by Anton Kasyanov.
- Issue #8853: Allow port to be of type long for socket.getaddrinfo().
- Issue #16597: In buffered and text IO, call close() on the underlying stream
- Issue #16230: Fix a crash in select.select() when one the lists changes
size while iterated on. Patch by Serhiy Storchaka.
- Issue #16228: Fix a crash in the json module where a list changes size
while it is being encoded. Patch by Serhiy Storchaka.
- Issue #14897: Enhance error messages of struct.pack and
struct.pack_into. Patch by Matti Mki.
- Issue #12890: cgitb no longer prints spurious <p> tags in text
mode when the logdir option is specified.
- Issue #14398: Fix size truncation and overflow bugs in the bz2 module.
- Issue #5148: Ignore 'U' in mode given to gzip.open() and gzip.GzipFile().
- Issue #16220: wsgiref now always calls close() on an iterable response.
Patch by Brent Tubbs.
- Issue #16461: Wave library should be able to deal with 4GB wav files,
and sample rate of 44100 Hz.
- Issue #16176: Properly identify Windows 8 via platform.platform()
- Issue #15756: subprocess.poll() now properly handles errno.ECHILD to
return a returncode of 0 when the child has already exited or cannot
be waited on.
- Issue #12376: Pass on parameters in TextTestResult.__init__ super call
- Issue #15222: Insert blank line after each message in mbox mailboxes
- Issue #16013: Fix CSV Reader parsing issue with ending quote characters.
Patch by Serhiy Storchaka.
- Issue #15421: fix an OverflowError in Calendar.itermonthdates() after
datetime.MAXYEAR. Patch by Cdric Krier.
- Issue #15970: xml.etree.ElementTree now serializes correctly the empty HTML
elements 'meta' and 'param'.
- Issue #15676: Now "mmap" check for empty files before doing the
offset check. Patch by Steven Willis.
- Issue #15340: Fix importing the random module when /dev/urandom cannot
be opened. This was a regression caused by the hash randomization patch.
- Issue #15841: The readable(), writable() and seekable() methods of
io.BytesIO and io.StringIO objects now raise ValueError when the object has
been closed. Patch by Alessandro Moura.
- Issue #16112: platform.architecture does not correctly escape argument to
/usr/bin/file. Patch by David Benjamin.
- Issue #12776,#11839: call argparse type function (specified by add_argument)
only once. Before, the type function was called twice in the case where the
default was specified and the argument was given as well. This was
especially problematic for the FileType type, as a default file would always
be opened, even if a file argument was specified on the command line.
- Issue #14452: SysLogHandler no longer inserts a UTF-8 BOM into the message.
- Issue #13496: Fix potential overflow in bisect.bisect algorithm when applied
to a collection of size > sys.maxsize / 2.
- Issue #14399: zipfile now recognizes that the archive has been modified even
if only the comment is changed. As a consequence of this fix, ZipFile is now
a new style class.
- Issue #7978: SocketServer now restarts the select() call when EINTR is
returned. This avoids crashing the server loop when a signal is received.
Patch by Jerzy Kozera.
- Issue #10340: asyncore - properly handle EINVAL in dispatcher constructor on
OSX; avoid to call handle_connect in case of a disconnected socket which
was not meant to connect.
- Issue #12757: Fix the skipping of doctests when python is run with -OO so
that it works in unittest's verbose mode as well as non-verbose mode.
- Issue #13694: asynchronous connect in asyncore.dispatcher does not set addr
attribute.
- Issue #10484: Fix the CGIHTTPServer's PATH_INFO handling problem.
- Issue #11199: Fix the with urllib which hangs on particular ftp urls.
- Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under
Windows when the child process has already exited.
- Issue #14195: An issue that caused weakref.WeakSet instances to incorrectly
return True for a WeakSet instance 'a' in both 'a < a' and 'a > a' has been
fixed.
- Issue #14159: Fix the len() of weak sets to return a better approximation
when some objects are dead or dying. Moreover, the implementation is now
O(1) rather than O(n).
- Issue #2945: Make the distutils upload command aware of bdist_rpm products.
- Issue #6884: Fix long-standing bugs with MANIFEST.in parsing in distutils
on Windows.
- Issue #16441: Avoid excessive memory usage working with large gzip
files using the gzip module.
- Issue #15782: Prevent compile errors of OS X Carbon modules _Fm, _Qd, and
_Qdoffs when compiling with an SDK of 10.7 or later. The OS X APIs they
wrap have long been deprecated and have now been removed with 10.7.
These modules were already empty for 64-bit builds and have been removed
in Python 3.
Extension Modules
----------------- Issue #17477: Update the bsddb module to pybsddb 5.3.0, supporting
db-5.x, and dropping support for db-4.1 and db-4.2.
- Issue #17192: Update the ctypes module's libffi to v3.0.13. This
specifically addresses a stack misalignment issue on x86 and issues on
- Issue #14962: Update text coloring in IDLE shell window after changing
options. Patch by Roger Serwy.
- Issue #10997: Prevent a duplicate entry in IDLE's "Recent Files" menu.
- Issue #12510: Attempting to get invalid tooltip no longer closes IDLE.
Original patch by Roger Serwy.
- Issue #10365: File open dialog now works instead of crashing
even when parent window is closed. Patch by Roger Serwy.
- Issue #14876: Use user-selected font for highlight configuration.
Patch by Roger Serwy.
- Issue #14409: IDLE now properly executes commands in the Shell window
when it cannot read the normal config files on startup and
has to use the built-in default key bindings.
There was previously a bug in one of the defaults.
- Issue #3573: IDLE hangs when passing invalid command line args
(directory(ies) instead of file(s)) (Patch by Guilherme Polo)
- Issue #5219: Prevent event handler cascade in IDLE.
Tests
----- Issue #16702: test_urllib2_localnet tests now correctly ignores proxies for
localhost tests.
- Issue #13447: Add a test file to host regression tests for bugs in the
scripts found in the Tools directory.
- Issue #11420: make test suite pass with -B/DONTWRITEBYTECODE set.
Initial patch by Thomas Wouters.
- Issue #17299: Add test coverage for cPickle with file objects and general IO
objects. Original patch by Aman Shah.
- Issue #11963: remove human verification from test_parser and test_subprocess.
- Issue #17249: convert a test in test_capi to use unittest and reap threads.
- We now run both test_email.py and test_email_renamed.py when running the
test_email regression test. test_email_renamed contains some tests that
test_email does not.
- Issue #17041: Fix testing when Python is configured with the
--without-doc-strings option.
- Issue #15539: Added regression tests for Tools/scripts/pindent.py.
- Issue #15324: Fix regrtest parsing of --fromfile and --randomize options.
- Issue #16618: Add more regression tests for glob.
Patch by Serhiy Storchaka.
- Issue #16664: Add regression tests for glob's behaviour concerning entries
starting with a ".". Patch by Sebastian Kreft.
- Issue #15747: ZFS always returns EOPNOTSUPP when attempting to set the
UF_IMMUTABLE flag (via either chflags or lchflags); refactor affected
tests in test_posix.py to account for this.
- Issue #16549: Add tests for json.tools. Initial patch by Berker Peksag
and Serhiy Storchaka.
- Issue #16559: Add more tests for the json module, including some from the
official test suite at json.org. Patch by Serhiy Storchaka.
- Issue #16274: Fix test_asyncore on Solaris. Patch by Giampaolo Rodola'.
- Issue #15040: Close files in mailbox tests for PyPy compatibility.
Original patch by Matti Picus.
- Issue #15802: Fix test logic in TestMaildir.test_create_tmp. Patch
by Serhiy Storchaka.
- Issue #15765: Extend a previous fix to Solaris and OpenBSD for quirky
getcwd() behaviour (issue #9185) to NetBSD as well.
- Issue #15615: Add some tests for the json module's handling of invalid
input data. Patch by Kushal Das.
- Issue #15496: Add directory removal helpers for tests on Windows.
Patch by Jeremy Kloth.
- Issue #15043: test_gdb is now skipped entirely if gdb security settings
block loading of the gdb hooks
- Issue #14589: Update certificate chain for sha256.tbs-internet.com, fixing
a test failure in test_ssl.
- Issue #16698: Skip posix test_getgroups when built with OS X
deployment target prior to 10.6.
- Issue #17111: Prevent test_surrogates (test_fileio) failure on OS X 10.4.
Build
----- Issue #17425: Build against openssl 0.9.8y on Windows.
- Issue #16004: Add `make touch`.
- Issue #5033: Fix building of the sqlite3 extension module when the
SQLite library version has "beta" in it. Patch by Andreas Pelme.
- Issue #17228: Fix building without pymalloc.
- Issue #17086: Backport the patches from the 3.3 branch to cross-build
the package.
- Issue #3754: fix typo in pthread AC_CACHE_VAL.
- Issue #17029: Let h2py search the multiarch system include directory.
- Issue #16953: Fix socket module compilation on platforms with
HAVE_BROKEN_POLL. Patch by Jeffrey Armstrong.
- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.
- Issue #15923: fix a mistake in asdl_c.py that resulted in a TypeError after
2801bf875a24 (see #15801).
- Issue #11715: Fix multiarch detection without having Debian development
tools (dpkg-dev) installed.
- Issue #15819: Make sure we can build Python out-of-tree from a readonly
source directory. (Somewhat related to Issue #9860.)
- Issue #15822: Ensure 2to3 grammar pickles are properly installed.
- Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.
- Issue #8847: Disable COMDAT folding in Windows PGO builds.
- Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs.
- Issue #16256: OS X installer now sets correct permissions for doc directory.
- Issue #8767: Restore building with --disable-unicode.
Patch by Stefano Taschini.
- Build against bzip2 1.0.6 and openssl 0.9.8x on Windows.
- Issue #14557: Fix extensions build on HP-UX. Patch by Adi Roiban.
- Issue #14437: Fix building the _io module under Cygwin.
- Issue #15587: Enable Tk high-resolution text rendering on Macs with
Retina displays. Applies to Tkinter apps, such as IDLE, on OS X
framework builds linked with Cocoa Tk 8.5.
- Issue #17161: make install now also installs a python2 and python man page.
- Issue #16848: python-config now returns proper --ldflags values for OS X
framework builds.
Tools/Demos
----------- Issue #17156: pygettext.py now correctly escapes non-ascii characters.
- Issue #15539: Fix a number of bugs in Tools/scripts/pindent.py. Now
pindent.py works with a "with" statement. pindent.py no longer produces
improper indentation. pindent.py now works with continued lines broken after
"class" or "def" keywords and with continuations at the start of line.
- Issue #16476: Fix json.tool to avoid including trailing whitespace.
- Issue #13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py
Patch by Serhiy Storchaka.
Documentation
------------- Issue #15041: Update "see also" list in tkinter documentation.
- Issue #17412: update 2.7 Doc/make.bat to also use sphinx-1.0.7.
Previous code assumed that the raw write() would raise BlockingIOError, but
RawIOBase.write() is defined to returned None when the call would block.
Patch by sbt.
- Issue #13358: HTMLParser now calls handle_data only once for each CDATA.
- Issue #4147: minidom's toprettyxml no longer adds whitespace around a text
node when it is the only child of an element. Initial patch by Dan
Kenigsberg.
- Issues #1745761, #755670, #13357, #12629, #1200313: HTMLParser now correctly
handles non-valid attributes, including adjacent and unquoted attributes.
- Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
when called with a timeout. Patch by Arnaud Ysmal.
- Issue #3067: Enhance the documentation and docstring of
locale.setlocale().
- Issue #13254: Fix Maildir initialization so that maildir contents
are read correctly.
- Issue #13140: Fix the daemon_threads attribute of ThreadingMixIn.
- Issue #2892: preserve iterparse events in case of SyntaxError.
- Issue #670664: Fix HTMLParser to correctly handle the content of
``<script>...</script>`` and ``<style>...</style>``.
- Issue #10817: Fix urlretrieve function to raise ContentTooShortError even
when reporthook is None. Patch by Jyrki Pulliainen.
- Issue #7334: close source files on ElementTree.parse and iterparse.
- Issue #13232: logging: Improved logging of exceptions in the presence of
multiple encodings.
- Issue #10332: multiprocessing: fix a race condition when a Pool is closed
before all tasks have completed.
- Issue #1548891: The cStringIO.StringIO() constructor now encodes unicode
arguments with the system default encoding just like the write() method
does, instead of converting it to a raw buffer. This also fixes handling of
unicode input in the shlex module (#6988, #1170).
- Issue #9168: now smtpd is able to bind privileged port.
- Issue #12529: fix cgi.parse_header issue on strings with double-quotes and
semicolons together. Patch by Ben Darnell and Petri Lehtinen.
- Issue #6090: zipfile raises a ValueError when a document with a timestamp
earlier than 1980 is provided. Patch contributed by Petri Lehtinen.
- Issue #13194: zlib.compressobj().copy() and zlib.decompressobj().copy() are
now available on Windows.
- Issue #13114: Fix the distutils commands check and register when the
long description is a Unicode string with non-ASCII characters.
- Issue #7367: Fix pkgutil.walk_paths to skip directories whose
json.loads().
- Issue #9975: socket: Fix incorrect use of flowinfo and scope_id. Patch by
Vilmos Nebehaj.
- Issue #13159: FileIO, BZ2File, and the built-in file class now use a
linear-time buffer growth strategy instead of a quadratic one.
- Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
would be finalized after the reference to its underlying BufferedRWPair's
writer got cleared by the GC.
- Issue #12881: ctypes: Fix segfault with large structure field names.
- Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
Thanks to Suman Saha for finding the bug and providing a patch.
- Issue #13022: Fix: _multiprocessing.recvfd() doesn't check that
file descriptor was actually received.
- Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
- Issue #12950: Fix passing file descriptors in multiprocessing, under
OpenIndiana/Illumos.
- Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
a string.
- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
some functions like file.write().
- Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
signature. Without this, architectures where sizeof void* != sizeof int are
broken. Patch given by Hallvard B Furuseth.
IDLE
---- Issue #964437 Make IDLE help window non-modal.
Patch by Guilherme Polo and Roger Serwy.
- Issue #13933: IDLE auto-complete did not work with some imported
module, like hashlib. (Patch by Roger Serwy)
- Issue #13506: Add '' to path for IDLE Shell when started and restarted with Re
start Shell.
Original patches by Marco Scataglini and Roger Serwy.
- Issue #4625: If IDLE cannot write to its recent file or breakpoint
files, display a message popup and continue rather than crash.
(original patch by Roger Serwy)
- Issue #8793: Prevent IDLE crash when given strings with invalid hex escape
sequences.
- Issue #13296: Fix IDLE to clear compile __future__ flags on shell restart.
(Patch by Roger Serwy)
Build
in test_telnetlib.py.
- Solved a potential deadlock in test_telnetlib.py. Related to issue #11812.
- Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and
an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder
Web site.
- Avoid failing in test_urllibnet.test_bad_address when some overzealous
DNS service (e.g. OpenDNS) resolves a non-existent domain name. The test
is now skipped instead.
- Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
test_tk or test_ttk_guionly under a username that is not currently logged
in to the console windowserver (as may be the case under buildbot or ssh).
- Issue #12141: Install a copy of template C module file so that
test_build_ext of test_distutils is no longer silently skipped when
run outside of a build directory.
- Issue #8746: Add additional tests for os.chflags() and os.lchflags().
Patch by Garrett Cooper.
- Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
on Mac OS X. (Patch by Ronald Oussoren)
- Issue #12057: Add tests for ISO 2022 codecs (iso2022_jp, iso2022_jp_2,
iso2022_kr).
Documentation
------------- Issues #13491 and #13995: Fix many errors in sqlite3 documentation.
Initial patch for #13491 by Johannes Vogel.
- Issue #13402: Document absoluteness of sys.executable.
- Issue #13883: PYTHONCASEOK also works on OS X, OS/2, and RiscOS.
- Issue #2134: The tokenize documentation has been clarified to explain why
all operator and delimiter tokens are treated as token.OP tokens.
- Issue #13513: Fix io.IOBase documentation to correctly link to the
io.IOBase.readline method instead of the readline module.
- Issue #13237: Reorganise subprocess documentation to emphasise convenience
functions and the most commonly needed arguments to Popen.
- Issue #13141: Demonstrate recommended style for SocketServer examples.
What's New in Python 2.7.2?
===========================
*Release date: 2011-06-11*
Library
------- Issue #12009: Fixed regression in netrc file comment handling.
Extension Modules
----------------- Issue #1221: Make pyexpat.__version__ equal to the Python version.
What's New in Python 2.7.2 release candidate 1?
===============================================
*Release date: 2011-05-29*
Core and Builtins
----------------- Issue #9670: Increase the default stack size for secondary threads on
Mac OS X and FreeBSD to reduce the chances of a crash instead of a
"maximum recursion depth" RuntimeError exception.
(patch by Ronald Oussoren)
- Correct lookup of __dir__ on objects. This allows old-style classes to have
__dir__. It also causes errors besides AttributeError found on lookup to be
propagated.
- Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c,
clear the end-of-file indicator after CTRL+d.
- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
(length bigger than 2^31-1 bytes).
- Issue #8651: Fix "z#" format of PyArg_Parse*() function: the size was not
written if PY_SSIZE_T_CLEAN is defined.
- Issue #9756: When calling a method descriptor or a slot wrapper descriptor,
the check of the object type doesn't read the __class__ attribute anymore.
Fix a crash if a class override its __class__ attribute (e.g. a proxy of the
str type). Patch written by Andreas Sthrk.
- Issue #10517: After fork(), reinitialize the TLS used by the PyGILState_*
APIs, to avoid a crash with the pthread implementation in RHEL 5. Patch
by Charles-Franois Natali.
- Issue #6780: fix starts/endswith error message to mention that tuples are
accepted too.
- Issue #5057: fix a bug in the peepholer that led to non-portable pyc files
between narrow and wide builds while optimizing BINARY_SUBSCR on non-BMP
chars (e.g. u"\U00012345"[0]).
- Issue #11650: PyOS_StdioReadline() retries fgets() if it was interrupted
(EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch
written by Charles-Francois Natali.
- Issue #11144: Ensure that int(a_float) returns an int whenever possible.
Previously, there were some corner cases where a long was returned even
though the result was within the range of an int.
- Issue #11450: Don't truncate hg version info in Py_GetBuildInfo() when
there are many tags (e.g. when using mq). Patch by Nadeem Vawda.
- Issue #11703: urllib2.geturl() does not return correct url when the original
url contains #fragment.
- Issue #10019: Fixed regression in json module where an indent of 0 stopped
adding newlines and acted instead like 'None'.
- Issue #5162: Treat services like frozen executables to allow child spawning
from multiprocessing.forking on Windows.
- Issue #4877: Fix a segfault in xml.parsers.expat while attempting to parse
a closed file.
- Issue #11830: Remove unnecessary introspection code in the decimal module.
It was causing a failed import in the Turkish locale where the locale
sensitive str.upper() method caused a name mismatch.
- Issue #8428: Fix a race condition in multiprocessing.Pool when terminating
worker processes: new processes would be spawned while the pool is being
shut down. Patch by Charles-Franois Natali.
- Issue #7311: Fix HTMLParser to accept non-ASCII attribute values.
- Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.
- Issue #11662: Make urllib and urllib2 ignore redirections if the
scheme is not HTTP, HTTPS or FTP (CVE-2011-1521).
- Issue #11256: Fix inspect.getcallargs on functions that take only keyword
arguments.
- Issue #11696: Fix ID generation in msilib.
- Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when
trying to pack a negative (in-range) integer.
- Issue #11675: multiprocessing.[Raw]Array objects created from an integer size
are now zeroed on creation. This matches the behaviour specified by the
documentation.
- Issue #7639: Fix short file name generation in bdist_msi.
- Issue #11666: let help() display named tuple attributes and methods
that start with a leading underscore.
- Issue #11673: Fix multiprocessing Array and RawArray constructors to accept a
size of type 'long', rather than only accepting 'int'.
- Issue #10042: Fixed the total_ordering decorator to handle cross-type
comparisons that could lead to infinite recursion.
- Issue #10979: unittest stdout buffering now works with class and module
setup and teardown.
- Issue #11569: use absolute path to the sysctl command in multiprocessing to
ensure that it will be found regardless of the shell PATH. This ensures
that multiprocessing.cpu_count works on default installs of MacOSX.
- Issue #11500: Fixed a bug in the os x proxy bypass code for fully qualified
IP addresses in the proxy exception list.
- Issue #11131: Fix sign of zero in plus and minus operations when
the context rounding mode is ROUND_FLOOR.
- Issue #5622: Fix curses.wrapper to raise correct exception if curses
initialization fails.
- Issue #11391: Writing to a mmap object created with
``mmap.PROT_READ|mmap.PROT_EXEC`` would segfault instead of raising a
TypeError. Patch by Charles-Franois Natali.
- Issue #11306: mailbox in certain cases adapts to an inability to open
certain files in read-write mode. Previously it detected this by
checking for EACCES, now it also checks for EROFS.
- Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors
on accept(), send() and recv().
- Issue #11326: Add the missing connect_ex() implementation for SSL sockets,
and make it work for non-blocking connects.
- Issue #10956: Buffered I/O classes retry reading or writing after a signal
has arrived and the handler returned successfully.
- Issue #10680: Fix mutually exclusive arguments for argument groups in
argparse.
- Issue #4681: Allow mmap() to work on file sizes and offsets larger than
4GB, even on 32-bit builds. Initial patch by Ross Lagerwall, adapted for
32-bit Windows.
- Issue #10360: In WeakSet, do not raise TypeErrors when testing for
membership of non-weakrefable objects.
- Issue #10549: Fix pydoc traceback when text-documenting certain classes.
- Issue #940286: pydoc.Helper.help() ignores input/output init parameters.
- Issue #11171: Fix detection of config/Makefile when --prefix !=
--exec-prefix, which caused Python to not start.
- Issue #11116: any error during addition of a message to a mailbox now causes
a rollback, instead of leaving the mailbox partially modified.
- Issue #8275: Fix passing of callback arguments with ctypes under Win64.
Patch by Stan Mihai.
- Issue #10949: Improved robustness of rotating file handlers.
- Issue #10955: Fix a potential crash when trying to mmap() a file past its
length. Initial patch by Ross Lagerwall.
- Issue #10898: Allow compiling the posix module when the C library defines
a symbol named FSTAT.
- Issue #10916: mmap should not segfault when a file is mapped using 0 as
length and a non-zero offset, and an attempt to read past the end of file
is made (IndexError is raised instead). Patch by Ross Lagerwall.
- Issue #10875: Update Regular Expression HOWTO; patch by 'SilentGhost'.
- Issue #10827: Changed the rules for 2-digit years. The time.asctime
function will now format any year when ``time.accept2dyear`` is
false and will accept years >= 1000 otherwise. The year range
accepted by ``time.mktime`` and ``time.strftime`` is still system
dependent, but ``time.mktime`` will now accept full range supported
by the OS. Conversion of 2-digit years to 4-digit is deprecated.
- Issue #10869: Fixed bug where ast.increment_lineno modified the root
node twice.
- Issue #7858: Raise an error properly when os.utime() fails under Windows
on an existing file.
- Issue #3839: wsgiref should not override a Content-Length header set by
the application. Initial patch by Clovis Fabricio.
- Issue #10806, issue #9905: Fix subprocess pipes when some of the standard
file descriptors (0, 1, 2) are closed in the parent process. Initial
patch by Ross Lagerwall.
- Issue #4662: os.tempnam(), os.tmpfile() and os.tmpnam() now raise a py3k
DeprecationWarning.
- Subclasses of collections.OrderedDict now work correctly with __missing__.
- Issue #10753 - Characters ';', '=' and ',' in the PATH_INFO environment
variable won't be quoted when the URI is constructed by the wsgiref.util 's
request_uri method. According to RFC 3986, these characters can be a part of
params in PATH component of URI and need not be quoted.
- Issue #10738: Fix webbrowser.Opera.raise_opts
- Issue #9824: SimpleCookie now encodes , and ; in values to cater to how
browsers actually parse cookies.
- Issue #1379416: eliminated a source of accidental unicode promotion in
email.header.Header.encode.
- Issue #5258/#10642: if site.py encounters a .pth file that generates an error,
it now prints the filename, line number, and traceback to stderr and skips
the rest of that individual file, instead of stopping processing entirely.
- Issue #10750: The ``raw`` attribute of buffered IO objects is now read-only.
- Issue #10242: unittest.TestCase.assertItemsEqual makes too many assumptions
about input.
- Issue #10611: SystemExit should not cause a unittest test run to exit.
- Issue #6791: Limit header line length (to 65535 bytes) in http.client,
to avoid denial of services from the other party.
- Issue #9907: Fix tab handling on OSX when using editline by calling
rl_initialize first, then setting our custom defaults, then reading .editrc.
- Issue #4188: Avoid creating dummy thread objects when logging operations
from the threading module (with the internal verbose flag activated).
- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
file in a package.
- Issue #12590: IDLE editor window now always displays the first line
when opening a long file. With Tk 8.5, the first line was hidden.
- Issue #11088: don't crash when using F5 to run a script in IDLE on MacOSX
with Tk 8.5.
- Issue #10940: Workaround an IDLE hang on Mac OS X 10.6 when using the
menu accelerators for Open Module, Go to Line, and New Indent Width.
The accelerators still work but no longer appear in the menu items.
- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5, rather
than the currently problematic Apple-supplied one, when running with the
64-/32-bit installer variant.
- Issue #11052: Correct IDLE menu accelerators on Mac OS X for Save
commands.
- Issue #6075: IDLE on Mac OS X now works with both Carbon AquaTk and
Cocoa AquaTk.
- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle.
- Issue #10107: Warn about unsaved files in IDLE on OSX.
- Issue #10406: Enable Rstrip IDLE extension on OSX (just like on other
platforms).
Build
----- Issue #11217: For 64-bit/32-bit Mac OS X universal framework builds,
ensure "make install" creates symlinks in --prefix bin for the "-32"
files in the framework bin directory like the installer does.
- Issue #11411: Fix 'make DESTDIR=' with a relative destination.
- Issue #10709: Add updated AIX notes in Misc/README.AIX.
- Issue #11184: Fix large-file support on AIX.
- Issue #941346: Fix broken shared library build on AIX.
- Issue #11268: Prevent Mac OS X Installer failure if Documentation
package had previously been installed.
- Issue #11079: The /Applications/Python x.x folder created by the Mac
OS X installers now includes a link to the installed documentation.
- Issue #11054: Allow Mac OS X installer builds to again work on 10.5 with
the system-provided Python.
- Issue #10843: Update third-party library versions used in OS X
32-bit installer builds: bzip2 1.0.6, readline 6.1.2, SQLite 3.7.4
(with FTS3/FTS4 and RTREE enabled), and ncursesw 5.5 (wide-char
support enabled).
- Don't run pgen twice when using make -j.
- Issue #2521: Use weakrefs on for caching in the abc module, so that classes
are not held onto after they are deleted elsewhere.
- Issue #9626: the view methods for collections.OrderedDict() were returning
the unordered versions inherited from dict. Those methods are now
overridden to provide ordered views.
- Issue #8688: MANIFEST files created by distutils now include a magic
comment indicating they are generated. Manually maintained MANIFESTs
without this marker will not be overwritten or removed.
- Issue #7467: when reading a file from a ZIP archive, its CRC is checked
and a BadZipfile error is raised if it doesn't match (as used to be the
case in Python 2.5 and earlier).
- Issue #9550: a BufferedReader could issue an additional read when the
original read request had been satisfied, which could block indefinitely
when the underlying raw IO channel was e.g. a socket. Report and original
patch by Jason V. Miller.
- Issue #9551: Don't raise TypeError when setting the value to None for
SafeConfigParser instances constructed with allow_no_value == True.
- Issue #6915: Under Windows, os.listdir() didn't release the Global
Interpreter Lock around all system calls. Original patch by Ryan Kelly.
- Issue #3757: thread-local objects now support cyclic garbage collection.
Thread-local objects involved in reference cycles will be deallocated
timely by the cyclic GC, even if the underlying thread is still running.
- Issue #6231: Fix xml.etree.ElementInclude to include the tail of the
current node.
- Issue #6869: Fix a refcount problem in the _ctypes extension.
- Issue5504 - ctypes should now work with systems where mmap can't be
PROT_WRITE and PROT_EXEC.
- Fix Issue8280 - urllib2's Request method will remove fragements in the url.
This is how it is supposed to work, wget and curl do the same. Previous
behavior was wrong.
- Issue #2944: asyncore doesn't handle connection refused correctly.
- Issue #3196: email header decoding is now forgiving if an RFC2047
encoded word encoded in base64 is lacking padding.
- Issue #9444: Argparse now uses the first element of prefix_chars as
the option character for the added 'h/help' option if prefix_chars
does not contain a '-', instead of raising an error.
- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
- Issue #9428: Fix running scripts with the profile/cProfile modules from
the command line.
- Issue #7781: Fix restricting stats by entry counts in the pstats
interactive browser.
interpreter by default.
- Issue #9324: Add parameter validation to signal.signal on Windows in order
to prevent crashes.
- Issue #9526: Remove some outdated (int) casts that were preventing
the array module from working correctly with arrays of more than
2**31 elements.
- Fix memory leak in ssl._ssl._test_decode_cert.
- Issue #8065: Fix memory leak in readline module (from failure to
free the result of history_get_history_state()).
- Issue #9450: Fix memory leak in readline.replace_history_item and
readline.remove_history_item for readline version >= 5.0.
- Issue #8105: Validate file descriptor passed to mmap.mmap on Windows.
- Issue #1019882: Fix IndexError when loading certain hotshot stats.
- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
compared to other unix systems. In particular, os.getgroups() does
not reflect any changes made using os.setgroups() but basicly always
returns the same information as the id command.
os.getgroups() can now return more than 16 groups on MacOSX.
- Issue #9277: Fix bug in struct.pack for bools in standard mode
(e.g., struct.pack('>?')): if conversion to bool raised an exception
then that exception wasn't properly propagated on machines where
char is unsigned.
- Issue #7567: Don't call `setupterm' twice.
Tools/Demos
----------- Issue #7287: Demo/imputil/knee.py was removed.
- Issue #9188: The gdb extension now handles correctly narrow (UCS2) as well
as wide (UCS4) unicode builds for both the host interpreter (embedded
inside gdb) and the interpreter under test.
Build
----- Issue #8852: Allow the socket module to build on OpenSolaris.
- Issue #10054: Some platforms provide uintptr_t in inttypes.h. Patch by
Akira Kitada.
- Issue #10055: Make json C89-compliant in UCS4 mode.
- Issue #1633863: Don't ignore $CC under AIX.
- Issue #9810: Compile bzip2 source files in python's project file
directly. It used to be built with bzip2's makefile.
- Issue #941346: Improve the build process under AIX and allow Python to
be built as a shared library. Patch by Sbastien Sabl.
- Issue #4026: Make the fcntl extension build under AIX. Patch by Sbastien
Sabl.
- Issue #3101: Helper functions _add_one_to_index_C() and
_add_one_to_index_F() become _Py_add_one_to_index_C() and
_Py_add_one_to_index_F(), respectively.
- Issue #9700: define HAVE_BROKEN_POSIX_SEMAPHORES under AIX 6.x. Patch by
Sbastien Sabl.
- Issue #9280: Make sharedinstall depend on sharedmods.
- Issue #9275: The OSX installer once again installs links to binaries in
``/usr/local/bin``.
- Issue #9392: A framework build on OSX will once again use a versioned name
of the ``2to3`` tool, that is you can use ``2to3-2.7`` to select the Python
2.7 edition of 2to3.
- Issue #9701: The MacOSX installer can patch the shell profile to ensure that
the "bin" directory inside the framework is on the shell's search path. This
feature now also supports the ZSH shell.
- Issue #7473: avoid link errors when building a framework with a different
set of architectures than the one that is currently installed.
Tests
----- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
in test_os)
- Issue #9894: Do not hardcode ENOENT in test_subprocess.
- Issue #9323: Make test.regrtest.__file__ absolute, this was not always the
case when running profile or trace, for example.
- Issue #9315: Added tests for the trace module. Patch by Eli Bendersky.
- Strengthen test_unicode with explicit type checking for assertEqual tests.
- Issue #8857: Provide a test case for socket.getaddrinfo.
- Issue #7564: Skip test_ioctl if another process is attached to /dev/tty.
- Issue #8433: Fix test_curses failure with newer versions of ncurses.
- Issue #9496: Provide a test suite for the rlcompleter module. Patch by
Michele Orr.
- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
- Issue #9568: Fix test_urllib2_localnet on OS X 10.3.
Documentation
-------------
- Issue #9817: Add expat COPYING file; add expat, libffi and expat licenses
to Doc/license.rst.
- Issue #9524: Document that two CTRL* signals are meant for use only
with os.kill.
- Issue #9255: Document that the 'test' package is for internal Python use
only.
- Issue #7829: Document in dis that bytecode is an implementation detail.
What's New in Python 2.7?
=========================
*Release date: 2010-07-03*
Core and Builtins
----------------- Prevent assignment to set literals.
Library
------- Issue #1868: Eliminate subtle timing issues in thread-local objects by
getting rid of the cached copy of thread-local attribute dictionary.
- Issue #9125: Add recognition of 'except ... as ...' syntax to parser module.
Extension Modules
----------------- Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
ensure that the input string length is a multiple of the frame size.
- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag
on an OpenSSL structure.
What's New in Python 2.7 release candidate 2?
=============================================
*Release date: 2010-06-20*
Core and Builtins
----------------- Issue #9058: Remove assertions about INT_MAX in UnicodeDecodeError.
- Issue #8202: Previous change to ``sys.argv[0]`` handling for -m command line
option reverted due to unintended side effects on handling of ``sys.path``.
See tracker issue for details.
- Issue #8941: decoding big endian UTF-32 data in UCS-2 builds could crash
the interpreter with characters outside the Basic Multilingual Plane
(higher than 0x10000).
- In the unicode/str.format(), raise a ValueError when indexes to arguments are
too large.
Build
----- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
Library
------- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
raises an exception.
- Issue #8959: fix regression caused by using unmodified libffi
library on Windows. ctypes does now again check the stack before
and after calling foreign functions.
- Issue #8720: fix regression caused by fix for #4050 by making getsourcefile
smart enough to find source files in the linecache.
- Issue #8986: math.erfc was incorrectly raising OverflowError for
values between -27.3 and -30.0 on some platforms.
- Issue #8924: logging: Improved error handling for Unicode in exception text.
- Issue #8948: cleanup functions and class / module setups and teardowns are
now honored in unittest debug methods.
Documentation
------------- Issues #8909: Added the size of the bitmap used in the installer created by
distutils' bdist_wininst. Patch by Anatoly Techtonik.
Misc
---- Issue #8362: Add maintainers.rst: list of module maintainers
What's New in Python 2.7 Release Candidate 1?
=============================================
*Release date: 2010-06-05*
Core and Builtins
----------------- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
start byte and the continuation byte(s) are now considered invalid, instead
of the number of bytes specified by the start byte.
E.g.: '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and
replaces with U+FFFD only the start byte ('\xf1') and the continuation byte
('\x80') even if '\xf1' is the start byte of a 4-bytes sequence.
Previous versions returned a single u'\ufffd'.
- Issue #8627: Remove bogus "Overriding __cmp__ blocks inheritance of
__hash__ in 3.x" warning. Also fix "XXX undetected error" that
arises from the "Overriding __eq__ blocks inheritance ..." warning
when turned into an exception: in this case the exception simply
gets ignored.
- Issue #8748: Fix two issues with comparisons between complex and integer
objects. (1) The comparison could incorrectly return True in some cases
(2**53+1 == complex(2**53) == 2**53), breaking transivity of equality.
(2) The comparison raised an OverflowError for large integers, leading
to unpredictable exceptions when combining integers and complex objects
in sets or dicts.
- Issue #5211: Implicit coercion for the complex type is now completely
removed. (Coercion for arithmetic operations was already removed in 2.7
alpha 4, but coercion for rich comparisons was accidentally left in.)
- Issue #3798: Write sys.exit() message to sys.stderr to use stderr encoding
and error handler, instead of writing to the C stderr file in utf-8
- Issue #7902: When using explicit relative import syntax, don't try implicit
relative import semantics.
- Issue #7079: Fix a possible crash when closing a file object while using it
from another thread. Patch by Daniel Stutzbach.
- Issue #8868: Fix that ensures that python scripts have access to the
Window Server again in a framework build on MacOSX 10.5 or earlier.
C-API
----- Issue #5753: A new C API function, :cfunc:`PySys_SetArgvEx`, allows embedders
of the interpreter to set sys.argv without also modifying sys.path. This
helps fix `CVE-2008-5983
<http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
Library
------- Issue #8302: SkipTest in unittest.TestCase.setUpClass or setUpModule is now
reported as a skip rather than an error.
- Issue #8351: Excessively large diffs due to
unittest.TestCase.assertSequenceEqual are no longer included in failure
reports.
- Issue #8899: time.struct_time now has class and atribute docstrings.
- Issue #4487: email now accepts as charset aliases all codec aliases
accepted by the codecs module.
- Issue #6470: Drop UNC prefix in FixTk.
- Issue #5610: feedparser no longer eats extra characters at the end of
a body part if the body part ends with a \r\n.
- Issue #8833: tarfile created hard link entries with a size field != 0 by
mistake.
- Issue #1368247: set_charset (and therefore MIMEText) now automatically
encodes a unicode _payload to the output_charset.
- Issue #7150: Raise OverflowError if the result of adding or subtracting
Build
----- Display installer warning that Windows 2000 won't be supported in future
releases.
- Issues #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
multiprocessing only.
Tools/Demos
----------- Issue #5464: Implement plural forms in msgfmt.py.
What's New in Python 2.7 beta 2?
================================
*Release date: 2010-05-08*
Core and Builtins
----------------- Run Clang 2.7's static analyzer for ``Objects/`` and ``Python/``.
- Issue #1533: Fix inconsistency in range function argument processing: any
non-float non-integer argument is now converted to an integer (if possible)
using its __int__ method. Previously, only small arguments were treated this
way; larger arguments (those whose __int__ was outside the range of a C long)
would produce a TypeError.
- Issue #8202: ``sys.argv[0]`` is now set to '-m' instead of '-c' when searching
for the module file to be executed with the -m command line option.
- Issue #7319: When -Q is used, do not silence DeprecationWarning.
- Issue #7332: Remove the 16KB stack-based buffer in
``PyMarshal_ReadLastObjectFromFile``, which doesn't bring any noticeable
benefit compared to the dynamic memory allocation fallback. Patch by
Charles-Franois Natali.
- Issue #8417: Raise an OverflowError when an integer larger than sys.maxsize is
passed to bytearray.
- Issue #7072: ``isspace(0xa0)`` is true on Mac OS X.
- Issue #8404: Fix set operations on dictionary views.
- Issue #8084: PEP 370 now conforms to system conventions for framework builds
on MacOS X. That is, ``python setup.py install --user`` will install into
``~/Library/Python/2.7`` instead of ``~/.local``.
Library
------- Issue #8681: Make the zlib module's error messages more informative when the
zlib itself doesn't give any detailed explanation.
- Issue #8571: Fix an internal error when compressing or decompressing a chunk
larger than 1GB with the zlib module's compressor and decompressor objects.
- Issue #8573: asyncore ``_strerror()`` function might throw ValueError.
- Issue #8483: asyncore.dispatcher's __getattr__ method produced confusing error
messages when accessing undefined class attributes because of the cheap
inheritance with the underlying socket object. The cheap inheritance has been
deprecated.
- Issue #4265: ``shutil.copyfile()`` was leaking file descriptors when disk
fills. Patch by Tres Seaver.
- Issue #7755: Use an unencumbered audio file for tests.
- Issue #8621: ``uuid.uuid4()`` returned the same sequence of values in the
parent and any children created using ``os.fork`` on Mac OS X 10.6.
- Issue #8313: ``traceback.format_exception_only()`` encodes unicode message to
ASCII with backslashreplace error handler if ``str(value)`` failed.
- Issue #8567: Fix precedence of signals in Decimal module: when a Decimal
operation raises multiple signals and more than one of those signals is
trapped, the specification determines the order in which the signals should be
handled. In many cases this order wasn't being followed, leading to the wrong
Python exception being raised.
- Issue #7865: The close() method of :mod:`io` objects should not swallow
exceptions raised by the implicit flush(). Also ensure that calling close()
several times is supported. Patch by Pascal Chambon.
- Issue #8576: logging updated to remove usage of find_unused_port().
- Issue #4687: Fix accuracy of garbage collection runtimes displayed with
gc.DEBUG_STATS.
- Issue #8354: The siginterrupt setting is now preserved for all signals, not
just SIGCHLD.
- Issue #7192: ``webbrowser.get("firefox")`` now works on Mac OS X, as does
``webbrowser.get("safari")``.
- Issue #8577: ``distutils.sysconfig.get_python_inc()`` now makes a difference
between the build dir and the source dir when looking for "python.h" or
"Include".
- Issue #8464: tarfile no longer creates files with execute permissions set when
mode="w|" is used.
- Issue #7834: Fix connect() of Bluetooth L2CAP sockets with recent versions of
the Linux kernel. Patch by Yaniv Aknin.
- Issue #6312: Fix http HEAD request when the transfer encoding is chunked. It
should correctly return an empty response now.
- Issue #7490: To facilitate sharing of doctests between 2.x and 3.x test
suites, the ``IGNORE_EXCEPTION_DETAIL`` directive now also ignores the module
location of the raised exception. Based on initial patch by Lennart Regebro.
- Issue #8086: In :func:`ssl.DER_cert_to_PEM_cert()`, fix missing newline before
the certificate footer. Patch by Kyle VanderBeek.
- Issue #7585: difflib context and unified diffs now place a tab between
filename and date, conforming to the 'standards' they were originally designed
to follow. This improves compatibility with patch tools.
- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
character sets will now consistently use a Content-Transfer-Encoding of 7bit
rather than sometimes being marked as 8bit.
- Issue #8330: Fix expected output in test_gdb.
- Issue #8374: Update the internal alias table in the :mod:`locale` module to
cover recent locale changes and additions.
Extension Modules
----------------- Issue #8644: Improved accuracy of ``timedelta.total_seconds()``.
- Use Clang 2.7's static analyzer to find places to clean up some code.
- Build the ossaudio extension on GNU/kFreeBSD.
- On Windows, ctypes does no longer check the stack before and after calling a
foreign function. This allows to use the unmodified libffi library.
Tests
----- Issue #8672: Add a zlib test ensuring that an incomplete stream can be handled
by a decompressor object without errors (it returns incomplete uncompressed
data).
- Issue #8490: asyncore now has a more solid test suite which actually tests its
API.
- Issue #8576: Remove use of find_unused_port() in test_smtplib and
test_multiprocessing. Patch by Paul Moore.
- Issue #7449: Fix many tests to support Python compiled without thread support.
Patches written by Jerry Seutter.
- Issue #8108: test_ftplib's non-blocking SSL server now has proper handling of
SSL shutdowns.
Build
----- Issue #8625: Turn off optimization in ``--with-pydebug`` builds with gcc.
(Optimization was unintentionally turned on in gcc --with-pydebug builds in
2.7 beta1 as a result of the issue #1628484 fix, combined with autoconf's
strange choice of default CFLAGS produced by AC_PROG_CC for gcc.)
- Issue #8509: Fix quoting in help strings and code snippets in configure.in.
- Issue #3646: It is now easily possible to install a Python framework into your
home directory on Mac OS X, see Mac/README for more information.
- Issue #8510: Update to autoconf 2.65.
Misc
---- Update the Vim syntax highlight file.
What's New in Python 2.7 beta 1?
================================
*Release date: 2010-04-10*
Core and Builtins
----------------- Issue #7301: Add environment variable $PYTHONWARNINGS.
- Issue #8329: Don't return the same lists from select.select when no fds are
changed.
- Issue #8259: ``1L << (2**31)`` no longer produces an 'outrageous shift error'
on 64-bit machines. The shift count for either left or right shift is
permitted to be up to sys.maxsize.
- Ensure that tokenization of identifiers is not affected by locale.
- Issue #1222585: Added LDCXXSHARED for C++ support. Patch by Arfrever.
- Raise a TypeError when trying to delete a T_STRING_INPLACE struct member.
- Issue #7994: Issue a PendingDeprecationWarning if object.__format__ is called
with a non-empty format string. This is an effort to future-proof user
code. If a derived class does not currently implement __format__ but later
adds its own __format__, it would most likely break user code that had
supplied a format string. This will be changed to a DeprecationWarning in
Python 3.3 and it will be an error in Python 3.4.
- Issue #8268: Old-style classes (not just instances) now support weak
references.
- Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, in case it
is set.
- Issue #1583863: An unicode subclass can now override the __unicode__ method
- Issue #6474: Make error message from passing an inadequate number of keyword
arguments to a function correct.
- Issue #8164: Don't allow lambda functions to have a docstring.
- Issue #3137: Don't ignore errors at startup, especially a keyboard interrupt
(SIGINT). If an error occurs while importing the site module, the error is
printed and Python exits. Initialize the GIL before importing the site
module.
- Code objects now support weak references.
Library
------- Issue #5277: Fix quote counting when parsing RFC 2231 encoded parameters.
- Issue #8321: Give access to OpenSSL version numbers from the `ssl` module,
using the new attributes `ssl.OPENSSL_VERSION`, `ssl.OPENSSL_VERSION_INFO` and
`ssl.OPENSSL_VERSION_NUMBER`.
- Issue #8310: Allow dis to examine new style classes.
- Issue #8257: The Decimal construct now accepts a float instance directly,
converting that float to a Decimal of equal value:
>>> Decimal(1.1)
Decimal('1.100000000000000088817841970012523233890533447265625')
- collections.Counter() now supports a subtract() method.
- The functools module now has a total_ordering() class decorator to simplify
the specification of rich comparisons.
- The functools module also adds cmp_to_key() as a tool to transition old-style
comparison functions to new-style key-functions.
- Issue #8294: The Fraction constructor now accepts Decimal and float instances
directly.
- Issue #7279: Comparisons involving a Decimal signaling NaN now signal
InvalidOperation instead of returning False. (Comparisons involving a quiet
NaN are unchanged.) Also, Decimal quiet NaNs are now hashable; Decimal
signaling NaNs remain unhashable.
- Issue #2531: Comparison operations between floats and Decimal instances now
return a result based on the numeric values of the operands; previously they
returned an arbitrary result based on the relative ordering of id(float) and
id(Decimal).
- Issue #8233: When run as a script, py_compile.py optionally takes a single
argument `-` which tells it to read files to compile from stdin. Each line is
read on demand and the named file is compiled immediately. (Original patch by
Piotr Oarowski).
- Issue #3135: Add ``inspect.getcallargs()``, which binds arguments to a
function like a normal call.
- Backwards incompatible change: Unicode codepoints line tabulation (0x0B) and
form feed (0x0C) are now considered linebreaks, as specified in Unicode
Standard Annex #14. See issue #7643. http://www.unicode.org/reports/tr14/
- Comparisons using one of <, <=, >, >= between a complex instance and a
Fractions instance now raise TypeError instead of returning True/False. This
makes Fraction <=> complex comparisons consistent with int <=> complex, float
<=> complex, and complex <=> complex comparisons.
- Addition of ``WeakSet`` to the ``weakref`` module.
- logging: Added LOG_FTP to SysLogHandler and updated documentation.
- Issue #8205: Remove the "Modules" directory from sys.path when Python is
running from the build directory (POSIX only).
- Issue #7667: Fix doctest failures with non-ASCII paths.
anymore. It also forwards the LDFLAGS settings to the linker when building a
shared library.
- Issue #6716: Quote -x arguments of compileall in MSI installer.
- Issue #7705: Fix linking on FreeBSD.
- Make sure that the FreeBSD build of the included libffi uses the proper
assembly file.
C-API
----- Issue #8276: PyEval_CallObject() is now only available in macro form. The
function declaration, which was kept for backwards compatibility reasons, is
now removed (the macro was introduced in 1997!).
- Issue #7992: A replacement PyCObject API, PyCapsule, has been backported from
Python 3.1. All existing Python CObjects in the main distribution have been
converted to capsules. To address backwards-compatibility concerns,
PyCObject_AsVoidPtr() was changed to understand capsules.
Tests
----- Issue #3864: Skip three test_signal tests on freebsd6 because they fail if any
thread was previously started, most likely due to a platform bug.
- Issue #8348: Fix test ftp url in test_urllib2net.
- Issue #8204: Fix test_ttk notebook test by forcing focus.
- Issue #8344: Fix test_ttk bug on FreeBSD.
- Issue #8193: Fix test_zlib failure with zlib 1.2.4.
- Issue #8248: Add some tests for the bool type. Patch by Gregory Nofi.
- Issue #8263: Now regrtest.py will report a failure if it receives a
KeyboardInterrupt (SIGINT).
- Issue #8180 and #8207: Fix test_pep277 on OS X and add more tests for special
Unicode normalization cases.
- Issue #7783: test.test_support.open_urlresource invalidates the outdated files
from the local cache.
What's New in Python 2.7 alpha 4?
=================================
*Release date: 2010-03-06*
Core and Builtins
----------------- Issue #7544: Preallocate thread memory before creating the thread to avoid a
fatal error in low memory condition.
- Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
check fails.
- Issue #7309: Fix unchecked attribute access when converting
UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings.
- Issue #7649: "u'%c' % char" now behaves like "u'%s' % char" and raises a
UnicodeDecodeError if 'char' is a byte string that can't be decoded using the
default encoding.
- Issue #6902: Fix problem with built-in types format incorrectly with 0
padding.
- Issue #2560: Remove an unnecessary 'for' loop from ``my_fgets()`` in
Parser/myreadline.c.
- Issue #7988: Fix default alignment to be right aligned for
``complex.__format__``. Now it matches other numeric types.
- Issue #5211: The complex type no longer uses implicit coercion in mixed-type
binary arithmetic operations.
Library
------- Issue #7904: Changes to urllib.parse.urlsplit to handle schemes as defined by
RFC3986. Anything before :// is considered a scheme and is followed by an
authority (or netloc) and by '/' led path, which is optional.
- Issue #1555570: email no longer inserts extra blank lines when a \r\n
combo crosses an 8192 byte boundary.
- Issue #6906: Tk should not set Unicode environment variables on Windows.
- Issue #1054943: Fix ``unicodedata.normalize('NFC', text)`` for the Public
Review Issue #29 (http://unicode.org/review/pr-29.html).
- Issue #7494: Fix a crash in ``_lsprof`` (cProfile) after clearing the profiler
,
reset also the pointer to the current pointer context.
- Issue #7232: Add support for the context manager protocol to the
``tarfile.TarFile`` class.
- Issue #7250: Fix info leak of os.environ across multi-run uses of
``wsgiref.handlers.CGIHandler``.
- Issue #1729305: Fix doctest to handle encode error with "backslashreplace".
- Issue #691291: ``codecs.open()`` should not convert end of lines on reading
and writing.
- Issue #7975: Correct regression in dict methods supported by bsddb.dbshelve.
- Issue #7959: ctypes callback functions are now registered correctly with the
cycle garbage collector.
- Issue #7970: ``email.Generator.flatten`` now correctly flattens
message/rfc822 messages parsed by ``email.Parser.HeaderParser``.
- Issue #3426: ``os.path.abspath`` now returns unicode when its arg is unicode.
- Issue #7633: In the decimal module, ``Context`` class methods (with the
exception of canonical and is_canonical) now accept instances of int and long
wherever a Decimal instance is accepted, and implicitly convert that argument
to Decimal. Previously only some arguments were converted.
- Issue #6003: Add an argument to ``zipfile.Zipfile.writestr`` to specify the
compression type.
- Issue #7893: ``unittest.TextTestResult`` is made public and a ``resultclass``
argument added to the TextTestRunner constructor allowing a different result
class to be used without having to subclass.
- Issue #7588: ``unittest.TextTestResult.getDescription`` now includes the test
name in failure reports even if the test has a docstring.
- Issue #5801: Remove spurious empty lines in wsgiref.
- Issue #1537721: Add a ``writeheader()`` method to ``csv.DictWriter``.
- Issue #7427: Improve the representation of httplib.BadStatusLine exceptions.
- Issue #7481: When a ``threading.Thread`` failed to start it would leave the
instance stuck in initial state and present in ``threading.enumerate()``.
- Issue #1068268: The subprocess module now handles EINTR in internal
``os.waitpid()`` and ``os.read()`` system calls where appropriate.
- Issue #6729: Add ``ctypes.c_ssize_t`` to represent ssize_t.
- Issue #6247: The argparse module has been added to the standard library.
Extension Modules
----------------- The sqlite3 module was updated to pysqlite 2.6.0. This fixes several obscure
bugs and allows loading SQLite extensions from shared libraries.
- Issue #7808: Fix reference leaks in _bsddb and related tests.
- Issue #6544: Fix a reference leak in the kqueue implementation's error
handling.
- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
msvcr100.dll is not a platform assembly anymore.
- Issue #7242: On Solaris 9 and earlier calling ``os.fork()`` from within a
thread could raise an incorrect RuntimeError about not holding the import
lock. The import lock is now reinitialized after fork.
- Issue #7999: ``os.setreuid()`` and ``os.setregid()`` would refuse to accept a
-1 parameter on some platforms such as OS X.
Tests
----- Issue #7849: The utility ``test.test_support.check_warnings()`` verifies if
warnings are effectively raised. A new utility ``check_py3k_warnings()`` is
available.
- Issue #7632: Fix various str -> float conversion bugs present in 2.7 alpha 2,
including:
(1) a serious 'wrong output' bug that could occur for long (> 40 digit) input
strings,
(2) a crash in dtoa.c that occurred in debug builds when parsing certain long
numeric strings corresponding to subnormal values,
(3) a memory leak for some values large enough to cause overflow, and
(4) a number of flaws that could lead to incorrectly rounded results.
- Issue #7319, #7770: Silence ``DeprecationWarning`` by default when the -3
option is not used.
- Issue #2335: Backport set literals syntax from Python 3.x.
- Issue #2333: Backport set and dict comprehensions syntax from Python 3.x.
- Issue #1967: Backport dictionary views from Python 3.x.
Library
------- Issue #9137: Fix issue in MutableMapping.update, which incorrectly
treated keyword arguments called 'self' or 'other' specially.
- Issue #7835: shelve should no longer produce mysterious warnings during
interpreter shutdown.
- Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">") in
XML processing instructions and comments. These raw characters are allowed
by the XML specification, and are necessary when outputting e.g. PHP code in
a processing instruction. Patch by Neil Muller.
- Issue #7869: logging: Improved diagnostic for format-time errors.
- Issue #7868: logging: Added loggerClass attribute to Manager.
- Issue #7851: logging: Clarification on logging configuration files.
- Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
specified, rather than fall through to AF_PACKET (in the ``socket`` module).
Also, raise ValueError rather than TypeError when an unknown TIPC address
type is specified. Patch by Brian Curtin.
- logging: Implemented PEP 391.
- Issue #6939: Fix file I/O objects in the `io` module to keep the original
file position when calling `truncate()`. It would previously change the file
position to the given argument, which goes against the tradition of
ftruncate() and other truncation APIs. Patch by Pascal Chambon.
- Issue #7610: Reworked implementation of the internal ``zipfile.ZipExtFile``
class used to represent files stored inside an archive. The new
implementation is significantly faster and can be wrapped in a
``io.BufferedReader`` object for more speedups. It also solves an issue
where interleaved calls to ``read()`` and ``readline()`` give wrong results.
Patch by Nir Aides.
- Issue #7792: Registering non-classes to ABCs raised an obscure error.
- Issue #6834: Replace the implementation for the 'python' and 'pythonw'
executables on OSX.
These executables now work properly with the arch(1) command: ``arch -ppc
python`` will start a universal binary version of python in PPC mode (unlike
previous releases).
- Issue #1680159: Unicode coercion during an 'in' operation no longer masks the
underlying error when the coercion fails for the left hand operand.
- Issue #7491: Metaclass's __cmp__ method was ignored.
- Issue #7466: Segmentation fault when the garbage collector is called in the
middle of populating a tuple. Patch by Florent Xicluna.
Library
------- Issue #6963: Added "maxtasksperchild" argument to ``multiprocessing.Pool``,
allowing for a maximum number of tasks within the pool to be completed by the
worker before that worker is terminated, and a new one created to replace it.
- Issue #7617: Make sure distutils.unixccompiler.UnixCCompiler recognizes gcc
when it has a fully qualified configuration prefix. Initial patch by
Arfrever.
- Issue #7092: Remove py3k warning when importing cPickle. 2to3 handles
renaming of `cPickle` to `pickle`. The warning was annoying since there's no
alternative to cPickle if you care about performance. Patch by Florent
Xicluna.
- Issue #7455: Fix possible crash in cPickle on invalid input. Patch by Victor
Stinner.
- Issue #7092: Fix the DeprecationWarnings emitted by the standard library when
using the -3 flag. Patch by Florent Xicluna.
- Issue #7471: Improve the performance of GzipFile's buffering mechanism, and
make it implement the ``io.BufferedIOBase`` ABC to allow for further speedups
by wrapping it in an ``io.BufferedReader``. Patch by Nir Aides.
- Issue #3972: ``httplib.HTTPConnection`` now accepts an optional source_address
parameter to allow specifying where your connections come from.
- ``socket.create_connection()`` now accepts an optional source_address
parameter.
- Issue #5511: ``zipfile.ZipFile`` can now be used as a context manager.
Initial patch by Brian Curtin.
- Distutils now correctly identifies the build architecture as "x86_64" when
building on OSX 10.6 without "-arch" flags.
- Issue #7556: Distutils' msvc9compiler now opens the MSVC Manifest file in text
mode.
- Issue #7552: Removed line feed in the base64 Authorization header in the
Distutils upload command to avoid an error when PyPI reads it. This occurs on
long passwords. Initial patch by JP St. Pierre.
- Issue #7231: urllib2 cannot handle https with proxy requiring auth. Patch by
Tatsuhiro Tsujikawa.
- Issue #7349: Make methods of file objects in the io module accept None as an
argument where file-like objects (ie StringIO and BytesIO) accept them to mean
the same as passing no argument.
- Issue #7348: ``StringIO.StringIO.readline(-1)`` now acts as if it got no
argument like other file objects.
- Issue #7357: tarfile no longer suppresses fatal extraction errors by default.
- Issue #7470: logging: Fix bug in Unicode encoding fallback.
- Issue #5949: Fixed IMAP4_SSL hang when the IMAP server response is missing
proper end-of-line termination.
- Issue #7457: Added a read_pkg_file method to
``distutils.dist.DistributionMetadata``.
- Issue #3745: Undo the 2.7a1 change to have hashlib to reject unicode and non
buffer API supporting objects as input. That behavior is for 3.x only.
C-API
----- Issue #7767: New function ``PyLong_AsLongLongAndOverflow()`` added, analogous
to ``PyLong_AsLongAndOverflow()``.
- Issue #5080: The argument parsing functions ``PyArg_ParseTuple()``,
``PyArg_ParseTupleAndKeywords()``, ``PyArg_VaParse()``,
``PyArg_VaParseTupleAndKeywords()`` and ``PyArg_Parse()`` no longer accept
float arguments for integer format codes (other than 'L'): previously an
attempt to pass a float resulted in a DeprecationWarning; now it gives a
TypeError. For the 'L' format code (which previously had no warning) there is
now a DeprecationWarning.
- Issue #7033: Function ``PyErr_NewExceptionWithDoc()`` added.
Build
----- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
- Issue #6943: Use pkg-config to find the libffi headers when the
``--with-system-ffi`` flag is used.
- Issue #7609: Add a ``--with-system-expat`` option that causes the system's
expat library to be used for the pyexpat module instead of the one included
with Python.
- Issue #7589: Only build the nis module when the correct header files are
found.
- Switch to OpenSSL 0.9.8l and sqlite 3.6.21 on Windows.
- Issue #7541: when using ``python-config`` with a framework install the
compiler might use the wrong library.
Tests
----- Issue #7376: Instead of running a self-test (which was failing) when called
with no arguments, doctest.py now gives a usage message.
- Issue #7396: Fix regrtest -s, which was broken by the -j enhancement.
- Issue #7498: test_multiprocessing now uses test_support.find_unused_port
instead of a hardcoded port number in test_rapid_restart.
What's New in Python 2.7 alpha 1
================================
*Release date: 2009-12-05*
Core and Builtins
----------------- Issue #7419: ``locale.setlocale()`` could crash the interpreter on Windows
when called with invalid values.
- Issue #3382: 'F' formatting for float and complex now convert the result to
upper case. This only affects 'inf' and 'nan', since 'f' no longer converts
to 'g' for large values.
- Remove switch from "%f" formatting to "%g" formatting for floats larger than
1e50 in absolute value.
- Remove restrictions on precision when formatting floats. E.g., "%.120g" %
1e-100 used to raise OverflowError, but now gives the requested 120
significant digits instead.
- Add Py3k warnings for parameter names in parentheses.
- Issue #7362: Give a proper error message for ``def f((x)=3): pass``.
- Issue #7085: Fix crash when importing some extensions in a thread on MacOSX
10.6.
- Issue #7117: ``repr(x)`` for a float x returns a result based on the shortest
decimal string that's guaranteed to round back to x under correct rounding
(with round-half-to-even rounding mode). Previously it gave a string based on
rounding x to 17 decimal digits. repr(x) for a complex number behaves
similarly. On platforms where the correctly-rounded strtod and dtoa code is
not supported (see below), repr is unchanged.
- Issue #7117: On almost all platforms: float-to-string and string-to-float
conversions within Python are now correctly rounded. Places these conversions
occur include: str for floats and complex numbers; the float and complex
constructors; old-style and new-style numeric formatting; serialization and
deserialization of floats and complex numbers using marshal, pickle and json;
parsing of float and imaginary literals in Python code; Decimal-to-float
conversion.
The conversions use a Python-adapted version of David Gay's well-known dtoa.c,
providing correctly-rounded strtod and dtoa C functions. This code is
supported on Windows, and on Unix-like platforms using gcc, icc or suncc as
the C compiler. There may be a small number of platforms on which correct
operation of this code cannot be guaranteed, so the code is not used: notably,
this applies to platforms where the C double format is not IEEE 754 binary64,
and to platforms on x86 hardware where the x87 FPU is set to 64-bit precision
and Python's configure script is unable to determine how to change the FPU
precision. On these platforms conversions use the platform strtod and dtoa,
as before.
- Issue #7117: Backport round implementation from Python 3.x. ``round()`` now
uses the correctly-rounded string <-> float conversions described above (when
available), and so produces correctly rounded results that will display nicely
under the float repr. There are two related small changes: (1) round now
accepts any class with an ``__index__()`` method for its second argument (but
no longer accepts floats for the second argument), and (2) an excessively
large second integer argument (e.g., ``round(1.234, 10**100)``) no longer
raises an exception.
- Issue #1757126: Fix the cyrillic-asian alias for the ptcp154 encoding.
- Fix several issues with ``compile()``. The input can now contain Windows and
Mac newlines and is no longer required to end in a newline.
- Remove length limitation when constructing a complex number from a unicode
string.
- Issue #7244: ``itertools.izip_longest()`` no longer ignores exceptions raised
during the formation of an output tuple.
- Issue #1087418: Boost performance of bitwise operations for longs.
- Issue #1722344: ``threading._shutdown()`` is now called in ``Py_Finalize()``,
which fixes the problem of some exceptions being thrown at shutdown when the
interpreter is killed. Patch by Adam Olsen.
- Issue #7168: Document ``PyFloat_AsString()`` and ``PyFloat_AsReprString()``,
and note that they are unsafe and deprecated.
- Issue #7120: logging: Remove import of multiprocessing which is causing crash
in GAE.
- Issue #7140: The ``__dict__`` of a module should not be cleared unless the
module is the only object holding a reference to it.
- Issue #1754094: Improve the stack depth calculation in the compiler. There
should be no other effect than a small decrease in memory use. Patch by
Christopher Tur Lesniewski-Laas.
- Issue #7084: Fix a (very unlikely) crash when printing a list from one thread,
and mutating it from another one. Patch by Scott Dial.
- Issue #1571184: The Unicode database contains properties for more characters.
The tables for code points representing numeric values, white spaces or line
breaks are now generated from the official Unicode Character Database files,
and include information from the Unihan.txt file.
- Issue #7050: Fix a SystemError when trying to use unpacking and augmented
assignment.
- Issue #5329: Fix ``os.popen*`` regression from 2.5 with commands as a sequence
running through the shell. Patch by Jean-Paul Calderone and Jani Hakala.
- Issue #7019: Raise ValueError when unmarshalling bad long data, instead of
- Issue #4258: Make it possible to use base 2**30 instead of base 2**15 for the
internal representation of integers, for performance reasons. Base 2**30 is
enabled by default on 64-bit machines. Add --enable-big-digits option to
configure, which overrides the default. Add sys.long_info structseq to
provide information about the internal format.
- Issue #4034: Fix weird attribute error messages of the traceback object. (As a
result traceback.__members__ no longer exists.)
- Issue #4474: PyUnicode_FromWideChar now converts characters outside the BMP to
surrogate pairs, on systems with sizeof(wchar_t) == 4 and sizeof(Py_UNICODE)
== 2.
- Issue #5237: Allow auto-numbered fields in str.format(). For example: ``'{}
{}'.format(1, 2) == '1 2'``.
- Issue #3652: Make the 'line' argument for ``warnings.showwarning()`` a
requirement. Means the DeprecationWarning from Python 2.6 can go away.
- Issue #5247: Improve error message when unknown format codes are used when
using ``str.format()`` with str, unicode, long, int, and float arguments.
- Running Python with the -3 option now also warns about classic division for
ints and longs.
- Issue #5260: Long integers now consume less memory: average saving is 2 bytes
per long on a 32-bit system and 6 bytes per long on a 64-bit system.
- Issue #5186: Reduce hash collisions for objects with no __hash__ method by
rotating the object pointer by 4 bits to the right.
- Issue #4575: Fix Py_IS_INFINITY macro to work correctly on x87 FPUs: it now
forces its argument to double before testing for infinity.
- Issue #4978: Passing keyword arguments as unicode strings is now allowed.
- Issue #1242657: the __len__() and __length_hint__() calls in several tools
were suppressing all exceptions. These include list(), filter(), map(),
zip(), and bytearray().
- os.ftruncate raises OSErrors instead of IOErrors for consistency with other os
functions.
- Issue #4991: Passing invalid file descriptors to io.FileIO now raises an
OSError.
- Issue #4807: Port the _winreg module to Windows CE.
- Issue #4935: The overflow checking code in the expandtabs() method common to
str, bytes and bytearray could be optimized away by the compiler, letting the
interpreter segfault instead of raising an error.
- Issue #3720: Fix a crash when an iterator modifies its class and removes its
__next__ method.
- Issue #4893: Use NT threading on CE.
- Issue #4915: Port sysmodule to Windows CE.
- Issue #4074: Change the criteria for doing a full garbage collection (i.e.
- Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...) does now
always result in NULL.
- Issue #5042: ctypes Structure sub-subclass does now initialize correctly with
base class positional arguments.
- Issue #6938: Fix a TypeError in string formatting of a multiprocessing debug
message.
- Issue #6635: Fix profiler printing usage message.
- Issue #6856: Add a filter keyword argument to TarFile.add().
- Issue #6163: Fixed HP-UX runtime library dir options in
distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and Michael
Haubenwallner.
- Issue #6857: Default format() alignment should be '>' for Decimal instances.
- Issue #6795: int(Decimal('nan')) now raises ValueError instead of returning
NaN or raising InvalidContext. Also, fix infinite recursion in
long(Decimal('nan')).
- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no
type specifier.
- Issue #4937: plat-mac/bundlebuilder refers to non-existing version.plist.
- Issue #6838: Use a list to accumulate the value instead of repeatedly
concatenating strings in httplib's HTTPResponse._read_chunked providing a
significant speed increase when downloading large files servend with a
Transfer-Encoding of 'chunked'.
- Issue #5275: In Cookie's Cookie.load(), properly handle non-string arguments
as documented.
- Issue #2666: Handle BROWSER environment variable properly for unknown browser
names in the webbrowser module.
- Issue #6054: Do not normalize stored pathnames in tarfile.
- Issue #6794: Fix Decimal.compare_total and Decimal.compare_total_mag: NaN
payloads are now ordered by integer value rather than lexicographically.
- Issue #6693: New functions in site.py to get user/global site packages paths.
- The thread.lock type now supports weak references.
- Issue #1356969: Add missing info methods in Tix.HList.
- Issue #1522587: New constants and methods for the Tix.Grid widget.
- Issue #1250469: Fix the return value of Tix.PanedWindow.panes.
- Issue #1119673: Do not override Tkinter.Text methods when creating a
ScrolledText.
- Issue #6665: Fix fnmatch to properly match filenames with newlines in them.
- Issue #1135: Add the XView and YView mix-ins to avoid duplicating the xview*
- Issue #5311: bdist_msi can now build packages that do not depend on a specific
Python version.
- Issue #1309352: fcntl now converts its third arguments to a C `long` rather
than an int, which makes some operations possible under 64-bit Linux (e.g.
DN_MULTISHOT with F_NOTIFY).
- Issue #1424152: Fix for httplib, urllib2 to support SSL while working through
proxy. Original patch by Christopher Li, changes made by Senthil Kumaran.
- Issue #1983: Fix functions taking or returning a process identifier to use the
dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have a
process identifier type wider than the standard C integer type.
- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket.
Patch by Farhan Ahmad, test by Marcin Bachry.
- Issue #6062: In distutils, fixed the package option of build_ext. Feedback
and tests on pywin32 by Tim Golden.
- Issue #6053: Fixed distutils tests on win32. Patch by Hirokazu Yamamoto.
- Issue #6046: Fixed the library extension when distutils build_ext is used in
place. Initial patch by Roumen Petrov.
- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a
subcommand.
- Issue #2116: Weak references and weak dictionaries now support copy()ing and
deepcopy()ing.
- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr.
- Issue #5918: Fix a crash in the parser module.
- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr.
- Issue #6022: A test file was created in the current working directory by
test_get_outputs in Distutils.
- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source'
file is a binary. Patch by Brodie Rao, tests by Daniel Diniz.
- Issue #5977: distutils build_ext.get_outputs was not taking into account the
inplace option. Initial patch by kxroberto.
- Issue #5984: distutils.command.build_ext.check_extensions_list checks were
broken for old-style extensions.
- Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when
trying to print a traceback.
- Issue #5976: Fixed Distutils test_check_environ.
- Issue #5900: Ensure RUNPATH is added to extension modules with RPATH if GNU ld
is used. Original patch by Floris Bruynooghe.
- Issue #5941: Distutils build_clib command was not working anymore because of
an incomplete costumization of the archiver command. Added ARFLAGS in the
Makefile besides AR and make Distutils use it. Original patch by David
Cournapeau.
- Issue #5955: aifc's close method did not close the file it wrapped, now it
does. This also means getfp method now returns the real fp.
- Issue #4875: On win32, ctypes.util.find_library does no longer return
directories.
- Issue #5142: Add the ability to skip modules while stepping to pdb.
- Issue #1309567: Fix linecache behavior of stripping subdirectories when
looking for files given by a relative filename.
- Issue #5692: In ``zipfile.Zipfile``, fix wrong path calculation when
extracting a file to the root directory.
- Issue #5913: ``os.listdir()`` should fail for empty path on windows.
- Issue #5084: Unpickling now interns the attribute names of pickled objects,
saving memory and avoiding growth in size of subsequent pickles. Proposal and
original patch by Jake McGuire.
- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an
error when a named pipe is encountered, rather than blocking infinitely.
- Issue #3959: The ipaddr module has been added to the standard library.
Contributed by Google.
- Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive anymore.
- Issue #4305: ctypes should now build again on mipsel-linux-gnu
- Issue #1734234: Massively speedup ``unicodedata.normalize()`` when the string
is already in normalized form, by performing a quick check beforehand.
Original patch by Rauli Ruohonen.
- Issue #5853: Calling a function of the mimetypes module from several threads
at once could hit the recursion limit if the mimetypes database hadn't been
initialized before.
- Issue #5854: Updated __all__ to include some missing names and remove some
names which should not be exported.
- Issue #5810: Fixed Distutils test_build_scripts so it uses
``sysconfig.get_config_vars()``.
- Issue #4951: Fixed failure in test_httpservers.
- Issue #3102: All global symbols that the _ctypes extension defines are now
prefixed with 'Py' or '_ctypes'.
- Issue #5041: ctypes does now allow pickling wide character.
- Issue #5812: For the two-argument form of the Fraction constructor,
``Fraction(m, n)``, m and n are permitted to be arbitrary Rational instances.
- Issue #5812: Fraction('1e6') is valid: more generally, any string that's valid
for float() is now valid for Fraction(), with the exception of strings
representing NaNs and infinities.
- Issue #5795: Fixed test_distutils failure on Debian ppc.
- Issue #5768: Fixed bug in Unicode output logic and test case for same.
- Issue #1161031: Fix readwrite select flag handling: POLLPRI now results in a
handle_expt_event call, not handle_read_event, and POLLERR and POLLNVAL now
call handle_close, not handle_expt_event. Also, dispatcher now has an
'ignore_log_types' attribute for suppressing log messages, which is set to
'warning' by default.
- Issue #5607: Fixed Distutils test_get_platform for Mac OS X fat binaries.
- Issue #5741: Don't disallow "%%" (which is an escape for "%") when setting a
value in SafeConfigParser.
- Issue #5732: Added a new command in Distutils: check.
- Issue #5731: Distutils bdist_wininst no longer worked on non-Windows
platforms. Initial patch by Paul Moore.
- Issue #2254: Fix CGIHTTPServer information disclosure. Relative paths are now
collapsed within the url properly before looking in cgi_directories.
- Issue #5095: Added bdist_msi to the list of bdist supported formats. Initial
fix by Steven Bethard.
- Issue #1491431: Fixed distutils.filelist.glob_to_re for edge cases. Initial
fix by Wayne Davison.
- Issue #5693: TestSuite.__iter__ can now be consistently overridden in
subclasses.
- Issue #5694: Removed spurious test output in Distutils (test_clean).
- Issue #5471: Fix os.path.expanduser() for $HOME set to '/'.
- Issue #1326077: Fix the formatting of SyntaxErrors by the traceback module.
- Issue #1726172: Fix IndexError in the case of and empty response in ftplib.
- Issue #2625: Added missing iteritems() call to the for loop in
mailbox.MH.get_message().
- Issue #5585: Add the ability to call an initializer to
mulitiprocessing.manager so that users can install custom handlers/etc.
- Issue #3551: Patch multiprocessing to raise a proper exception if the size of
the object when writefile is called causes a ERROR_NO_SYSTEM_RESOURCES. Added
docs to note the limitation.
- unittest.assertNotEqual() now uses the inequality operator (!=) instead of the
equality operator.
- Issue #6001: Test discovery for unittest. Implemented in
unittest.TestLoader.discover and from the command line.
- Issue #5679: The methods unittest.TestCase.addCleanup and doCleanups were
added. addCleanup allows you to add cleanup functions that will be called
unconditionally (after setUp if setUp fails, otherwise after tearDown). This
allows for much simpler resource allocation and deallocation during tests.
- Issue #3379: unittest.main now takes an optional exit argument. If False main
doesn't call sys.exit allowing it to be used from the interactive interpreter.
- Issue #5995: unittest.main now takes an optional verbosity argument allowing
test modules to be run with a higher than default verbosity.
- Issue #5995: A fix to allow you to run "python -m unittest test_module" or
"python -m unittest test_module.TestClass" from the command line.
- Issue #5728: unittest.TestResult has new startTestRun and stopTestRun methods;
called immediately before and after a test run.
- Issue #5663: Better failure messages for unittest asserts. Default assertTrue
and assertFalse messages are now useful. TestCase has a longMessage attribute.
This defaults to False, but if set to True useful error messages are shown in
addition to explicit messages passed to assert methods.
- Issue #3110: Add additional protect around SEM_VALUE_MAX for multiprocessing.
- In Pdb, prevent the reassignment of __builtin__._ by sys.displayhook on
printing out values.
- Issue #4572: Added SEEK_* symbolic constants to io module.
- Issue #1665206 (partially): Move imports in cgitb to the top of the module
instead of performing them in functions. Helps prevent import deadlocking in
threads.
- Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
- Actually make the SimpleXMLRPCServer CGI handler work.
- Issue #2522: locale.format() now checks its first argument to ensure it has
been passed only one pattern, avoiding mysterious errors where it appeared
that it was failing to do localization.
- Issue #5583: Added optional extensions in Distutils. Initial patch by Georg
Brandl.
- Issue #5619: Multiprocessing children disobey the debug flag and causes popups
on windows buildbots. Patch applied to work around this issue.
- Issue #5632: Thread.ident was None for the main thread and threads not created
with the threading module.
- Issue #5400: Added patch for multiprocessing on netbsd compilation/support.
- Issue #5387: Fixed mmap.move crash by integer overflow.
- Issue #5261: Patch multiprocessing's semaphore.c to support context manager
use: "with multiprocessing.Lock()" works now.
- Issue #5177: Multiprocessing's SocketListener class now uses
socket.SO_REUSEADDR on all connections so that the user no longer needs to
wait 120 seconds for the socket to expire.
to be recreated. This avoids a timing hole thanks to the old reliance on the
ctime of the files involved.
- Issue #5122: Synchronize tk load failure check to prevent a potential
deadlock.
- Issue #1818: collections.namedtuple() now supports a keyword argument 'rename'
which lets invalid fieldnames be automatically converted to positional names
in the form, _1, _2, ...
- Issue #4890: Handle empty text search pattern in Tkinter.Text.search.
- Issue #5170: Fixed Unicode output bug in logging and added test case. This is
a regression which did not occur in 2.5.
- Issue #4512 (part 2): Promote ``ZipImporter._get_filename()`` to be a public
documented method ``ZipImporter.get_filename()``.
- Issue #4195: The ``runpy`` module (and the ``-m`` switch) now support the
execution of packages by looking for and executing a ``__main__`` submodule
when a package name is supplied. Initial patch by Andi Vajda.
- Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will not be
used again (this requires Tcl/Tk 8.3.1), also fix a memory leak in Tkapp_Call
when calling from a thread different than the one that created the Tcl
interpreter. Patch by Robert Hancock.
- Issue #1520877: Now distutils.sysconfig reads $AR from the
environment/Makefile. Patch by Douglas Greiman.
- Issue #4285: Change sys.version_info to be a named tuple. Patch by Ross
Light.
- Issue #1276768: The verbose option was not used in the code of
distutils.file_util and distutils.dir_util.
- Issue #5132: Fixed trouble building extensions under Solaris with
--enabled-shared activated. Initial patch by Dave Peterson.
- Issue #1581476: Always use the Tcl global namespace when calling into Tcl.
- Issue #2047: shutil.move() could believe that its destination path was inside
its source path if it began with the same letters (e.g. "src" vs. "src.new").
- Issue #4920: Fixed .next() vs .__next__() issues in the ABCs for Iterator and
MutableSet.
- Added the ttk module. See issue #2983: Ttk support for Tkinter.
- Issue #5021: doctest.testfile() did not create __name__ and
collections.namedtuple() relied on __name__ being defined.
- Backport importlib from Python 3.1. Only the import_module() function has been
backported to help facilitate transitions from 2.7 to 3.1.
- Issue #1885: distutils: When running sdist with --formats=tar,gztar the tar
file was overriden by the gztar one.
- Issue #4863: distutils.mwerkscompiler has been removed.
- Issue #1702551: distutils sdist was not excluding VCS directories under
Windows. Initial solution by Guy Dalberto.
- The _tkinter module functions "createfilehandler", "deletefilehandler",
"createtimerhandler", "mainloop", "dooneevent" and "quit" have been deprecated
for removal in 3.x
- Issue #4796: Added Decimal.from_float() and
Context.create_decimal_from_float() to the decimal module.
- Issue #4812: Add missing underscore prefix to some internal-use-only constants
in the decimal module. (Dec_0 becomes _Dec_0, etc.)
- Issue #4795: inspect.isgeneratorfunction() returns False instead of None when
the function is not a generator.
- Issue #4702: Throwing a DistutilsPlatformError instead of IOError in case no
MSVC compiler is found under Windows. Original patch by Philip Jenvey.
- Issue #4646: distutils was choking on empty options arg in the setup function.
Original patch by Thomas Heller.
- Fractions.from_float() no longer loses precision for integers too big to cast
as floats.
- Issue #4790: The nsmallest() and nlargest() functions in the heapq module did
unnecessary work in the common case where no key function was specified.
- Issue #3767: Convert Tk object to string in tkColorChooser.
- Issue #3248: Allow placing ScrolledText in a PanedWindow.
- Issue #4444: Allow assertRaises() to be used as a context handler, so that the
code under test can be written inline if more practical.
- Issue #4739: Add pydoc help topics for symbols, so that e.g. help('@') works
as expected in the interactive environment.
- Issue #4756: zipfile.is_zipfile() now supports file-like objects. Patch by
Gabriel Genellina.
- Issue #4400: .pypirc default generated file was broken in distutils.
- Issue #4736: io.BufferedRWPair's closed property now functions properly.
- Issue #3954: Fix a potential SystemError in _hotshot.logreader error handling.
- Issue #4574: Fix a crash in io.IncrementalNewlineDecoder when a carriage
return encodes to more than one byte in the source encoding (e.g. UTF-16) and
gets split on a chunk boundary.
- Issue #4223: inspect.getsource() will now correctly display source code for
packages loaded via zipimport (or any other conformant PEP 302
loader). Original patch by Alexander Belopolsky.
- Issue #4201: pdb can now access and display source code loaded via zipimport
(or any other conformant PEP 302 loader). Original patch by Alexander
Belopolsky.
- Issue #4197: Doctests in modules loaded via zipimport (or any other PEP 302
conformant loader) will now work correctly in most cases (they are still
subject to the constraints that exist for all code running from inside a
module loaded via a PEP 302 loader and attempting to perform IO operations
based on __file__). Original patch by Alexander Belopolsky.
- Issues #4082 and #4512: Add runpy support to zipimport in a manner that allows
backporting to maintenance branches. Original patch by Alexander Belopolsky.
- Issue #4163: Use unicode-friendly word splitting in the textwrap functions
when given a Unicode string.
- Issue #4616: TarFile.utime(): Restore directory times on Windows.
- 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 #1030250: Distutils created directories even when run with the --dry-run
option.
- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat libs.
- Issue #4529: Fix the parser module's validation of try-except-finally
statements.
- Issue #4458: getopt.gnu_getopt() now recognizes a single "-" as an argument,
not a malformed option.
- Added the subprocess.check_output() convenience function to get output from a
subprocess on success or raise an exception on error.
- Issue #1055234: cgi.parse_header(): Fixed parsing of header parameters to
support unusual filenames (such as those containing semi-colons) in
Content-Disposition headers.
- Issue #4384: Added logging integration with warnings module using
captureWarnings(). This change includes a NullHandler which does nothing; it
will be of use to library developers who want to avoid the "No handlers could
be found for logger XXX" message which can appear if the library user doesn't
configure logging.
- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
exception.
- Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if the
ctypes module is not present.
- FileIO's mode attribute now always includes ``"b"``.
- Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__.
- httplib.HTTPConnection.putheader() now accepts an arbitrary number of values
for any header, matching what the documentation has claimed for a while.
- Issue #3774: Fixed an error when create a Tkinter menu item without command
and then remove it.
- Fixed a modulefinder crash on certain relative imports.
- Issue #4150: Pdb's "up" command now works for generator frames in post-mortem
debugging.
- Issue #4092: Return ArgInfo as promised in the documentation from
inspect.getargvalues.
- Issue #3935: Properly support list subclasses in bisect's C implementation.
- Issue #4014: Don't claim that Python has an Alpha release status, in addition
to claiming it is Mature.
- Issue #4730: Fixed the cPickle module to handle correctly astral characters
when protocol 0 is used.
- Issue #1594: MacOS.GetCreatorAndType now always returns a big-endian result,
to be consistent with Apple tools.
- Issue #900949: plat-mac/videoreader.py no longer relies on a non-existing
module.
- Issue #16278952: plat-mac/videoreader.py now correctly imports MediaDescr
- Issue #1737832: plat-mac/EasyDialog.py no longer uses the broken aepack
module.
- Issue #1149804: macostools.mkdirs now even works when another process creates
one of the needed subdirectories.
- Issue #900506: added --no-zipimport flag to the bundlebuilder script.
- Issue #841800: bundlebuilder now works with 'python -O'.
- Issue #4861: ctypes.util.find_library(): Robustify. Fix library detection on
biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
- Issue #5104: The socket module now raises OverflowError when 16-bit port and
protocol numbers are supplied outside the allowed 0-65536 range on bind() and
getservbyport().
- Issue #999042: The Python compiler now handles explict global statements
correctly (should be assigned using STORE_GLOBAL opcode).
- Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for new
arguments introduced in 2.5.
- Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
makeunicodedata.py and regenerated the Unicode database (This fixes
u'\u1d79'.lower() == '\x00').
- Windows locale mapping updated to Vista.
IDLE
---- Issue #5150: IDLE's format menu now has an option to strip trailing
whitespace.
- Issue #5847: Remove -n switch on "Edit with IDLE" menu item.
Tools/Demos
-----------
------- Issue #3640: Pickling a list or a dict uses less local variables, to reduce
stack usage in the case of deeply nested objects.
- Issue #3629: Fix sre "bytecode" validator for an end case.
- Issue #3811: The Unicode database was updated to 5.1.
- Issue #3781: Further warnings.catch_warnings() cleanup to prevent
silent misbehaviour when a single instance is nested in multiple
with statements, or when the methods are invoked in the wrong order.
- Issue #3809: Fixed spurious 'test.blah' file left behind by test_logging.
- Issue #3781: Clean up the API for warnings.catch_warnings() by having it
return a list or None rather than a custom object.
- Issue #1638033: Cookie.Morsel gained the httponly attribute.
- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
- Issue #3776: Deprecate the bsddb package for removal in 3.0.
- Issue #3762: platform.architecture() fails if python is lanched via
its symbolic link.
- Issue #3772: Fixed regression problem in StreamHandler.emit().
- Issue #600362: Relocated parse_qs() and parse_qsl(), from the cgi module
to the urlparse one. Added a PendingDeprecationWarning in the old
module, it will be deprecated in the future.
- Issue #2562: Fix distutils PKG-INFO writing logic to allow having
non-ascii characters and Unicode in setup.py meta-data.
- Issue #3726: Allow spaces in separators in logging configuration files.
- Issue #3719: platform.architecture() fails if there are spaces in the
path to the Python binary.
- Issue #3602: Moved test.test_support.catch_warning() to
warnings.catch_warnings() along with some API cleanup. Expanding the tests
for catch_warnings() also led to an improvement in the raising of a
DeprecationWarning related to warnings.warn_explicit().
- The deprecation warnings for the old camelCase threading API were removed.
- logging: fixed lack of use of encoding attribute specified on a stream.
- Silenced a trivial compiler warning in the sqlite module.
- Fixed two format strings in the _collections module.
- Issue #3703: _fileio.FileIO gave unhelpful error message when trying to open a
directory.
- Issue #3708: os.urandom no longer goes into an infinite loop when passed a
non-integer floating point number.
- Issue #2885 (partial): The urllib.urlopen() function has been deprecated for
removal in Python 3.0 in favor of urllib2.urlopen().
- Issue #2113: Fix error in subprocess.Popen if the select system call is
interrupted by a signal.
- Issue #3309: Fix bz2.BZFile iterator to release its internal lock
properly when raising an exception due to the bz2file being closed.
Prevents a deadlock.
- Issue #3094: httplib.HTTPSConnection Host: headers no longer include the
redundant ":443" port number designation when the connection is using the
default https port (443).
- 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.
Tests
----- test.test_support.catch_warning now keeps track of all warnings it sees
and is now better documented. Explicit unit tests for this context manager
have been added to test_warnings.
Build
----- Issue #3215: Build sqlite3 as sqlite3.dll, not sqlite3.pyd.
Documentation
------------- Document that robotparser has been renamed to urllib.robotparser in
Python 3.0.
- Document that urlparse has been renamed to urllib.parse in Python 3.0.
- Document that urllib2 is split across multiple modules and renamed in
Python 3.0.
- Document that urllib is split across multiple modules and renamed in
Python 3.0.
What's New in Python 2.6 beta 1?
================================
*Release date: 18-June-2008*
Core and Builtins
----------------- Issue #3211: warnings.warn_explicit() did not guard against its 'registry'
argument being anything other than a dict or None. Also fixed a bug in error
handling when 'message' and 'category' were both set to None, triggering a
bus error.
- Issue #3100: Corrected a crash on deallocation of a subclassed weakref which
3.0.
- The readcd module from IRIX has been deprecated for removal in
Python 3.0.
- The panelparser module from IRIX has been deprecated for removal in
Python 3.0.
- The panel module from IRIX has been deprecated for removal in Python
3.0.
- The jpeg module from IRIX has been deprecated for removal in Python
3.0.
- The IOCTL module from IRIX has been deprecated for removal in Python
3.0.
- The IN module from IRIX has been deprecated for removal in Python
3.0.
- The imgfile module from IRIX has been deprecated for removal in
Python 3.0.
- The GLWS module from IRIX has been deprecated for removal in Python
3.0.
- The GET module from IRIX has been deprecated for removal in Python
3.0.
- The fm module from IRIX has been deprecated for removal in Python
3.0.
- The FL, flp, and fl modules from IRIX have been deprecated for
removal in Python 3.0.
- The FILE module on IRIX has been deprecated for removal in Python
3.0.
- The ERRNO module on IRIX has been deprecated for removal in Python
3.0.
- The DEVICE, GL, gl, and cgen modules (which indirectly includes
cgensupport) have been deprecated for removal in Python 3.0.
- The CL, CL_old, and cl modules for IRIX have been deprecated for
removal in Python 3.0.
- The cdplayer module for IRIX has been deprecated for removal in
Python 3.0.
- The cddb module for IRIX has been deprecated for removal in Python
3.0.
- The cd and CD modules for IRIX have been deprecated for removal in
Python 3.0.
- The al and AL modules for IRIX have been deprecated for removal in
Python 3.0.
- Issue #1713041: fix pprint's handling of maximum depth.
- The timing module has been deprecated for removal in Python 3.0.
- The sv module has been deprecated for removal in Python 3.0.
- The multifile module has been deprecated as per PEP 4.
- The imageop module has been deprecated for removal in Python 3.0.
- Issue #2250: Exceptions raised during evaluation of names in
rlcompleter's ``Completer.complete()`` method are now caught and
ignored.
- Issue #2659: Added ``break_on_hyphens`` option to textwrap
TextWrapper class.
- The mhlib module has been deprecated for removal in Python 3.0.
- The linuxaudiodev module has been deprecated for removal in Python
3.0.
- The ihooks module has been deprecated for removal in Python 3.0.
- The fpformat module has been deprecated for removal in Python 3.0.
- The dl module has been deprecated for removal in Python 3.0.
- The Canvas module has been deprecated for removal in Python 3.0.
- The compiler package has been deprecated for removal in Python 3.0.
- The Bastion and rexec modules have been deprecated for removal in
Python 3.0.
- The bsddb185 module has been deprecated for removal in Python 3.0.
- The pure module has been deprecated for removal in Python 3.0.
- Issue #2487: change the semantics of math.ldexp(x, n) when n is too
large to fit in a C long. ldexp(x, n) now returns a zero (with
suitable sign) if n is large and negative; previously, it raised
OverflowError.
- The toaiff module has been deprecated for removal in Python 3.0.
- The test.testall module has been deprecated for removal in Python
3.0.
- The new module has been deprecated for removal in Python 3.0.
- The user module has been deprecated for removal in Python 3.0.
- The stringold module has been deprecated for removal in Python 3.0.
- The mutex module has been deprecated for removal in Python 3.0.
- The imputil module has been deprecated for removal in Python 3.0.
- test.test_support.catch_warning() gained a 'record' argument.
- 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.
- Issue #1164: It was possible to trigger deadlock when using the
'print' statement to write to a file since the GIL was not released
as needed. Now PyObject_Print() does the right thing along with
various tp_print implementations of the built-in types and those in
the collections module.
- Issue #1147: Exceptions were directly allowing string exceptions in
their throw() method even though string exceptions no longer
allowed.
- Issue #1096: Prevent a segfault from getting the repr of a very
deeply nested list by using the recursion counter.
- Issue #1202533: Fix infinite recursion calls triggered by calls to
PyObject_Call() never calling back out to Python code to trigger
recursion depth updates/checks. Required the creation of a static
RuntimeError instance in case normalizing an exception put the
recursion check value past its limit. Fixes crashers
infinite_rec_(1|2|4|5).py.
- Patch #1031213: Decode source line in SyntaxErrors back to its
original source encoding.
- Patch #1673759: add a missing overflow check when formatting floats
with %G.
- Prevent expandtabs() on string and unicode objects from causing a
segfault when a large width is passed on 32-bit platforms.
- Issue #1733488: Fix compilation of bufferobject.c on AIX.
- Issue #1722485: remove docstrings again when running with -OO.
- Add new attribute names for function objects. All the func_* become
__*__ attributes. (Some already existed, e.g., __doc__ and
__name__.)
- Add -3 option to the interpreter to warn about features that are
deprecated and will be changed/removed in Python 3.0.
- Patch #1686487: you can now pass any mapping after '**' in function
calls.
- except clauses may now be spelled either "except E, target:" or
"except E as target:". This is to provide forwards compatibility
with Python 3.0.
- Deprecate BaseException.message as per PEP 352.
- Issue #1303614: don't expose object's __dict__ when the dict is
inherited from a built-in base.
- When __slots__ are set to a unicode string, make it work the same as
setting a plain string, ie don't expand to single letter identifiers.
- Request #1191699: Slices can now be pickled.
- Request #1193128: str.translate() now allows a None argument for
translations that only remove characters without re-mapping the
remaining characters.
- Patch #1682205: a TypeError while unpacking an iterable is no longer
masked by a generic one with the message "unpack non-sequence".
- Remove unused file Python/fmod.c.
- Bug #1683368: The object.__init__() and object.__new__() methods are
now stricter in rejecting excess arguments. The only time when
either allows excess arguments is when it is not overridden and the
other one is. For backwards compatibility, when both are
overridden, it is a deprecation warning (for now; maybe a Py3k
warning later). Also, type.__init__() insists on the same signature
as supported by type.__new__().
- Patch #1675423: PyComplex_AsCComplex() now tries to convert an
object to complex using its __complex__() method before falling back
to the __float__() method. Therefore, the functions in the cmath
module now can operate on objects that define a __complex__()
method.
- Patch #1623563: allow __class__ assignment for classes with
__slots__. The old and the new class are still required to have the
same slot names.
- Patch #1642547: Fix an error/crash when encountering syntax errors
in complex if statements.
- Patch #1462488: Python no longer segfaults when
``object.__reduce_ex__()`` is called with an object that is faking
its type.
- Patch #1680015: Don't modify __slots__ tuple if it contains an
unicode name.
- Patch #1444529: the builtin compile() now accepts keyword arguments.
- Bug #1678647: write a newline after printing an exception in any
case, even when converting the value to a string failed.
- The dir() function has been extended to call the __dir__() method on
its argument, if it exists. If not, it will work like before. This
allows customizing the output of dir() in the presence of a
__getattr__().
- Patch #922167: Python no longer segfaults when faced with infinitely
self-recursive reload() calls (as reported by bug #742342).
- Patch #1675981: remove unreachable code from ``type.__new__()``
method.
- Patch #1491866: change the complex() constructor to allow
parthensized forms. This means complex(repr(x)) now works instead of
raising a ValueError.
- Patch #703779: unset __file__ in __main__ after running a file. This
makes the filenames the warning module prints much more sensible
when a PYTHONSTARTUP file is used.
- Variant of patch #697613: don't exit the interpreter on a SystemExit
exception if the -i command line option or PYTHONINSPECT environment
variable is given, but break into the interactive interpreter just
like on other exceptions or normal program exit.
- Patch #1638879: don't accept strings with embedded NUL bytes in
long().
- Bug #1674503: close the file opened by execfile() in an error
condition.
- Patch #1674228: when assigning a slice (old-style), check for the
sq_ass_slice instead of the sq_slice slot.
- When printing an unraisable error, don't print exceptions. before
the name. This duplicates the behavior whening normally printing
exceptions.
- Bug #1653736: Properly discard third argument to
slot_nb_inplace_power.
- PEP 352: Raising a string exception now triggers a TypeError.
Attempting to catch a string exception raises DeprecationWarning.
- 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.
- patch #1630975: Fix crash when replacing sys.stdout in
sitecustomize.py.
- Prevent seg fault on shutdown which could occur if an object raised
a warning.
- Bug #1566280: Explicitly invoke threading._shutdown from Py_Main, to
avoid relying on atexit.
- Bug #1590891: random.randrange don't return correct value for big
number.
- Patch #1586791: Better exception messages for some operations on
strings, tuples and lists.
- Bug #1067760: Deprecate passing floats to file.seek.
- Bug #1591996: Correctly forward exception in instance_contains().
- Bug #1588287: fix invalid assertion for `1,2` in debug builds.
- Bug #1576657: when setting a KeyError for a tuple key, make sure
that the tuple isn't used as the "exception arguments tuple".
- GB18030 codec now can encode additional two-byte characters that are
missing in GBK.
- Add new codecs for UTF-32, UTF-32-LE and UTF-32-BE.
- Bug #1704793: Return UTF-16 pair if unicodedata.lookup cannot
represent the result in a single character.
- Bug #978833: Close https sockets by releasing the _ssl object.
- Change location of the package index to pypi.python.org/pypi
- Bug #1701409: Fix a segfault in printing ctypes.c_char_p and
ctypes.c_wchar_p when they point to an invalid location. As a
sideeffect the representation of these instances has changed.
- tarfile.py: Added "exclude" keyword argument to TarFile.add().
- Bug #1734723: Fix repr.Repr() so it doesn't ignore the maxtuple
attribute.
- The urlopen function of urllib2 now has an optional timeout
parameter (note that it actually works with HTTP, HTTPS, FTP and
FTPS connections).
- In ftplib, the FTP.ntransfercmd method, when in passive mode, now
uses the socket.create_connection function, using the timeout
specified at connection time.
- Bug #1728403: Fix a bug that CJKCodecs StreamReader hangs when it
reads a file that ends with incomplete sequence and sizehint
argument for .read() is specified.
- Bug #1730389: Change time.strptime() to use ``\s+`` instead of
``\s*`` when matching spaces in the specified format argument.
- Bugs #1668596/#1720897: distutils now copies data files even if
package_dir is empty.
- sha now raises a DeprecationWarning upon import.
- md5 now raises a DeprecationWarning upon import.
- Issue #1385: The hmac module now computes the correct hmac when
using hashes with a block size other than 64 bytes (such as sha384
and sha512).
- mimify now raises a DeprecationWarning upon import.
- MimeWriter now raises a DeprecationWarning upon import.
- tarfile.py: Improved unicode support. Unicode input names are now
officially supported. Added "errors" argument to the TarFile class.
- urllib.ftpwrapper class now accepts an optional timeout.
- shlex.split() now has an optional "posix" parameter.
- The posixfile module now raises a DeprecationWarning.
- Patch #1553314: Fix the inspect.py slowdown that was hurting IPython
& SAGE by adding smarter caching in inspect.getmodule()
- Fix missing import of the types module in logging.config.
- Patch #1550886: Fix decimal module context management implementation
to match the localcontext() example from PEP 343.
- Bug #1545341: The 'classifier' keyword argument to the Distutils
setup() function now accepts tuples as well as lists.
- Bug #1541863: uuid.uuid1 failed to generate unique identifiers on
systems with low clock resolution.
- Bug #1531862: Do not close standard file descriptors in subprocess.
- 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.
- The implementation of UnicodeError objects has been simplified
(start and end attributes are now stored directly as Py_ssize_t
members).
- Issue #829951: In the smtplib module, SMTP.starttls() now complies
with RFC 3207 and forgets any knowledge obtained from the server not
obtained from the TLS negotiation itself. Patch contributed by Bill
Fenner.
- Issue #1339: The smtplib.SMTP class has been refactored a bit such
that the SMTP.starttls() caller no longer needs to call ehlo()
beforehand. SMTP.starttls() now raises an exception of the server
does not claim to support starttls. Adds the
SMTP.ehlo_or_helo_if_needed() method. Patch contributed by Bill
Fenner.
- Patch #1089358: Add signal.siginterrupt, a wrapper around
siginterrupt(3).
Extension Modules
----------------- Patch #1657: added select.epoll and select.kqueue.
- Patch #1506171: added operator.methodcaller().
- Patch #1826: operator.attrgetter() now supports dotted attribute paths.
- Patch #1957: syslogmodule: Release GIL when calling syslog(3).
- Bug #2112: mmap.error is now a subclass of EnvironmentError and not
a direct EnvironmentError.
- Bug #2111: mmap segfaults when trying to write a block opened with
PROT_READ.
- Bug #2063: correct order of utime and stime in os.times() result on
Windows.
get_completion_type to readline.
- Bug #1649098: Avoid declaration of zero-sized array declaration in
structure.
- Removed the rgbimg module; been deprecated since Python 2.5.
- Bug #1721309: prevent bsddb module from freeing random memory.
- Bug #1233: fix bsddb.dbshelve.DBShelf append method to work as
intended for RECNO databases.
- pybsddb.sf.net Bug #477182: Load the database flags at database open
time so that opening a database previously created with the DB_DUP
or DB_DUPSORT flag set will keep the proper behavior on subsequent
opens. Specifically: dictionary assignment to a DB object will
replace all values for a given key when the database allows
duplicate values. DB users should use DB.put(k, v) when they want
to store duplicates; not DB[k] = v.
- Add the bsddb.db.DBEnv.lock_id_free method.
- Bug #1686475: Support stat'ing open files on Windows again.
- Patch #1185447: binascii.b2a_qp() now correctly quotes binary
characters with ASCII value less than 32. Also, it correctly quotes
dots only if they occur on a single line, as opposed to the previous
behavior of quoting dots if they are the second character of any
line.
- 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.
- Patch #1646728: datetime.fromtimestamp fails with negative
fractional times. With unittest.
- Patch #1490190: posixmodule now includes os.chflags() and
os.lchflags() functions on platforms where the underlying system
calls are available.
- Patch #1494140: Add documentation for the new struct.Struct object.
- Patch #1432399: Support the HCI protocol for bluetooth sockets
- Patch #1657276: Make NETLINK_DNRTMSG conditional.
- Bug #1653736: Complain about keyword arguments to time.isoformat.
- Bug #1486663: don't reject keyword arguments for subclasses of
built-in types.
- Patch #1610575: The struct module now supports the 't' code, for C99
_Bool.
- Patch #1635058: ensure that htonl and friends never accept or return
negative numbers, per the underlying C implementation.
- Patch #1706: Drop support for Win9x, WinME and NT4. Python now
requires Windows 2000 or greater. The _WINVER and NTDDI_VERSION
macros are set to Win2k for x86/32bit builds and WinXP for AMD64
builds.
- Conditionalize definition of _CRT_SECURE_NO_DEPRECATE and
_CRT_NONSTDC_NO_DEPRECATE.
- Bug #1216: Restore support for Visual Studio 2002.
Mac
--- cfmfile now raises a DeprecationWarning.
- buildtools now raises a DeprecationWarning.
- Removed the macfs module. It had been deprecated since Python 2.5.
This lead to the deprecation of macostools.touched() as it relied
solely on macfs and was a no-op under OS X.
---**(For information about older versions, consult the HISTORY file.)**