diff options
Diffstat (limited to 'Misc/NEWS')
-rw-r--r-- | Misc/NEWS | 262 |
1 files changed, 258 insertions, 4 deletions
@@ -2,8 +2,8 @@ Python News +++++++++++ -What's New in Python 3.2.1? -=========================== +What's New in Python 3.3 Alpha 1? +================================= *Release date: XX-XXX-20XX* @@ -20,10 +20,28 @@ Core and Builtins - Issue #11845: Fix typo in rangeobject.c that caused a crash in compute_slice_indices. Patch by Daniel Urban. +- Issue #5673: Added a `timeout` keyword argument to subprocess.Popen.wait, + subprocess.Popen.communicated, subprocess.call, subprocess.check_call, and + subprocess.check_output. If the blocking operation takes more than `timeout` + seconds, the `subprocess.TimeoutExpired` exception is raised. + - 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 #9319: Include the filename in "Non-UTF8 code ..." syntax error. + +- Issue #10785: Store the filename as Unicode in the Python parser. + +- Issue #11619: _PyImport_LoadDynamicModule() doesn't encode the path to bytes + on Windows. + +- Issue #10998: Remove mentions of -Q, sys.flags.division_warning and + Py_DivisionWarningFlag left over from Python 2. + +- Issue #11244: Remove an unnecessary peepholer check that was preventing + negative zeros from being constant-folded properly. + - Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes on Windows if the file is a TTY to workaround a Windows bug. The Windows console returns an error (12: not enough space error) on writing into stdout if @@ -33,15 +51,36 @@ Core and Builtins - Issue #11320: fix bogus memory management in Modules/getpath.c, leading to a possible crash when calling Py_SetPath(). -- Issue #11510: Fixed optimizer bug which turned "a,b={1,1}" into "a,b=(1,1)". +- _ast.__version__ is now a Mercurial integer and hex revision. - Issue #11432: A bug was introduced in subprocess.Popen on posix systems with 3.2.0 where the stdout or stderr file descriptor being the same as the stdin file descriptor would raise an exception. webbrowser.open would fail. fixed. +- Issue #9856: Change object.__format__ with a non-empty format string + to be a DeprecationWarning. In 3.2 it was a PendingDeprecationWarning. + In 3.4 it will be a TypeError. + +- Issue #11244: The peephole optimizer is now able to constant-fold + arbitrarily complex expressions. This also fixes a 3.2 regression where + operations involving negative numbers were not constant-folded. + - 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 #11335: Fixed a memory leak in list.sort when the key function + throws an exception. + +- Issue #8923: When a string is encoded to UTF-8 in strict mode, the result is + cached into the object. Examples: str.encode(), str.encode('utf-8'), + PyUnicode_AsUTF8String() and PyUnicode_AsEncodedString(unicode, "utf-8", + NULL). + +- Issue #10831: PyUnicode_FromFormat() supports %li, %lli and %zi formats. + +- Issue #10829: Refactor PyUnicode_FromFormat(), use the same function to parse + the format string in the 3 steps, fix crashs on invalid format strings. + - Issue #11246: Fix PyUnicode_FromFormat("%V") to decode the byte string from UTF-8 (with replace error handler) instead of ISO-8859-1 (in strict mode). Patch written by Ray Allen. @@ -58,14 +97,42 @@ Core and Builtins - Issue #10830: Fix PyUnicode_FromFormatV("%c") for non-BMP characters on narrow build. +- Issue #11168: Remove filename debug variable from PyEval_EvalFrameEx(). + It encoded the Unicode filename to UTF-8, but the encoding fails on + undecodable filename (on surrogate characters) which raises an unexpected + UnicodeEncodeError on recursion limit. + +- Issue #11187: Remove bootstrap code (use ASCII) of + PyUnicode_AsEncodedString(), it was replaced by a better fallback (use the + locale encoding) in PyUnicode_EncodeFSDefault(). + - Check for NULL result in PyType_FromSpec. +- Issue #10516: New copy() and clear() methods for lists and bytearrays. + - Issue #11386: bytearray.pop() now throws IndexError when the bytearray is empty, instead of OverflowError. Library ------- +- Issue #11856: Speed up parsing of JSON numbers. + +- Issue #11005: threading.RLock()._release_save() raises a RuntimeError if the + lock was not acquired. + +- Issue #11258: Speed up ctypes.util.find_library() under Linux by a factor + of 5 to 10. Initial patch by Jonas H. + +- Issue #11382: Trivial system calls, such as dup() or pipe(), needn't + release the GIL. Patch by Charles-François Natali. + +- Issue #11223: Add threading._info() function providing informations about + the thread implementation. + +- Issue #11731: simplify/enhance email parser/generator API by introducing + policy objects. + - Issue #11768: The signal handler of the signal module only calls Py_AddPendingCall() for the first signal to fix a deadlock on reentrant or parallel calls. PyErr_SetInterrupt() writes also into the wake up file. @@ -85,6 +152,10 @@ Library - Issue #11474: Fix the bug with url2pathname() handling of '/C|/' on Windows. Patch by Santoso Wijaya. +- Issue #11684: complete email.parser bytes API by adding BytesHeaderParser. + +- The bz2 module now handles 4GiB+ input buffers correctly. + - Issue #9233: Fix json.loads('{}') to return a dict (instead of a list), when _json is not available. @@ -96,9 +167,19 @@ Library - Issue #10019: Fixed regression in json module where an indent of 0 stopped adding newlines and acted instead like 'None'. +- Issue #11186: pydoc ignores a module if its name contains a surrogate + character in the index of modules. + +- Issue #11815: Use a light-weight SimpleQueue for the result queue in + concurrent.futures.ProcessPoolExecutor. + - Issue #5162: Treat services like frozen executables to allow child spawning from multiprocessing.forking on Windows. +- logging.basicConfig now supports an optional 'handlers' argument taking an + iterable of handlers to be added to the root logger. Additional parameter + checks were also added to basicConfig. + - Issue #11814: Fix likely typo in multiprocessing.Pool._terminate(). - Issue #11747: Fix range formatting in difflib.context_diff() and @@ -108,26 +189,61 @@ Library worker processes: new processes would be spawned while the pool is being shut down. Patch by Charles-François Natali. +- Issue #2650: re.escape() no longer escapes the '_'. + +- Issue #11757: select.select() now raises ValueError when a negative timeout + is passed (previously, a select.error with EINVAL would be raised). Patch + by Charles-François Natali. + - Issue #7311: fix html.parser to accept non-ASCII attribute values. - Issue #11605: email.parser.BytesFeedParser was incorrectly converting multipart subpararts with an 8bit CTE into unicode instead of preserving the bytes. +- Issue #1690608: email.util.formataddr is now RFC2047 aware: it now has a + charset parameter that defaults utf-8 which is used as the charset for RFC + 2047 encoding when the realname contains non-ASCII characters. + - Issue #10963: Ensure that subprocess.communicate() never raises EPIPE. +- Issue #10791: Implement missing method GzipFile.read1(), allowing GzipFile + to be wrapped in a TextIOWrapper. Patch by Nadeem Vawda. + +- Issue #11707: Added a fast C version of functools.cmp_to_key(). + Patch by Filip Gruszczyński. + +- Issue #11688: Add sqlite3.Connection.set_trace_callback(). Patch by + Torsten Landschoff. + - Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve private keys. +- Issue #5863: Rewrite BZ2File in pure Python, and allow it to accept + file-like objects using a new ``fileobj`` constructor argument. Patch by + Nadeem Vawda. + +- unittest.TestCase.assertSameElements has been removed. + - sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not called yet: detect bootstrap (startup) issues earlier. +- Issue #11393: Add the new faulthandler module. + - Issue #11618: Fix the timeout logic in threading.Lock.acquire() under Windows. +- Removed the 'strict' argument to email.parser.Parser, which has been + deprecated since Python 2.4. + - Issue #11256: Fix inspect.getcallargs on functions that take only keyword arguments. - Issue #11696: Fix ID generation in msilib. +- itertools.accumulate now supports an optional *func* argument for + a user-supplied binary function. + +- Issue #11692: Remove unnecessary demo functions in subprocess module. + - Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when trying to pack a negative (in-range) integer. @@ -143,7 +259,26 @@ Library - Issue #11635: Don't use polling in worker threads and processes launched by concurrent.futures. -- Issue #11628: cmp_to_key generated class should use __slots__ +- Issue #6811: Allow importlib to change a code object's co_filename attribute + to match the path to where the source code currently is, not where the code + object originally came from. + +- Issue #8754: Have importlib use the repr of a module name in error messages. + +- Issue #11591: Prevent "import site" from modifying sys.path when python + was started with -S. + +- collections.namedtuple() now adds a _source attribute to the generated + class. This make the source more accessible than the outdated + "verbose" option which prints to stdout but doesn't make the source + string available. + +- Issue #11371: Mark getopt error messages as localizable. Patch by Filip + Gruszczyński. + +- Issue #11333: Add __slots__ to collections ABCs. + +- Issue #11628: cmp_to_key generated class should use __slots__. - Issue #11666: let help() display named tuple attributes and methods that start with a leading underscore. @@ -154,6 +289,10 @@ Library - Issue #5537: Fix time2isoz() and time2netscape() functions of httplib.cookiejar for expiration year greater than 2038 on 32-bit systems. +- Issue #4391: Use proper gettext plural forms in optparse. + +- Issue #11127: Raise a TypeError when trying to pickle a socket object. + - Issue #11563: Connection:close header is sent by requests using URLOpener class which helps in closing of sockets after connection is over. Patch contributions by Jeff McNeil and Nadeem Vawda. @@ -164,6 +303,8 @@ Library - Issue #5421: Fix misleading error message when one of socket.sendto()'s arguments has the wrong type. Patch by Nikita Vetoshkin. +- Issue #10812: Add some extra posix functions to the os module. + - Issue #10979: unittest stdout buffering now works with class and module setup and teardown. @@ -182,6 +323,8 @@ Library - Issue #11560: shutil.unpack_archive now correctly handles the format parameter. Patch by Evan Dandrea. +- Issue #5870: Add `subprocess.DEVNULL` constant. + - Issue #11133: fix two cases where inspect.getattr_static can trigger code execution. Patch by Andreas Stührk. @@ -193,9 +336,18 @@ Library not installed. Instead, the zipfile.ZIP_STORED compression is used to create the ZipFile. Patch by Natalia B. Bidart. +- Issue #11289: `smtp.SMTP` class becomes a context manager so it can be used + in a `with` statement. Contributed by Giampaolo Rodola. + - Issue #11554: Fixed support for Japanese codecs; previously the body output encoding was not done if euc-jp or shift-jis was specified as the charset. +- Issue #11509: Significantly increase test coverage of fileinput. + Patch by Denver Coneybeare at PyCon 2011 Sprints. + +- Issue #11407: `TestCase.run` returns the result object used or created. + Contributed by Janathan Hartley. + - Issue #11500: Fixed a bug in the os x proxy bypass code for fully qualified IP addresses in the proxy exception list. @@ -203,16 +355,26 @@ Library the "n" as the flag argument and the file exists. The behavior matches the documentation and general logic. +- Issue #1162477: Postel Principal adjustment to email date parsing: handle the + fact that some non-compliant MUAs use '.' instead of ':' in time specs. + - Issue #11131: Fix sign of zero in decimal.Decimal plus and minus operations when the rounding mode is ROUND_FLOOR. +- Issue #9935: Speed up pickling of instances of user-defined classes. + - Issue #5622: Fix curses.wrapper to raise correct exception if curses initialization fails. +- Issue #11408: In threading.Lock.acquire(), only call gettimeofday() when + really necessary. Patch by Charles-François Natali. + - 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-François Natali. +- Issue #9795: add context manager protocol support for nntplib.NNTP class. + - 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. @@ -220,31 +382,89 @@ Library - Issue #11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors on accept(), send() and recv(). +- Issue #11377: Deprecate platform.popen() and reimplement it with os.popen(). + +- Issue #8513: On UNIX, subprocess supports bytes command string. + +- Issue #10866: Add socket.sethostname(). Initial patch by Ross Lagerwall. + +- Issue #11140: Lock.release() now raises a RuntimeError when attempting + to release an unacquired lock, as claimed in the threading documentation. + The _thread.error exception is now an alias of RuntimeError. Patch by + Filip Gruszczyński. Patch for _dummy_thread by Aymeric Augustin. + +- Issue #8594: ftplib now provides a source_address parameter to specify which + (address, port) to bind to before connecting. + - Issue #11326: Add the missing connect_ex() implementation for SSL sockets, and make it work for non-blocking connects. +- Issue #11297: Add collections.ChainMap(). + +- Issue #10755: Add the posix.fdlistdir() function. Patch by Ross Lagerwall. + +- Issue #4761: Add the *at() family of functions (openat(), etc.) to the posix + module. Patch by Ross Lagerwall. + - Issue #7322: Trying to read from a socket's file-like object after a timeout occurred now raises an error instead of silently losing data. +- Issue #11291: poplib.POP no longer suppresses errors on quit(). + +- Issue #11177: asyncore's create_socket() arguments can now be omitted. + +- Issue #6064: Add a ``daemon`` keyword argument to the threading.Thread + and multiprocessing.Process constructors in order to override the + default behaviour of inheriting the daemonic property from the current + thread/process. + - Issue #10956: Buffered I/O classes retry reading or writing after a signal has arrived and the handler returned successfully. +- Issue #10784: New os.getpriority() and os.setpriority() functions. + +- Issue #11114: Fix catastrophic performance of tell() on text files (up + to 1000x faster in some cases). It is still one to two order of magnitudes + slower than binary tell(). + +- Issue #10882: Add os.sendfile function. + +- Issue #10868: Allow usage of the register method of an ABC as a class + decorator. + - Issue #11224: Fixed a regression in tarfile that affected the file-like objects returned by TarFile.extractfile() regarding performance, memory consumption and failures with the stream interface. +- Issue #10924: Adding salt and Modular Crypt Format to crypt library. + Moved old C wrapper to _crypt, and added a Python wrapper with + enhanced salt generation and simpler API for password generation. + - Issue #11074: Make 'tokenize' so it can be reloaded. +- Issue #11085: Moved collections abstract base classes into a separate + module called collections.abc, following the pattern used by importlib.abc. + For backwards compatibility, the names are imported into the collections + module. + - 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 #11169: compileall module uses repr() to format filenames and paths to + escape surrogate characters and show spaces. + - Issue #11089: Fix performance issue limiting the use of ConfigParser() with large config files. - Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers larger than 4GB. Patch by Nadeem Vawda. +- Issue #11388: Added a clear() method to MutableSequence + +- Issue #11174: Add argparse.MetavarTypeHelpFormatter, which uses type names + for the names of optional and positional arguments in help messages. + - Issue #9348: Raise an early error if argparse nargs and metavar don't match. - Issue #8982: Improve the documentation for the argparse Namespace object. @@ -264,6 +484,9 @@ Build - Issue #11268: Prevent Mac OS X Installer failure if Documentation package had previously been installed. +- Issue #11495: OSF support is eliminated. It was deprecated in Python 3.2. + + IDLE ---- @@ -286,6 +509,12 @@ Tests - Issue #10914: Add a minimal embedding test to test_capi. +- Issue #11223: Skip test_lock_acquire_interruption() and + test_rlock_acquire_interruption() of test_threadsignals if a thread lock is + implemented using a POSIX mutex and a POSIX condition variable. A POSIX + condition variable cannot be interrupted by a signal (e.g. on Linux, the + futex system call is restarted). + - Issue #11790: Fix sporadic failures in test_multiprocessing.WithProcessesTestCondition. - Fix possible "file already exists" error when running the tests in parallel. @@ -293,10 +522,21 @@ Tests - Issue #11719: Fix message about unexpected test_msilib skip on non-Windows platforms. Patch by Nadeem Vawda. +- Issue #11727: Add a --timeout option to regrtest: if a test takes more than + TIMEOUT seconds, dumps the traceback of all threads and exits. + - Issue #11653: fix -W with -j in regrtest. +- The email test suite now lives in the Lib/test/test_email package. The test + harness code has also been modernized to allow use of new unittest features. + +- regrtest now discovers test packages as well as test modules. + - Issue #11577: improve test coverage of binhex.py. Patch by Arkady Koplyarov. +- New test_crashers added to exercise the scripts in the Lib/test/crashers + directory and confirm they fail as expected + - Issue #11578: added test for the timeit module. Patch Michael Henry. - Issue #11503: improve test coverage of posixpath.py. Patch by Evan Dandrea. @@ -309,6 +549,9 @@ Tests - Issue #11554: Reactivated test_email_codecs. +- Issue #11505: improves test coverage of string.py. Patch by Alicia + Arlen + - Issue #11490: test_subprocess:test_leaking_fds_on_error no longer gives a false positive if the last directory in the path is inaccessible. @@ -321,9 +564,20 @@ Tests - Issue #9931: Fix hangs in GUI tests under Windows in certain conditions. Patch by Hirokazu Yamamoto. +- Issue #10512: Properly close sockets under test.test_cgi. + +- Issue #10992: Make tests pass under coverage. + - Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due to open door files. +- Issue #10990: Prevent tests from clobbering a set trace function. + +C-API +----- + +- PY_PATCHLEVEL_REVISION has been removed, since it's meaningless with Mercurial. + Documentation ------------- |