From: Benjamin Peterson Date: Sat, 27 Jun 2015 19:18:23 +0000 (-0500) Subject: merge 3.4 X-Git-Tag: v3.5.0b3~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7763c68dcd8ac6fa3e7d24197ea1fae614eaacb2;p=python merge 3.4 --- 7763c68dcd8ac6fa3e7d24197ea1fae614eaacb2 diff --cc Misc/NEWS index 8d25325c0f,ee3bcf7865..3cbbee9baf --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -302,625 -128,613 +302,627 @@@ Librar - Issue #23728: binascii.crc_hqx() could return an integer outside of the range 0-0xffff for empty data. -- Issue #23811: Add missing newline to the PyCompileError error message. - Patch by Alex Shkop. +- Issue #23887: urllib.error.HTTPError now has a proper repr() representation. + Patch by Berker Peksag. -- Issue #17898: Fix exception in gettext.py when parsing certain plural forms. +- asyncio: New event loop APIs: set_task_factory() and get_task_factory(). -- Issue #22982: Improve BOM handling when seeking to multiple positions of - a writable text file. +- asyncio: async() function is deprecated in favour of ensure_future(). -- Issue #23865: close() methods in multiple modules now are idempotent and more - robust at shutdown. If they need to release multiple resources, all are - released even if errors occur. +- Issue 24178: asyncio.Lock, Condition, Semaphore, and BoundedSemaphore + support new 'async with' syntax. Contributed by Yury Selivanov. -- Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if - the FTP connection failed to fix a ResourceWarning. +- Issue 24179: Support 'async for' for asyncio.StreamReader. + Contributed by Yury Selivanov. -- Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not - available. Patch by Davin Potts. +- Issue 24184: Add AsyncIterator and AsyncIterable ABCs to + collections.abc. Contributed by Yury Selivanov. -- Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always - returns bool. tkinter.BooleanVar now validates input values (accepted bool, - int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns bool. +- Issue 22547: Implement informative __repr__ for inspect.BoundArguments. + Contributed by Yury Selivanov. -- Issue #23338: Fixed formatting ctypes error messages on Cygwin. - Patch by Makoto Kato. +- Issue 24190: Implement inspect.BoundArgument.apply_defaults() method. + Contributed by Yury Selivanov. -- Issue #16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and - arbitrary precision integers added in Tcl 8.5. +- Issue 20691: Add 'follow_wrapped' argument to + inspect.Signature.from_callable() and inspect.signature(). + Contributed by Yury Selivanov. -- Issue #23834: Fix socket.sendto(), use the C Py_ssize_t type to store the - result of sendto() instead of the C int type. +- Issue 24248: Deprecate inspect.Signature.from_function() and + inspect.Signature.from_builtin(). -- Issue #21526: Tkinter now supports new boolean type in Tcl 8.5. +- Issue #23898: Fix inspect.classify_class_attrs() to support attributes + with overloaded __eq__ and __bool__. Patch by Mike Bayer. -- Issue #23838: linecache now clears the cache and returns an empty result on - MemoryError. +- Issue #24298: Fix inspect.signature() to correctly unwrap wrappers + around bound methods. -- Issue #18473: Fixed 2to3 and 3to2 compatible pickle mappings. Fixed - ambigious reverse mappings. Added many new mappings. Import mapping is no - longer applied to modules already mapped with full name mapping. +IDLE +---- -- Issue #23745: The new email header parser now handles duplicate MIME - parameter names without error, similar to how get_param behaves. +- Issue #23184: remove unused names and imports in idlelib. + Initial patch by Al Sweigart. -- Issue #23792: Ignore KeyboardInterrupt when the pydoc pager is active. - This mimics the behavior of the standard unix pagers, and prevents - pipepager from shutting down while the pager itself is still running. +Tests +----- -- Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes. +- Issue #21520: test_zipfile no longer fails if the word 'bad' appears + anywhere in the name of the current directory. -- Issue #21802: The reader in BufferedRWPair now is closed even when closing - writer failed in BufferedRWPair.close(). +- Issue #9517: Move script_helper into the support package. + Patch by Christie Wilson. -- Issue #23671: string.Template now allows to specify the "self" parameter as - keyword argument. string.Formatter now allows to specify the "self" and - the "format_string" parameters as keyword arguments. +Documentation +------------- -- Issue #21560: An attempt to write a data of wrong type no longer cause - GzipFile corruption. Original patch by Wolfgang Maier. +- Issue #22155: Add File Handlers subsection with createfilehandler to tkinter + doc. Remove obsolete example from FAQ. Patch by Martin Panter. -- Issue #23647: Increase impalib's MAXLINE to accommodate modern mailbox sizes. +- Issue #24029: Document the name binding behavior for submodule imports. -- Issue #23539: If body is None, http.client.HTTPConnection.request now sets - Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors from - some web servers. +- Issue #24077: Fix typo in man page for -I command option: -s, not -S -- Issue #22351: The nntplib.NNTP constructor no longer leaves the connection - and socket open until the garbage collector cleans them up. Patch by - Martin Panter. +Tools/Demos +----------- -- Issue #23136: _strptime now uniformly handles all days in week 0, including - Dec 30 of previous year. Based on patch by Jim Carroll. +- Issue #24000: Improved Argument Clinic's mapping of converters to legacy + "format units". Updated the documentation to match. -- Issue #23700: Iterator of NamedTemporaryFile now keeps a reference to - NamedTemporaryFile instance. Patch by Bohuslav Kabrda. +- Issue #24001: Argument Clinic converters now use accept={type} + instead of types={'type'} to specify the types the converter accepts. -- Issue #22903: The fake test case created by unittest.loader when it fails - importing a test module is now picklable. +- Issue #23330: h2py now supports arbitrary filenames in #include. -- Issue #23568: Add rdivmod support to MagicMock() objects. - Patch by Håkan Lövdahl. +- Issue #24031: make patchcheck now supports git checkouts, too. -- Issue #23138: Fixed parsing cookies with absent keys or values in cookiejar. - Patch by Demian Brecht. -- Issue #23051: multiprocessing.Pool methods imap() and imap_unordered() now - handle exceptions raised by an iterator. Patch by Alon Diamant and Davin - Potts. +What's New in Python 3.5.0 alpha 4? +=================================== -- Issue #22928: Disabled HTTP header injections in http.client. - Original patch by Demian Brecht. +Release date: 2015-04-19 -- Issue #23615: Modules bz2, tarfile and tokenize now can be reloaded with - imp.reload(). Patch by Thomas Kluyver. +Core and Builtins +----------------- -- Issue #23476: In the ssl module, enable OpenSSL's X509_V_FLAG_TRUSTED_FIRST - flag on certificate stores when it is available. +- Issue #22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include + the architecture triplet in the extension name, to make it easy to test builds + for different ABIs in the same working tree. Under OS X, the extension name + now includes PEP 3149-style information. -- Issue #23576: Avoid stalling in SSL reads when EOF has been reached in the - SSL layer but the underlying connection hasn't been closed. +- Issue #22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES. + Patch courtesy of Joe Jevnik. -- Issue #23504: Added an __all__ to the types module. +- Issue #23731: Implement PEP 488: removal of .pyo files. -- Issue #20204: Added the __module__ attribute to _tkinter classes. +- Issue #23726: Don't enable GC for user subclasses of non-GC types that + don't add any new fields. Patch by Eugene Toder. -- Issue #23521: Corrected pure python implementation of timedelta division. +- Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted + while it is holding a lock to a buffered I/O object, and the main thread + tries to use the same I/O object (typically stdout or stderr). A fatal + error is emitted instead. - * Eliminated OverflowError from timedelta * float for some floats; - * Corrected rounding in timedlta true division. +- Issue #22977: Fixed formatting Windows error messages on Wine. + Patch by Martin Panter. -- Issue #21619: Popen objects no longer leave a zombie after exit in the with - statement if the pipe was broken. Patch by Martin Panter. +- Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on + non-integer input. -- Issue #6639: Module-level turtle functions no longer raise TclError after - closing the window. +- Issue #24044: Fix possible null pointer dereference in list.sort in out of + memory conditions. -- Issues #814253, #9179: Warnings now are raised when group references and - conditional group references are used in lookbehind assertions in regular - expressions. +- Issue #21354: PyCFunction_New function is exposed by python DLL again. -- Issue #23215: Multibyte codecs with custom error handlers that ignores errors - consumed too much memory and raised SystemError or MemoryError. - Original patch by Aleksi Torhamo. +Library +------- -- Issue #5700: io.FileIO() called flush() after closing the file. - flush() was not called in close() if closefd=False. +- Issue #23840: tokenize.open() now closes the temporary binary file on error + to fix a resource warning. -- Issue #23374: Fixed pydoc failure with non-ASCII files when stdout encoding - differs from file system encoding (e.g. on Mac OS). +- Issue #16914: new debuglevel 2 in smtplib adds timestamps to debug output. -- Issue #23481: Remove RC4 from the SSL module's default cipher list. +- Issue #7159: urllib.request now supports sending auth credentials + automatically after the first 401. This enhancement is a superset of the + enhancement from issue #19494 and supersedes that change. -- Issue #21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty - docstrings. +- Issue #23703: Fix a regression in urljoin() introduced in 901e4e52b20a. + Patch by Demian Brecht. -- Issue #22885: Fixed arbitrary code execution vulnerability in the dbm.dumb - module. Original patch by Claudiu Popa. +- Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari -- Issue #23146: Fix mishandling of absolute Windows paths with forward - slashes in pathlib. +- Issue 19933: Provide default argument for ndigits in round. Patch by + Vajrasky Kok. -- Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h. +- Issue #23193: Add a numeric_owner parameter to + tarfile.TarFile.extract and tarfile.TarFile.extractall. Patch by + Michael Vogt and Eric Smith. -- Issue #23367: Fix possible overflows in the unicodedata module. +- Issue #23342: Add a subprocess.run() function than returns a CalledProcess + instance for a more consistent API than the existing call* functions. -- Issue #23361: Fix possible overflow in Windows subprocess creation code. +- Issue #21217: inspect.getsourcelines() now tries to compute the start and end + lines from the code object, fixing an issue when a lambda function is used as + decorator argument. Patch by Thomas Ballinger and Allison Kaptur. -- Issue #23801: Fix issue where cgi.FieldStorage did not always ignore the - entire preamble to a multipart body. ++- Fix possible integer overflows in the pickle module. + -- Issue #23310: Fix MagicMock's initializer to work with __methods__, just - like configure_mock(). Patch by Kasia Jachim. +- Issue #22931: Allow '[' and ']' in cookie values. -- asyncio: New event loop APIs: set_task_factory() and get_task_factory(). - -- asyncio: async() function is deprecated in favour of ensure_future(). +- The keywords attribute of functools.partial is now always a dictionary. -- Issue #23898: Fix inspect.classify_class_attrs() to support attributes - with overloaded __eq__ and __bool__. Patch by Mike Bayer. +- Issue #23811: Add missing newline to the PyCompileError error message. + Patch by Alex Shkop. -- Issue #24298: Fix inspect.signature() to correctly unwrap wrappers - around bound methods. +- Issue #21116: Avoid blowing memory when allocating a multiprocessing shared + array that's larger than 50% of the available RAM. Patch by Médéric Boquien. -IDLE ----- +- Issue #22982: Improve BOM handling when seeking to multiple positions of + a writable text file. -- Issue #23184: remove unused names and imports in idlelib. - Initial patch by Al Sweigart. +- Issue #23464: Removed deprecated asyncio JoinableQueue. -Tests ------ +- Issue #23529: Limit the size of decompressed data when reading from + GzipFile, BZ2File or LZMAFile. This defeats denial of service attacks + using compressed bombs (i.e. compressed payloads which decompress to a huge + size). Patch by Martin Panter and Nikolaus Rath. -- Issue #21520: test_zipfile no longer fails if the word 'bad' appears - anywhere in the name of the current directory. +- Issue #21859: Added Python implementation of io.FileIO. -- Issue #23799: Added test.support.start_threads() for running and - cleaning up multiple threads. +- Issue #23865: close() methods in multiple modules now are idempotent and more + robust at shutdown. If they need to release multiple resources, all are + released even if errors occur. -- Issue #22390: test.regrtest now emits a warning if temporary files or - directories are left after running a test. +- Issue #23400: Raise same exception on both Python 2 and 3 if sem_open is not + available. Patch by Davin Potts. -- Issue #23583: Added tests for standard IO streams in IDLE. +- Issue #10838: The subprocess now module includes SubprocessError and + TimeoutError in its list of exported names for the users wild enough + to use ``from subprocess import *``. -Build ------ +- Issue #23411: Added DefragResult, ParseResult, SplitResult, DefragResultBytes, + ParseResultBytes, and SplitResultBytes to urllib.parse.__all__. + Patch by Martin Panter. -- Issue #23445: pydebug builds now use "gcc -Og" where possible, to make - the resulting executable faster. +- Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if + the FTP connection failed to fix a ResourceWarning. -- Issue #23686: Update OS X 10.5 installer and Windows builds to use - OpenSSL 1.0.2a. +- Issue #23853: :meth:`socket.socket.sendall` does no more reset the socket + timeout each time data is sent successfuly. The socket timeout is now the + maximum total duration to send all data. -C API ------ +- Issue #22721: An order of multiline pprint output of set or dict containing + orderable and non-orderable elements no longer depends on iteration order of + set or dict. -- Issue #23998: PyImport_ReInitLock() now checks for lock allocation error +- Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always + returns bool. tkinter.BooleanVar now validates input values (accepted bool, + int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns bool. -Documentation -------------- +- Issue #10590: xml.sax.parseString() now supports string argument. -- Issue #24351: Clarify what is meant by "identifier" in the context of - string.Template instances. +- Issue #23338: Fixed formatting ctypes error messages on Cygwin. + Patch by Makoto Kato. -- Issue #22155: Add File Handlers subsection with createfilehandler to tkinter - doc. Remove obsolete example from FAQ. Patch by Martin Panter. +- Issue #15582: inspect.getdoc() now follows inheritance chains. -- Issue #24029: Document the name binding behavior for submodule imports. +- Issue #2175: SAX parsers now support a character stream of InputSource object. -- Issue #24077: Fix typo in man page for -I command option: -s, not -S. +- Issue #16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and + arbitrary precision integers added in Tcl 8.5. -Tools/Demos ------------ +- Issue #23834: Fix socket.sendto(), use the C Py_ssize_t type to store the + result of sendto() instead of the C int type. -- Issue #23330: h2py now supports arbitrary filenames in #include. +- Issue #23618: :meth:`socket.socket.connect` now waits until the connection + completes instead of raising :exc:`InterruptedError` if the connection is + interrupted by signals, signal handlers don't raise an exception and the + socket is blocking or has a timeout. :meth:`socket.socket.connect` still + raise :exc:`InterruptedError` for non-blocking sockets. -- Issue #24031: make patchcheck now supports git checkouts, too. +- Issue #21526: Tkinter now supports new boolean type in Tcl 8.5. +- Issue #23836: Fix the faulthandler module to handle reentrant calls to + its signal handlers. -What's New in Python 3.4.3? -=========================== +- Issue #23838: linecache now clears the cache and returns an empty result on + MemoryError. -Release date: 2015-02-23 +- Issue #10395: Added os.path.commonpath(). Implemented in posixpath and ntpath. + Based on patch by Rafik Draoui. -Core and Builtins ------------------ +- Issue #23611: Serializing more "lookupable" objects (such as unbound methods + or nested classes) now are supported with pickle protocols < 4. -- Issue #22735: Fix many edge cases (including crashes) involving custom mro() - implementations. +- Issue #13583: sqlite3.Row now supports slice indexing. -- Issue #22896: Avoid using PyObject_AsCharBuffer(), PyObject_AsReadBuffer() - and PyObject_AsWriteBuffer(). +- Issue #18473: Fixed 2to3 and 3to2 compatible pickle mappings. Fixed + ambigious reverse mappings. Added many new mappings. Import mapping is no + longer applied to modules already mapped with full name mapping. -- Issue #21295: Revert some changes (issue #16795) to AST line numbers and - column offsets that constituted a regression. +- Issue #23485: select.select() is now retried automatically with the + recomputed timeout when interrupted by a signal, except if the signal handler + raises an exception. This change is part of the PEP 475. -- Issue #21408: The default __ne__() now returns NotImplemented if __eq__() - returned NotImplemented. Original patch by Martin Panter. +- Issue #23752: When built from an existing file descriptor, io.FileIO() now + only calls fstat() once. Before fstat() was called twice, which was not + necessary. -- Issue #23321: Fixed a crash in str.decode() when error handler returned - replacment string longer than mailformed input data. +- Issue #23704: collections.deque() objects now support __add__, __mul__, and + __imul__(). -- Issue #23048: Fix jumping out of an infinite while loop in the pdb. +- Issue #23171: csv.Writer.writerow() now supports arbitrary iterables. -- Issue #20335: bytes constructor now raises TypeError when encoding or errors - is specified with non-string argument. Based on patch by Renaud Blanch. +- Issue #23745: The new email header parser now handles duplicate MIME + parameter names without error, similar to how get_param behaves. -- Issue #22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff - bytes on a 32-bit platform. +- Issue #22117: Fix os.utime(), it now rounds the timestamp towards minus + infinity (-inf) instead of rounding towards zero. -- Issue #22653: Fix an assertion failure in debug mode when doing a reentrant - dict insertion in debug mode. +- Issue #23310: Fix MagicMock's initializer to work with __methods__, just + like configure_mock(). Patch by Kasia Jachim. -- Issue #22643: Fix integer overflow in Unicode case operations (upper, lower, - title, swapcase, casefold). -- Issue #22604: Fix assertion error in debug mode when dividing a complex - number by (nan+0j). +Build +----- -- Issue #22470: Fixed integer overflow issues in "backslashreplace", - "xmlcharrefreplace", and "surrogatepass" error handlers. +- Issue #23817: FreeBSD now uses "1.0" the the SOVERSION as other operating + systems, instead of just "1". -- Issue #22520: Fix overflow checking when generating the repr of a unicode - object. +- Issue #23501: Argument Clinic now generates code into separate files by default. -- Issue #22519: Fix overflow checking in PyBytes_Repr. +Tests +----- -- Issue #22518: Fix integer overflow issues in latin-1 encoding. +- Issue #23799: Added test.support.start_threads() for running and + cleaning up multiple threads. -- Issue #23165: Perform overflow checks before allocating memory in the - _Py_char2wchar function. +- Issue #22390: test.regrtest now emits a warning if temporary files or + directories are left after running a test. -Library -------- +Tools/Demos +----------- -- Issue #23399: pyvenv creates relative symlinks where possible. +- Issue #18128: pygettext now uses standard +NNNN format in the + POT-Creation-Date header. -- Issue #23099: Closing io.BytesIO with exported buffer is rejected now to - prevent corrupting exported buffer. +- Issue #23935: Argument Clinic's understanding of format units + accepting bytes, bytearrays, and buffers is now consistent with + both the documentation and the implementation. -- Issue #23363: Fix possible overflow in itertools.permutations. +- Issue #23944: Argument Clinic now wraps long impl prototypes at column 78. -- Issue #23364: Fix possible overflow in itertools.product. +- Issue #20586: Argument Clinic now ensures that functions without docstrings + have signatures. -- Issue #23366: Fixed possible integer overflow in itertools.combinations. +- Issue #23492: Argument Clinic now generates argument parsing code with + PyArg_Parse instead of PyArg_ParseTuple if possible. -- Issue #23369: Fixed possible integer overflow in - _json.encode_basestring_ascii. +- Issue #23500: Argument Clinic is now smarter about generating the "#ifndef" + (empty) definition of the methoddef macro: it's only generated once, even + if Argument Clinic processes the same symbol multiple times, and it's emitted + at the end of all processing rather than immediately after the first use. -- Issue #23353: Fix the exception handling of generators in - PyEval_EvalFrameEx(). At entry, save or swap the exception state even if - PyEval_EvalFrameEx() is called with throwflag=0. At exit, the exception state - is now always restored or swapped, not only if why is WHY_YIELD or - WHY_RETURN. Patch co-written with Antoine Pitrou. +C API +----- -- Issue #18518: timeit now rejects statements which can't be compiled outside - a function or a loop (e.g. "return" or "break"). +- Issue #23998: PyImport_ReInitLock() now checks for lock allocation error -- Issue #23094: Fixed readline with frames in Python implementation of pickle. -- Issue #23268: Fixed bugs in the comparison of ipaddress classes. +What's New in Python 3.5.0 alpha 3? +=================================== -- Issue #21408: Removed incorrect implementations of __ne__() which didn't - returned NotImplemented if __eq__() returned NotImplemented. The default - __ne__() now works correctly. +Release date: 2015-03-28 -- Issue #19996: :class:`email.feedparser.FeedParser` now handles (malformed) - headers with no key rather than assuming the body has started. +Core and Builtins +----------------- -- Issue #23248: Update ssl error codes from latest OpenSSL git master. +- Issue #23573: Increased performance of string search operations (str.find, + str.index, str.count, the in operator, str.split, str.partition) with + arguments of different kinds (UCS1, UCS2, UCS4). -- Issue #23098: 64-bit dev_t is now supported in the os module. +- Issue #23753: Python doesn't support anymore platforms without stat() or + fstat(), these functions are always required. -- Issue #23250: In the http.cookies module, capitalize "HttpOnly" and "Secure" - as they are written in the standard. +- Issue #23681: The -b option now affects comparisons of bytes with int. -- Issue #23063: In the disutils' check command, fix parsing of reST with code or - code-block directives. +- Issue #23632: Memoryviews now allow tuple indexing (including for + multi-dimensional memoryviews). -- Issue #23209, #23225: selectors.BaseSelector.close() now clears its internal - reference to the selector mapping to break a reference cycle. Initial patch - written by Martin Richard. +- Issue #23192: Fixed generator lambdas. Patch by Bruno Cauet. -- Issue #21356: Make ssl.RAND_egd() optional to support LibreSSL. The - availability of the function is checked during the compilation. Patch written - by Bernard Spil. +- Issue #23629: Fix the default __sizeof__ implementation for variable-sized + objects. -- Issue #20896, #22935: The :func:`ssl.get_server_certificate` function now - uses the :data:`~ssl.PROTOCOL_SSLv23` protocol by default, not - :data:`~ssl.PROTOCOL_SSLv3`, for maximum compatibility and support platforms - where :data:`~ssl.PROTOCOL_SSLv3` support is disabled. +Library +------- -- Issue #23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol - version. +- Issue #14260: The groupindex attribute of regular expression pattern object + now is non-modifiable mapping. -- Issue #23132: Mitigate regression in speed and clarity in functools.total_ordering. +- Issue #23792: Ignore KeyboardInterrupt when the pydoc pager is active. + This mimics the behavior of the standard unix pagers, and prevents + pipepager from shutting down while the pager itself is still running. -- Issue #22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(), - instead of reading /dev/urandom, to get pseudo-random bytes. +- Issue #23775: pprint() of OrderedDict now outputs the same representation + as repr(). -- Issue #23112: Fix SimpleHTTPServer to correctly carry the query string and - fragment when it redirects to add a trailing slash. +- Issue #23765: Removed IsBadStringPtr calls in ctypes -- Issue #23093: In the io, module allow more operations to work on detached - streams. +- Issue #22364: Improved some re error messages using regex for hints. -- Issue #19104: pprint now produces evaluable output for wrapped strings. +- Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes. -- Issue #23071: Added missing names to codecs.__all__. Patch by Martin Panter. +- Issue #21717: The zipfile.ZipFile.open function now supports 'x' (exclusive + creation) mode. -- Issue #15513: Added a __sizeof__ implementation for pickle classes. +- Issue #21802: The reader in BufferedRWPair now is closed even when closing + writer failed in BufferedRWPair.close(). -- Issue #19858: pickletools.optimize() now aware of the MEMOIZE opcode, can - produce more compact result and no longer produces invalid output if input - data contains MEMOIZE opcodes together with PUT or BINPUT opcodes. +- Issue #23622: Unknown escapes in regular expressions that consist of ``'\'`` + and ASCII letter now raise a deprecation warning and will be forbidden in + Python 3.6. -- Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The port - value in the host header was set to "None". Patch by Demian Brecht. +- Issue #23671: string.Template now allows to specify the "self" parameter as + keyword argument. string.Formatter now allows to specify the "self" and + the "format_string" parameters as keyword arguments. -- Issue #23016: A warning no longer produces an AttributeError when the program - is run with pythonw.exe. +- Issue #23502: The pprint module now supports mapping proxies. -- Issue #21775: shutil.copytree(): fix crash when copying to VFAT. An exception - handler assumed that that OSError objects always have a 'winerror' attribute. - That is not the case, so the exception handler itself raised AttributeError - when run on Linux (and, presumably, any other non-Windows OS). - Patch by Greg Ward. +- Issue #17530: pprint now wraps long bytes objects and bytearrays. -- Issue #1218234: Fix inspect.getsource() to load updated source of - reloaded module. Initial patch by Berker Peksag. +- Issue #22687: Fixed some corner cases in breaking words in tetxtwrap. + Got rid of quadratic complexity in breaking long words. -- Issue #22959: In the constructor of http.client.HTTPSConnection, prefer the - context's check_hostname attribute over the *check_hostname* parameter. +- Issue #4727: The copy module now uses pickle protocol 4 (PEP 3154) and + supports copying of instances of classes whose __new__ method takes + keyword-only arguments. -- Issue #16043: Add a default limit for the amount of data xmlrpclib.gzip_decode - will return. This resolves CVE-2013-1753. +- Issue #23491: Added a zipapp module to support creating executable zip + file archives of Python code. Registered ".pyz" and ".pyzw" extensions + on Windows for these archives (PEP 441). -- Issue #22966: Fix __pycache__ pyc file name clobber when pyc_compile is - asked to compile a source file containing multiple dots in the source file - name. +- Issue #23657: Avoid explicit checks for str in zipapp, adding support + for pathlib.Path objects as arguments. -- Issue #21971: Update turtledemo doc and add module to the index. +- Issue #23688: Added support of arbitrary bytes-like objects and avoided + unnecessary copying of memoryview in gzip.GzipFile.write(). + Original patch by Wolfgang Maier. -- Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails. - Original patch by Martin Panter. +- Issue #23252: Added support for writing ZIP files to unseekable streams. -- Issue #22960: Add a context argument to xmlrpclib.ServerProxy constructor. +- Issue #23647: Increase impalib's MAXLINE to accommodate modern mailbox sizes. -- Issue #22915: SAX parser now supports files opened with file descriptor or - bytes path. +- Issue #23539: If body is None, http.client.HTTPConnection.request now sets + Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors from + some web servers. -- Issue #22609: Constructors and update methods of mapping classes in the - collections module now accept the self keyword argument. +- Issue #22351: The nntplib.NNTP constructor no longer leaves the connection + and socket open until the garbage collector cleans them up. Patch by + Martin Panter. -- Issue #22788: Add *context* parameter to logging.handlers.HTTPHandler. +- Issue #23704: collections.deque() objects now support methods for index(), + insert(), and copy(). This allows deques to be registered as a + MutableSequence and it improves their substitutablity for lists. -- Issue #22921: Allow SSLContext to take the *hostname* parameter even if - OpenSSL doesn't support SNI. +- Issue #23715: :func:`signal.sigwaitinfo` and :func:`signal.sigtimedwait` are + now retried when interrupted by a signal not in the *sigset* parameter, if + the signal handler does not raise an exception. signal.sigtimedwait() + recomputes the timeout with a monotonic clock when it is retried. -- Issue #22894: TestCase.subTest() would cause the test suite to be stopped - when in failfast mode, even in the absence of failures. +- Issue #23001: Few functions in modules mmap, ossaudiodev, socket, ssl, and + codecs, that accepted only read-only bytes-like object now accept writable + bytes-like object too. -- Issue #22638: SSLv3 is now disabled throughout the standard library. - It can still be enabled by instantiating a SSLContext manually. +- Issue #23646: If time.sleep() is interrupted by a signal, the sleep is now + retried with the recomputed delay, except if the signal handler raises an + exception (PEP 475). -- Issue #22370: Windows detection in pathlib is now more robust. +- Issue #23136: _strptime now uniformly handles all days in week 0, including + Dec 30 of previous year. Based on patch by Jim Carroll. -- Issue #22841: Reject coroutines in asyncio add_signal_handler(). - Patch by Ludovic.Gasc. +- Issue #23700: Iterator of NamedTemporaryFile now keeps a reference to + NamedTemporaryFile instance. Patch by Bohuslav Kabrda. -- Issue #22849: Fix possible double free in the io.TextIOWrapper constructor. +- Issue #22903: The fake test case created by unittest.loader when it fails + importing a test module is now picklable. -- Issue #12728: Different Unicode characters having the same uppercase but - different lowercase are now matched in case-insensitive regular expressions. +- Issue #22181: On Linux, os.urandom() now uses the new getrandom() syscall if + available, syscall introduced in the Linux kernel 3.17. It is more reliable + and more secure, because it avoids the need of a file descriptor and waits + until the kernel has enough entropy. + +- Issue #2211: Updated the implementation of the http.cookies.Morsel class. + Setting attributes key, value and coded_value directly now is deprecated. + update() and setdefault() now transform and check keys. Comparing for + equality now takes into account attributes key, value and coded_value. + copy() now returns a Morsel, not a dict. repr() now contains all attributes. + Optimized checking keys and quoting values. Added new tests. + Original patch by Demian Brecht. -- Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian - platforms. +- Issue #18983: Allow selection of output units in timeit. + Patch by Julian Gindi. -- Issue #22406: Fixed the uu_codec codec incorrectly ported to 3.x. - Based on patch by Martin Panter. +- Issue #23631: Fix traceback.format_list when a traceback has been mutated. -- Issue #17293: uuid.getnode() now determines MAC address on AIX using netstat. - Based on patch by Aivars Kalvāns. +- Issue #23568: Add rdivmod support to MagicMock() objects. + Patch by Håkan Lövdahl. -- Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments. +- Issue #2052: Add charset parameter to HtmlDiff.make_file(). -- Issue #22417: Verify certificates by default in httplib (PEP 476). +- Issue #23668: Support os.truncate and os.ftruncate on Windows. -- Issue #22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2 - and above. Patch by Tim Graham. +- Issue #23138: Fixed parsing cookies with absent keys or values in cookiejar. + Patch by Demian Brecht. -- Issue #22366: urllib.request.urlopen will accept a context object - (SSLContext) as an argument which will then used be for HTTPS connection. - Patch by Alex Gaynor. +- Issue #23051: multiprocessing.Pool methods imap() and imap_unordered() now + handle exceptions raised by an iterator. Patch by Alon Diamant and Davin + Potts. -- Issue #22776: Brought excluded code into the scope of a try block in - SysLogHandler.emit(). +- Issue #23581: Add matmul support to MagicMock. Patch by Håkan Lövdahl. -- Issue #22665: Add missing get_terminal_size and SameFileError to - shutil.__all__. +- Issue #23566: enable(), register(), dump_traceback() and + dump_traceback_later() functions of faulthandler now accept file + descriptors. Patch by Wei Wu. -- Issue #17381: Fixed handling of case-insensitive ranges in regular - expressions. +- Issue #22928: Disabled HTTP header injections in http.client. + Original patch by Demian Brecht. -- Issue #22410: Module level functions in the re module now cache compiled - locale-dependent regular expressions taking into account the locale. +- Issue #23615: Modules bz2, tarfile and tokenize now can be reloaded with + imp.reload(). Patch by Thomas Kluyver. -- Issue #22759: Query methods on pathlib.Path() (exists(), is_dir(), etc.) - now return False when the underlying stat call raises NotADirectoryError. +- Issue #23605: os.walk() now calls os.scandir() instead of os.listdir(). + The usage of os.scandir() reduces the number of calls to os.stat(). + Initial patch written by Ben Hoyt. -- Issue #8876: distutils now falls back to copying files when hard linking - doesn't work. This allows use with special filesystems such as VirtualBox - shared folders. +Build +----- -- Issue #18853: Fixed ResourceWarning in shlex.__nain__. +- Issue #23585: make patchcheck will ensure the interpreter is built. -- Issue #9351: Defaults set with set_defaults on an argparse subparser - are no longer ignored when also set on the parent parser. +Tests +----- -- Issue #21991: Make email.headerregistry's header 'params' attributes - be read-only (MappingProxyType). Previously the dictionary was modifiable - but a new one was created on each access of the attribute. +- Issue #23583: Added tests for standard IO streams in IDLE. -- Issue #22641: In asyncio, the default SSL context for client connections - is now created using ssl.create_default_context(), for stronger security. +- Issue #22289: Prevent test_urllib2net failures due to ftp connection timeout. -- Issue #22435: Fix a file descriptor leak when SocketServer bind fails. +Tools/Demos +----------- -- Issue #13096: Fixed segfault in CTypes POINTER handling of large - values. +- Issue #22826: The result of open() in Tools/freeze/bkfile.py is now better + compatible with regular files (in particular it now supports the context + management protocol). -- Issue #11694: Raise ConversionError in xdrlib as documented. Patch - by Filip Gruszczyński and Claudiu Popa. -- Issue #22462: Fix pyexpat's creation of a dummy frame to make it - appear in exception tracebacks. +What's New in Python 3.5 alpha 2? +================================= -- Issue #21173: Fix len() on a WeakKeyDictionary when .clear() was called - with an iterator alive. +Release date: 2015-03-09 -- Issue #11866: Eliminated race condition in the computation of names - for new threads. +Core and Builtins +----------------- -- Issue #21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules - is mutated while iterating. Patch by Olivier Grisel. +- Issue #23571: PyObject_Call() and PyCFunction_Call() now raise a SystemError + if a function returns a result and raises an exception. The SystemError is + chained to the previous exception. -- Issue #22219: The zipfile module CLI now adds entries for directories - (including empty directories) in ZIP file. +Library +------- -- Issue #22449: In the ssl.SSLContext.load_default_certs, consult the - environmental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows. +- Issue #22524: New os.scandir() function, part of the PEP 471: "os.scandir() + function -- a better and faster directory iterator". Patch written by Ben + Hoyt. -- Issue #20076: Added non derived UTF-8 aliases to locale aliases table. +- Issue #23103: Reduced the memory consumption of IPv4Address and IPv6Address. -- Issue #20079: Added locales supported in glibc 2.18 to locale alias table. +- Issue #21793: BaseHTTPRequestHandler again logs response code as numeric, + not as stringified enum. Patch by Demian Brecht. -- Issue #22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor - os.posix_fallocate() because their prototypes in system headers are wrong. +- Issue #23476: In the ssl module, enable OpenSSL's X509_V_FLAG_TRUSTED_FIRST + flag on certificate stores when it is available. -- Issue #22517: When a io.BufferedRWPair object is deallocated, clear its - weakrefs. +- Issue #23576: Avoid stalling in SSL reads when EOF has been reached in the + SSL layer but the underlying connection hasn't been closed. -- Issue #22448: Improve canceled timer handles cleanup to prevent - unbound memory usage. Patch by Joshua Moore-Oliva. +- Issue #23504: Added an __all__ to the types module. -- Issue #23009: Make sure selectors.EpollSelecrtor.select() works when no - FD is registered. +- Issue #23563: Optimized utility functions in urllib.parse. -IDLE ----- +- Issue #7830: Flatten nested functools.partial. -- Issue #20577: Configuration of the max line length for the FormatParagraph - extension has been moved from the General tab of the Idle preferences dialog - to the FormatParagraph tab of the Config Extensions dialog. - Patch by Tal Einat. +- Issue #20204: Added the __module__ attribute to _tkinter classes. -- Issue #16893: Update Idle doc chapter to match current Idle and add new - information. +- Issue #19980: Improved help() for non-recognized strings. help('') now + shows the help on str. help('help') now shows the help on help(). + Original patch by Mark Lawrence. -- Issue #3068: Add Idle extension configuration dialog to Options menu. - Changes are written to HOME/.idlerc/config-extensions.cfg. - Original patch by Tal Einat. +- Issue #23521: Corrected pure python implementation of timedelta division. -- Issue #16233: A module browser (File : Class Browser, Alt+C) requires a - editor window with a filename. When Class Browser is requested otherwise, - from a shell, output window, or 'Untitled' editor, Idle no longer displays - an error box. It now pops up an Open Module box (Alt+M). If a valid name - is entered and a module is opened, a corresponding browser is also opened. + * Eliminated OverflowError from timedelta * float for some floats; + * Corrected rounding in timedlta true division. -- Issue #4832: Save As to type Python files automatically adds .py to the - name you enter (even if your system does not display it). Some systems - automatically add .txt when type is Text files. +- Issue #21619: Popen objects no longer leave a zombie after exit in the with + statement if the pipe was broken. Patch by Martin Panter. -- Issue #21986: Code objects are not normally pickled by the pickle module. - To match this, they are no longer pickled when running under Idle. +- Issue #22936: Make it possible to show local variables in tracebacks for + both the traceback module and unittest. -- Issue #23180: Rename IDLE "Windows" menu item to "Window". - Patch by Al Sweigart. +- Issue #15955: Add an option to limit the output size in bz2.decompress(). + Patch by Nikolaus Rath. -Tests ------ +- Issue #6639: Module-level turtle functions no longer raise TclError after + closing the window. -- Issue #23392: Added tests for marshal C API that works with FILE*. +- Issues #814253, #9179: Group references and conditional group references now + work in lookbehind assertions in regular expressions. -- Issue #18982: Add tests for CLI of the calendar module. +- Issue #23215: Multibyte codecs with custom error handlers that ignores errors + consumed too much memory and raised SystemError or MemoryError. + Original patch by Aleksi Torhamo. -- Issue #19548: Added some additional checks to test_codecs to ensure that - statements in the updated documentation remain accurate. Patch by Martin - Panter. +- Issue #5700: io.FileIO() called flush() after closing the file. + flush() was not called in close() if closefd=False. -- Issue #22838: All test_re tests now work with unittest test discovery. +- Issue #23374: Fixed pydoc failure with non-ASCII files when stdout encoding + differs from file system encoding (e.g. on Mac OS). -- Issue #22173: Update lib2to3 tests to use unittest test discovery. +- Issue #23481: Remove RC4 from the SSL module's default cipher list. -- Issue #16000: Convert test_curses to use unittest. +- Issue #21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty + docstrings. -- Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not - present. Patch by Remi Pointel. +- Issue #22885: Fixed arbitrary code execution vulnerability in the dbm.dumb + module. Original patch by Claudiu Popa. -- Issue #22770: Prevent some Tk segfaults on OS X when running gui tests. +- Issue #23239: ssl.match_hostname() now supports matching of IP addresses. -- Issue #23211: Workaround test_logging failure on some OS X 10.6 systems. +- Issue #23146: Fix mishandling of absolute Windows paths with forward + slashes in pathlib. -- Issue #23345: Prevent test_ssl failures with large OpenSSL patch level - values (like 0.9.8zc). +- Issue #23096: Pickle representation of floats with protocol 0 now is the same + for both Python and C implementations. -- Issue #22289: Prevent test_urllib2net failures due to ftp connection timeout. +- Issue #19105: pprint now more efficiently uses free space at the right. -Build ------ +- Issue #14910: Add allow_abbrev parameter to argparse.ArgumentParser. Patch by + Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson. -- Issue #15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the configure - script. +- Issue #21717: tarfile.open() now supports 'x' (exclusive creation) mode. -- Issue #22935: Allow the ssl module to be compiled if openssl doesn't support - SSL 3. +- Issue #23344: marshal.dumps() is now 20-25% faster on average. -- Issue #16537: Check whether self.extensions is empty in setup.py. Patch by - Jonathan Hosmer. +- Issue #20416: marshal.dumps() with protocols 3 and 4 is now 40-50% faster on + average. -- Issue #18096: Fix library order returned by python-config. +- Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h. -- Issue #17219: Add library build dir for Python extension cross-builds. +- Issue #23367: Fix possible overflows in the unicodedata module. -- Issue #17128: Use private version of OpenSSL for 3.4.3 OS X 10.5+ installer. +- Issue #23361: Fix possible overflow in Windows subprocess creation code. -C API ------ +- logging.handlers.QueueListener now takes a respect_handler_level keyword + argument which, if set to True, will pass messages to handlers taking handler + levels into account. -- Issue #22079: PyType_Ready() now checks that statically allocated type has - no dynamically allocated bases. +- Issue #19705: turtledemo now has a visual sorting algorithm demo. Original + patch from Jason Yeo. -Documentation -------------- +- Issue #23801: Fix issue where cgi.FieldStorage did not always ignore the + entire preamble to a multipart body. -- Issue #19548: Update the codecs module documentation to better cover the - distinction between text encodings and other codecs, together with other - clarifications. Patch by Martin Panter. +Build +----- -- Issue #22914: Update the Python 2/3 porting HOWTO to describe a more automated - approach. +- Issue #23445: pydebug builds now use "gcc -Og" where possible, to make + the resulting executable faster. -- Issue #21514: The documentation of the json module now refers to new JSON RFC - 7159 instead of obsoleted RFC 4627. +- Issue #23686: Update OS X 10.5 installer build to use OpenSSL 1.0.2a. -Tools/Demos ------------ +C API +----- -- Issue #22314: pydoc now works when the LINES environment variable is set. +- Issue #20204: Deprecation warning is now raised for builtin type without the + __module__ attribute. Windows ------- diff --cc Modules/_pickle.c index 78a4b15a00,19a1c88bd1..2d66f006ac --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@@ -436,12 -425,10 +436,10 @@@ Pdata_grow(Pdata *self new_allocated = (allocated >> 3) + 6; /* check for integer overflow */ - if (new_allocated > PY_SSIZE_T_MAX - allocated) + if (new_allocated > (size_t)PY_SSIZE_T_MAX - allocated) goto nomemory; new_allocated += allocated; - if (new_allocated > ((size_t)PY_SSIZE_T_MAX / sizeof(PyObject *))) - goto nomemory; - data = PyMem_REALLOC(data, new_allocated * sizeof(PyObject *)); + PyMem_RESIZE(data, PyObject *, new_allocated); if (data == NULL) goto nomemory;