[Do Not Merge] Convert Misc/NEWS
so that it is managed by towncrier by dstufft · Pull Request #552 · python/cpython (original) (raw)
This is a demo of a towncrier solution to python/core-workflow#6. It has ported the entire Misc/NEWS
(at the time I forked the branch) to give a comprehensive example. I did not do a very thorough job of correctly determining if a change log entry was for a feature, bugfix, etc instead opting to just do it quickly to get an example finished.
Towncrier will not run on Python 3.x until twisted/towncrier#47 is fixed (I have it patched locally, will send a PR later). In addition, the title (What's new in Python X.Y) will be a bit ugly until twisted/towncrier#46 is solved.
What's New in Python 3.7.0a1?
Release date: 2017-03-07
Core and Builtins
Features
- More than 255 arguments can now be passed to a function. (bpo-12844)
- Python function can now have more than 255 parameters.
collections.namedtuple() now supports tuples with more than 255 elements.
(bpo-18896)
- Added C implementation of asyncio.Future. Original patch by Yury Selivanov.
(bpo-26081)
- Speed-up method calls: add LOAD_METHOD and CALL_METHOD opcodes. (bpo-26110)
- Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize
memcpy(). (bpo-28126)
- Optimize and cleanup dict iteration. (bpo-28183)
- Show sys.version when -V option is supplied twice. (bpo-28532)
- Optimize iterating split table values. Patch by Xiang Zhang. (bpo-28580)
- Sped up converting int to float by reusing faster bits counting
implementation. Patch by Adrian Wielgosik. (bpo-28621)
- Improve speed of the STORE_DEREF opcode by 40%. (bpo-28665)
- Optimize _PyDict_NewPresized() to create correct size dict. Improve speed of
dict literal with constant keys up to 30%. (bpo-28731)
- bytes.fromhex() and bytearray.fromhex() now ignore all ASCII whitespace, not
only spaces. Patch by Robert Xiao. (bpo-28927)
- Call _PyObject_GC_TRACK() lazily when calling Python function. Calling
function is up to 5% faster. (bpo-29049)
- Add ``docstring`` field to Module, ClassDef, FunctionDef, and
AsyncFunctionDef ast nodes. docstring is not first stmt in their body
anymore. It affects ``co_firstlineno`` and ``co_lnotab`` of code object for
module and class. (bpo-29463)
- Improve from-import error message with location and set the 'path' and 'name'
attribute on ImportError for ``from ... import ...``. (bpo-29546)
- Upgrade internal unicode databases to Unicode version 9.0.0. (bpo-unknown)
Removal
~~~~~~~
- Raise DeprecationWarning when async and await keywords are used as
variable/attribute/class/function name. (bpo-26182)
- Creating instances of range_iterator by calling range_iterator type now is
disallowed. Calling iter() on range instance is the only way. Patch by Oren
Milman. (bpo-28376)
- f-string expressions are no longer accepted as docstrings and by
ast.literal_eval() even if they do not include expressions. (bpo-28739)
- Remove the ``PyEval_GetCallStats()`` function and deprecate the untested and
undocumented ``sys.callstats()`` function. Remove the ``CALL_PROFILE``
special build: use the :func:`sys.setprofile` function, :mod:`cProfile` or
:mod:`profile` to profile function calls. (bpo-28799)
- bool(), float(), list() and tuple() no longer take keyword arguments. The
first argument of int() can now be passes only as positional argument.
(bpo-29695)
Bug Fixes
- PyType_Ready() now checks that tp_name is not NULL. Original patch by Niklas Koep. (bpo-18287)
- Extra slash no longer added to sys.path components in case of empty compile- time PYTHONPATH components. (bpo-19398)
- Fixed misleading error message when ImportError called with invalid keyword args. (bpo-21578)
- Rather than silently producing a class that doesn't support zero-argument
super()
in methods, failing to pass the new__classcell__
namespace entry up totype.__new__
now results in aDeprecationWarning
and a class that supports zero-argumentsuper()
. (bpo-23722) - Fixed possible memory leak in _PyTraceback_Add() and exception loss in PyTraceBack_Here(). (bpo-23782)
- Fixed possible crash when AST is changed in process of compiling it. (bpo-24098)
- Correct the positioning of the syntax error caret for indented blocks. Based on patch by Michael Layzell. (bpo-25677)
- Fix a refleak in code that raises DeprecationWarning. (bpo-26182)
- Fix crash when GC runs during weakref callbacks. (bpo-26617)
- Resolving special methods of uninitialized type now causes implicit initialization of the type instead of a fail. (bpo-26906)
- On Android, operating system data is now always encoded/decoded to/from UTF-8, instead of the locale encoding to avoid inconsistencies with os.fsencode() and os.fsdecode() which are already using UTF-8. (bpo-26919)
- Fix not getting the locale's charset upon initializing the interpreter, on platforms that do not have langinfo. (bpo-26920)
- The with-statement now checks for enter before it checks for exit. This gives less confusing error messages when both methods are missing. Patch by Jonathan Ellington. (bpo-27100)
- Clean up redundant code in long_rshift function. Thanks Oren Milman. (bpo-27222)
- Remove some redundant assignments to ob_size in longobject.c. Thanks Oren Milman. (bpo-27441)
- String constants now interned recursively in tuples and frozensets. (bpo-27942)
- Fallback on reading /dev/urandom device when the getrandom() syscall fails with EPERM, for example when blocked by SECCOMP. (bpo-27955)
- Single var-positional argument of tuple subtype was passed unscathed to the C-defined function. Now it is converted to exact tuple. (bpo-28086)
- Fix dict.pop() for splitted dictionary when trying to remove a "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang. (bpo-28120)
- Deprecation warning for invalid str and byte escape sequences now prints better information about where the error occurs. Patch by Serhiy Storchaka and Eric Smith. (bpo-28128)
- Fix a regression in zipimport's compile_source(). zipimport should use the same optimization level as the interpreter. (bpo-28131)
- Fix a memory leak in split-table dictionaries: setattr() must not convert combined table into split table. Patch written by INADA Naoki. (bpo-28147)
- Don't import readline in isolated mode. (bpo-28192)
- Dict reduces possibility of 2nd conflict in hash table when hashes have same lower bits. (bpo-28201)
- Fix incorrect type in complex(1.0, {2:3}) error message. Patch by Soumya Sharma. (bpo-28203)
- Improved exception reporting for problematic set_name attributes by looking up on class instead of instance. (bpo-28214)
- ImportError.init now resets not specified attributes. (bpo-28289)
- String constants with null character no longer interned. (bpo-28350)
- The type of long range iterator is now registered as Iterator. Patch by Oren Milman. (bpo-28376)
- Added sanity checks and tests for PyUnicode_CopyCharacters(). Patch by Xiang Zhang. (bpo-28379)
- Fixed potential crash in PyUnicode_AsDecodedObject() in debug build. (bpo-28426)
- dict.update() no longer allocate unnecessary large memory. (bpo-28509)
- Fixed setting the offset attribute of SyntaxError by PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject(). (bpo-28512)
- Fixed of-by-one error in the peephole optimizer that caused keeping unreachable code. (bpo-28517)
- PyDict_SetDefault didn't combine split table when needed. Patch by Xiang Zhang. (bpo-28583)
- The preferred encoding is UTF-8 on Android. Patch written by Chi Hsuan Yen. (bpo-28596)
- Support rmod for subclasses of str being called before str.mod. Patch by Martijn Pieters. (bpo-28598)
- Fixed crash in Py_DecodeLocale() in debug build on Mac OS X when decode astral characters. Patch by Xiang Zhang. (bpo-28648)
- Fix asynchronous generators aclose() and athrow() to handle StopAsyncIteration propagation properly. (bpo-28721)
- Fix the set_inheritable() file descriptor method on platforms that do not have the ioctl FIOCLEX and FIONCLEX commands. (bpo-28746)
- Fix error position of the unicode error in ASCII and Latin1 encoders when a string returned by the error handler contains multiple non-encodable characters (non-ASCII for the ASCII codec, characters out of the U+0000-U+00FF range for Latin1). (bpo-28774)
- Fix a bug in the implementation
yield from
when checking if the next instruction is YIELD_FROM. Regression introduced by WORDCODE (bpo-26647). (bpo-28782) - Modifying the class dict inside the set_name method of a descriptor that is used inside that class no longer prevents calling the set_name method of other descriptors. (bpo-28797)
- Set correct cause for errors about invalid awaitables returned from aiter and anext. (bpo-28893)
- Fix the cross compilation of xxlimited when Python has been built with Py_DEBUG defined. (bpo-28918)
- Do not include <sys/random.h> if it does not exist. (bpo-28932)
- functools.lru_cache() was susceptible to an obscure reentrancy bug triggerable by a monkey-patched len() function. (bpo-28991)
- Fixed bytes formatting of octals with zero padding in alternate form. (bpo-29000)
- Fix memory leak and use-after-free in os module (path_converter). (bpo-29034)
- Fix regression in bytes(x) when x.index() raises Exception. (bpo-29159)
- Prevent RunMainFromImporter overwriting sys.path[0]. (bpo-29319)
- Fixed a crash when pass the iterable keyword argument to sorted(). (bpo-29327)
- Fixed possible BytesWarning when compare the code objects. Warnings could be emitted at compile time. (bpo-29337)
- Fixed possibly dereferencing undefined pointers when creating weakref objects. (bpo-29347)
- Fixed use-after-free problem in key sharing dict. (bpo-29438)
- Fix incorrect handling of signed zeros in complex constructor for complex subclasses and for inputs having a complex method. Patch by Serhiy Storchaka. (bpo-29602)
- Fix stack_effect computation for CALL_FUNCTION_EX. Patch by Matthieu Dartiailh. (bpo-29607)
- Fixes to memory allocation in _PyCode_SetExtra. Patch by Brian Coleman. (bpo-29683)
- Fix minor regression of PyEval_CallObjectWithKeywords. It should raise TypeError when kwargs is not a dict. But it might cause segv when args=NULL and kwargs is not a dict. (bpo-29684)
- Fix a regression that bytes format may fail when containing zero bytes inside. (bpo-29714)
Misc
- bpo-7777777, bpo-8888888, bpo-9999999
Extension Modules
-----------------
- Update zlib to 1.2.11. (bpo-29169)
Library
-------
Features
- Optimize csv.DictWriter for large number of columns. Patch by Mariatta Wijaya. (bpo-18219)
- random.choices() now has k as a keyword-only argument to improve the readability of common cases and come into line with the signature used in other languages. (bpo-18844)
- Add uuid.SafeUUID and uuid.UUID.is_safe to relay information from the platform about whether generated UUIDs are generated with a multiprocessing safe method. (bpo-22807)
- The webbrowser module now supports Firefox 36+ and derived browsers. Based on patch by Oleg Broytman. (bpo-23262)
- The webbrowser in an X environment now prefers using the default browser directly. Also, the webbrowser register() function now has a documented 'preferred' argument, to specify browsers to be returned by get() with no arguments. Patch by David Steele (bpo-24241)
- Make webbrowser support Chrome on Mac OS X. Patch by Ned Batchelder. (bpo-24452)
- Allow falsy values to be used for msg parameter of subTest(). (bpo-25651)
- Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by Gergely Imreh and Markus Holtermann. (bpo-25895)
- Add new :data:
socket.TCP_CONGESTION
(Linux 2.6.13) and :data:socket.TCP_USER_TIMEOUT
(Linux 2.6.37) constants. Patch written by Omar Sandoval. (bpo-26273) - Generated names for Tkinter widgets now start by the "!" prefix for readability (was "`"). (bpo-27025)
- To assist with upgrades from 2.7, the previously documented deprecation of
inspect.getfullargspec()
has been reversed. This decision may be revisited again after the Python 2.7 branch is no longer officially supported. (bpo-27172) - Optimized merging var-keyword arguments and improved error message when passing a non-mapping as a var-keyword argument. (bpo-27358)
- Command-line interface of the zipfile module now uses argparse. Added support of long options. (bpo-28115)
- bz2 module now supports pathlib. Initial patch by Ethan Furman. (bpo-28225)
- compileall now supports pathlib. (bpo-28226)
- gzip now supports pathlib. Patch by Ethan Furman. (bpo-28227)
- imghdr now supports pathlib. (bpo-28228)
- lzma module now supports pathlib. (bpo-28229)
- Improved error message when passing a non-iterable as a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL. (bpo-28257)
- Speedup asyncio.StreamReader.readexactly. Patch by Коренберг Марк. (bpo-28370)
- Various updates to typing module: typing.Counter, typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa. (bpo-28556)
- Add sys.getandroidapilevel(): return the build time API version of Android as an integer. Function only available on Android. (bpo-28740)
- The extend() method is now called instead of the append() method when unpickle collections.deque and other list-like objects. This can speed up unpickling to 2 times. (bpo-29368)
- Add SlotWrapperType, MethodWrapperType, and MethodDescriptorType built-in types to types module. Original patch by Manuel Krebber. (bpo-29377)
- Allow use of path-like object as a single argument in ConfigParser.read(). Patch by David Ellis. (bpo-29623)
- Method register_function() of xmlrpc.server.SimpleXMLRPCDispatcher and its subclasses can now be used as a decorator. (bpo-7769)
Removal
- Remove the subprocess.Popen.wait endtime parameter. It was deprecated in 3.4
and undocumented prior to that. (bpo-20572)
- timeit: remove ``-c/--clock`` and ``-t/--time`` command line options which
were deprecated since Python 3.3. (bpo-28240)
- Remove vestigial MacOS 9 macurl2path module and its tests. (bpo-28325)
- Deprecated silent truncations in socket.htons and socket.ntohs. Original
patch by Oren Milman. (bpo-28332)
- Deprecate passing asyncio.Handles to run_in_executor. (bpo-28371)
- Removed deprecated features in the http.cookies module. (bpo-29192)
- A format string argument for string.Formatter.format() is now positional-
only. (bpo-29193)
- Removed support of deprecated undocumented keyword arguments in methods of
regular expression objects. (bpo-29195)
- Removed deprecated function ntpath.splitunc(). (bpo-29197)
- Removed support of deprecated argument "exclude" in tarfile.TarFile.add().
(bpo-29210)
- Unused install_misc command is now removed. It has been documented as unused
since 2000. Patch by Eric N. Vander Weele. (bpo-29218)
Bug Fixes
- Fixed recursion errors in large or resized curses.textpad.Textbox. Based on patch by Tycho Andersen. (bpo-13051)
- inspect.getframeinfo() now correctly shows the first line of a context. Patch by Sam Breese. (bpo-15812)
- subprocess.Popen uses /system/bin/sh on Android as the shell, instead of /bin/sh. (bpo-16255)
- urrlib.parse.quote is now based on RFC 3986 and hence includes '~' in the set of characters that is not quoted by default. Patch by Christian Theune and Ratnadeep Debnath. (bpo-16285)
- Fix invalid exception handling in Lib/ctypes/macholib/dyld.py. Patch by Madison May. (bpo-18893)
- Fix bugs in WeakValueDictionary.setdefault() and WeakValueDictionary.pop() when a GC collection happens in another thread. (bpo-19542)
- Makes Path.resolve() succeed on paths that do not exist. Patch by Vajrasky Kok (bpo-19717)
- Fixed a crash in resource.prlimit() when passing a sequence that doesn't own its elements as limits. (bpo-20191)
- The textwrap.TextWrapper class now honors non-breaking spaces. Based on patch by Kaarle Ritvanen. (bpo-20491)
- Fix references leaked by pdb in the handling of SIGINT handlers. (bpo-20766)
- The unittest.mock.sentinel attributes now preserve their identity when they are copied or pickled. (bpo-20804)
- Warning message emitted by using inline flags in the middle of regular expression now contains a (truncated) regex pattern. Patch by Tim Graham. (bpo-22493)
- In the "io" module, the argument to BufferedReader and BytesIO's read1() methods is now optional and can be -1, matching the BufferedIOBase specification. (bpo-23214)
- Reading a corrupt config file left configparser in an invalid state. Original patch by Florian Höch. (bpo-24142)
- Prevent codecs.escape_encode() from raising SystemError when an empty bytestring is passed. (bpo-25270)
- RobotFileParser now correctly returns default values for crawl_delay and request_rate. Initial patch by Peter Wirtz. (bpo-25400)
- Fixed HList.header_exists() in tkinter.tix module by addin a workaround to Tix library bug. (bpo-25464)
- In ctypes, prevent a crash calling the from_buffer() and from_buffer_copy() methods on abstract classes like Array. (bpo-25659)
- re.sub() now raises an error for invalid numerical group reference in replacement template even if the pattern is not found in the string. Error message for invalid group reference now includes the group index and the position of the reference. Based on patch by SilentGhost. (bpo-25953)
- Fixed writing ZIP files that starts not from the start of the file. Offsets in ZIP file now are relative to the start of the archive in conforming to the specification. (bpo-26293)
- Inspect functools.partial in asyncio.Handle.repr. Patch by iceboy. (bpo-26654)
- Fix slow pipes IO in asyncio. Patch by INADA Naoki. (bpo-26909)
- The chown() method of the tarfile.TarFile class does not fail now when the grp module cannot be imported, as for example on Android platforms. (bpo-26937)
- Unknown escapes consisting of
'\'
and an ASCII letter in re.sub() replacement templates regular expressions now are errors. (bpo-27030) - In the traceback module, restore the formatting of exception messages like "Exception: None". This fixes a regression introduced in 3.5a2. (bpo-27348)
- LZMA compressor and decompressor no longer raise exceptions if given empty data twice. Patch by Benjamin Fogle. (bpo-27517)
- Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp(). (bpo-27599)
- Fixed support of default root window in the tkinter.tix module. Added the master parameter in the DisplayStyle constructor. (bpo-27611)
- Fix selectors incorrectly retain invalid file descriptors. Patch by Mark Williams. (bpo-27759)
- Fix a memory leak in os.getrandom() when the getrandom() is interrupted by a signal and a signal handler raises a Python exception. (bpo-27778)
- Fixed possible crash in sqlite3.Connection.create_collation() if pass invalid string-like object as a name. Patch by Xiang Zhang. (bpo-27897)
- Fix socket accept exhaustion during high TCP traffic. Patch by Kevin Conway. (bpo-27906)
- Prevent memory leak in win32_ver(). (bpo-27932)
- Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused by representing the scale as float value internally in Tk. tkinter.IntVar now works if float value is set to underlying Tk variable. (bpo-27939)
- Prohibit Tasks to await on themselves. (bpo-27972)
- Fixed bytes path support in os.scandir() on Windows. Patch by Eryk Sun. (bpo-27998)
- Check for ERROR_ACCESS_DENIED in Windows implementation of os.stat(). Patch by Eryk Sun. (bpo-28075)
- Fix a crash in parse_envlist() when env contains byte strings. Patch by Eryk Sun. (bpo-28114)
- Stop using localtime() and gmtime() in the time module. Introduced platform independent _PyTime_localtime API that is similar to POSIX localtime_r, but available on all platforms. Patch by Ed Schouten. (bpo-28148)
- Handle when SO_REUSEPORT isn't properly supported. Patch by Seth Michael Larson. (bpo-28174)
- Fix callbacks race in asyncio.SelectorLoop.sock_connect. (bpo-28176)
- Get antigravity over HTTPS. Patch by Kaartic Sivaraam. (bpo-28181)
- Fix memory leak on Windows in the os module (fix path_converter() function). (bpo-28200)
- timeit now repeats the benchmarks 5 times instead of only 3 to make benchmarks more reliable. In addition autorange now uses a single loop iteration if the benchmark takes less than 10 seconds, instead of 10 iterations. "python3 -m timeit -s 'import time' 'time.sleep(1)'" now takes 4 seconds instead of 40 seconds. (bpo-28240)
- Fixed calendar functions for extreme months: 0001-01 and 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so that they don't call itermonthdates() which can cause datetime.date under/overflow. (bpo-28253)
- calendar.TextCalendar.prweek() no longer prints a space after a weeks's calendar. calendar.TextCalendar.pryear() no longer prints redundant newline after a year's calendar. Based on patch by Xiang Zhang. (bpo-28255)
- Fixed possible use after free in the decompress() methods of the LZMADecompressor and BZ2Decompressor classes. Original patch by John Leitch. (bpo-28275)
- Fix function declaration (C flags) for the getiterator() method of xml.etree.ElementTree.Element. (bpo-28314)
- The disassembler now decodes FORMAT_VALUE argument. (bpo-28317)
- Fixed writing non-BMP characters with binary format in plistlib. (bpo-28321)
- Fixed possible crashes when unpickle itertools objects from incorrect pickle data. Based on patch by John Leitch. (bpo-28322)
- os.fwalk() no longer fails on broken links. (bpo-28353)
- Refuse monitoring processes if the child watcher has no loop attached. Patch by Vincent Michel. (bpo-28368)
- Raise RuntimeError when transport's FD is used with add_reader, add_writer, etc. (bpo-28369)
- Fix asyncio to support formatting of non-python coroutines. (bpo-28372)
- unittest.mock Mock autospec functions now properly support assert_called, assert_not_called, and assert_called_once. (bpo-28380)
- Fixed possible crash in _io.TextIOWrapper deallocator when the garbage collector is invoked in other thread. Based on patch by Sebastian Cufre. (bpo-28387)
- Remove UNIX socket from FS before binding. Patch by Коренберг Марк. (bpo-28399)
- old keys should not remove new values from WeakValueDictionary when collecting from another thread. (bpo-28427)
- Fix iterator of C implemented asyncio.Future doesn't accept non-None value is passed to it.send(val). (bpo-28430)
- Fix C implemented asyncio.Future didn't work on Windows. (bpo-28448)
- tarfile.open() with mode "r" or "r:" now tries to open a tar file with compression before trying to open it without compression. Otherwise it had 50% chance failed with ignore_zeros=True. (bpo-28449)
- timeit now uses the sequence 1, 2, 5, 10, 20, 50,... instead of 1, 10, 100,... for autoranging. (bpo-28469)
- Fix error building socket module when multithreading is disabled. (bpo-28480)
- shutil.make_archive() no longer adds entry "./" to ZIP archive. (bpo-28488)
- Start a transaction implicitly before a DML statement. Patch by Aviv Palivoda. (bpo-28518)
- In the "http.server" module, parse the protocol version if possible, to avoid using HTTP 0.9 in some error responses. (bpo-28548)
- Fixed segfault in curses's addch() with ncurses6. (bpo-28549)
- Fixed possible DoS and arbitrary code execution when handle plural form selections in the gettext module. The expression parser now supports exact syntax supported by GNU gettext. (bpo-28563)
- Add a test that checks that cwd parameter of Popen() accepts PathLike objects. Patch by Sayan Chowdhury. (bpo-28624)
- Regular expression patterns, _sre.SRE_Pattern objects created by re.compile(), become comparable (only x==y and x!=y operators). This change should fix the issue #18383: don't duplicate warning filters when the warnings module is reloaded (thing usually only done in unit tests). (bpo-28727)
- Fixed the comparison of mock.MagickMock with mock.ANY. (bpo-28735)
- Restored the reduce() methods of datetime objects. (bpo-28752)
- multiprocessing.set_forkserver_preload() would crash the forkserver process if a preloaded module instantiated some multiprocessing objects such as locks. (bpo-28779)
- Fix a regression introduced in warnings.catch_warnings(): call warnings.showwarning() if it was overriden inside the context manager. (bpo-28835)
- dbm.dumb now supports reading read-only files and no longer writes the index file when it is not changed. A deprecation warning is now emitted if the index file is missed and recreated in the 'r' and 'w' modes (will be an error in future Python releases). (bpo-28847)
- Fixed a crash when deallocate deep ElementTree. (bpo-28871)
- Remove editor artifacts from Tix.py. (bpo-28923)
- Fix unittest.mock._Call helper: don't ignore the name parameter anymore. Patch written by Jiajun Huang. (bpo-28961)
- Fix out of bound iteration in asyncio.Future.remove_done_callback implemented in C. (bpo-28963)
- Fixed race condition in C implementation of functools.lru_cache. KeyError could be raised when cached function with full cache was simultaneously called from different threads with the same uncached arguments. (bpo-28969)
- Update authorizer constants in sqlite3 module. Patch by Dingyuan Wang. (bpo-28985)
- Prevent infinite loop in pathlib.resolve() on Windows (bpo-29079)
- Offsets in a ZIP file created with extern file object and modes "w" and "x" now are relative to the start of the file. (bpo-29094)
- Fix datetime.fromtimestamp() regression introduced in Python 3.6.0: check minimum and maximum years. (bpo-29100)
- Fix file object leak in aifc.open() when file is given as a filesystem path and is not in valid AIFF format. Patch by Anthony Zhang. (bpo-29110)
- In urllib.request, suffixes in no_proxy environment variable with leading dots could match related hostnames again (e.g. .b.c matches a.b.c). Patch by Milan Oberkirch. (bpo-29142)
- Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances. (bpo-29219)
- Fix Task.current_task and Task.all_tasks implemented in C to accept None argument as their pure Python implementation. (bpo-29271)
- Fix a regression in argparse that help messages would wrap at non-breaking spaces. (bpo-29290)
- Fix subprocess.Popen.wait() when the child process has exited to a stopped instead of terminated state (ex: when under ptrace). (bpo-29335)
- The help of a builtin or extension class now includes the constructor signature if text_signature is provided for the class. (bpo-29338)
- Fix assertion error in threading._DummyThread.is_alive(). (bpo-29376)
- Prevent infinite loop in pathlib.Path.mkdir (bpo-29416)
- Fixed out-of-bounds buffer access in the group() method of the match object. Based on patch by WGH. (bpo-29444)
- Altering a kwarg dictionary passed to functools.partial() no longer affects a partial object after creation. (bpo-29532)
- Fixed different behaviour of Decimal.from_float() for _decimal and _pydecimal. Thanks Andrew Nester. (bpo-29534)
- Improve some deprecations in importlib. Some deprecated methods now emit DeprecationWarnings and have better descriptive messages. (bpo-29576)
- SimpleXMLRPCDispatcher no longer chains KeyError (or any other exception) to exception(s) raised in the dispatched methods. Patch by Petr Motejlek. (bpo-29615)
- Fix asyncio to support instantiation of new event loops in child processes. (bpo-29703)
- asyncio.subprocess.SubprocessStreamProtocol no longer closes before all pipes are closed. (bpo-29704)
- Migrate sqlite3 module to _v2 API. Patch by Aviv Palivoda. (bpo-9303)
- curses.ascii predicates now work correctly with negative integers. (bpo-9770)
- Distutils.sdist now looks for README and setup.py files with case
sensitivity. This behavior matches that found in Setuptools 6.0 and later.
See
setuptools 100 <https://github.com/pypa/setuptools/issues/100>
_ for rationale. (hide-011698d6-bd92-4321-b872-3a17ce67c9e3) - Fix UnboundLocalError in socket._sendfile_use_sendfile. (hide-e5edf785-97bc-49ff-8b9e-1cb036590314)
Windows
Features
- Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk Sun)
(bpo-28333)
- Adds signed catalog files for stdlib on Windows. (bpo-28402)
Removal
~~~~~~~
- Deprecate WindowsRegistryFinder and disable it by default (bpo-28896)
- Removes readme.txt from the installer. (bpo-29579)
Bug Fixes
- winreg does not truncate string correctly (Patch by Eryk Sun) (bpo-25778)
- launcher.msi has different product codes between 32-bit and 64-bit (bpo-28110)
- Renames Windows path file to ._pth (bpo-28137)
- Windows ._pth file should allow import site (bpo-28138)
- Opening CON for write access fails (bpo-28161)
- WindowsConsoleIO readall() fails if first line starts with Ctrl+Z (bpo-28162)
- WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle (bpo-28163)
- _PyIO_get_console_type fails for various paths (bpo-28164)
- Improvements to help manuals on Windows. (bpo-28251)
- Fixes mishandled buffer reallocation in getpathp.c (bpo-28522)
C API
Features
- Compiler warnings are now emitted if use most of deprecated functions.
(bpo-19569)
- Added functions PySlice_Unpack() and PySlice_AdjustIndices(). (bpo-27867)
Removal
~~~~~~~
- Function PySlice_GetIndicesEx() is deprecated and replaced with a macro if
Py_LIMITED_API is not set or set to the value between 0x03050400 and
0x03060000 (not including) or 0x03060100 or higher. (bpo-27867)
- Deprecated undocumented functions PyUnicode_AsEncodedObject(),
PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
PyUnicode_AsEncodedUnicode(). (bpo-28426)
Bug Fixes
- Private variable _Py_PackageContext is now of type
const char *
rather ofchar *
. (bpo-28748) - The fields name and doc of structures PyMemberDef, PyGetSetDef,
PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase are now of
type
const char *
rather ofchar *
. (bpo-28761) - The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8() is now of type
const char *
rather ofchar *
. (bpo-28769) - PyUnicode_CompareWithASCIIString() now never raises exceptions. (bpo-28808)
- The index parameters start and end of PyUnicode_FindChar() are now
adjusted to behave like
str[start:end]
. (bpo-28822) - All stable API extensions added after Python 3.2 are now available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of the minimum Python version supporting this API. (bpo-29058)
- Fixed the declaration of some public API functions. PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and Py_BuildValue() were not available in limited API of version < 3.3 when PY_SSIZE_T_CLEAN is defined. (bpo-29083)
Documentation
- The data model reference and the porting section in the 3.6 What's New guide
now covers the additional
__classcell__
handling needed for custom metaclasses to fully support PEP 487 and zero-argumentsuper()
. (bpo-23722) - Document smtpd.py as effectively deprecated and add a pointer to aiosmtpd, a third-party asyncio-based replacement. (bpo-25008)
- Add canonical header link on each page to corresponding major version of the documentation. Patch by Matthias Bussonnier. (bpo-26355)
- Documented command-line interface of zipfile. (bpo-28513)
- Link the documentation to its source file on GitHub. (bpo-28929)
- Fix Python 2 syntax in code for building the documentation. (bpo-29349)
Build
Features
- Update Windows build and OS X installers to use SQLite 3.14.2. (bpo-#28208)
- sys.version and the platform module python_build(), python_branch(), and
python_revision() functions now use git information rather than hg when
building from a repo. (bpo-27593)
- Update Windows build and OS X installers to use OpenSSL 1.0.2j. (bpo-28248)
- Update Windows build and OS X installers to use OpenSSL 1.0.2k. (bpo-29572)
Removal
~~~~~~~
- A full copy of libffi is no longer bundled for use when building _ctypes on
non-OSX UNIX platforms. An installed copy of libffi is now required when
building _ctypes on such platforms. (bpo-27979)
- Remove old Be OS helper scripts. (bpo-29384)
Bug Fixes
- Fix out-of-tree building on AIX. Patch by Tristan Carel and Michael Haubenwallner. (bpo-10656)
- Fix building extensions modules on Cygwin. Patch by Roumen Petrov, based on original patch by Jason Tishler. (bpo-13756)
- Remove redundant include search directory option for building outside the source tree. (bpo-15819)
- Do not add the directory for installing C header files and the directory for installing object code libraries to the cross compilation search paths. Original patch by Thomas Petazzoni. (bpo-20211)
- Add configure check for siginfo_t.si_band, which Cygwin does not provide. Patch by Masayuki Yamamoto with review and rebase by Erik Bray. (bpo-21085)
- Fix building the _struct module on Cygwin by passing
NULL
instead of&PyType_Type
to PyVarObject_HEAD_INIT. Patch by Masayuki Yamamoto. (bpo-21124) - Added missed names to PC/python3.def. (bpo-23903)
- Rename --with-optimiations to --enable-optimizations. (bpo-26359)
- setup.py now detects system libffi with multiarch wrapper. (bpo-26661)
- Set Android compilation and link flags. (bpo-26851)
- Prohibit implicit C function declarations: use -Werror=implicit-function- declaration when possible (GCC and Clang, but it depends on the compiler version). Patch written by Chi Hsuan Yen. (bpo-27659)
- Fixed build with Estonian locale (python-config and distclean targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis. (bpo-28258)
- Fix missing extensions modules when cross compiling. (bpo-28444)
- Fix the compilation error that occurs because if_nameindex() is available on Android API level 24, but the if_nameindex structure is not defined. (bpo-28538)
- Prevent missing 'getentropy' declaration warning on macOS. Patch by Gareth Rees. (bpo-28676)
- lockf() is available on Android API level 24, but the F_LOCK macro is not defined in android-ndk-r13. (bpo-28762)
- Fix implicit declaration of function _setmode. Patch by Masayuki Yamamoto (bpo-28768)
- Do not define sys.implementation._multiarch on Android. (bpo-28849)
- Removes hard dependency on hg.exe from PCBuild/build.bat (bpo-29080)
Tools/Demos
Features
- The zipfile module CLI now prints usage to stderr. Patch by Stephen J.
Turnbull. (bpo-28102)
- python-gdb.py now supports also ``method-wrapper`` (``wrapperobject``)
objects. (bpo-29367)
Removal
~~~~~~~
- The pybench and pystone microbenchmark have been removed from Tools. Please
use the new Python benchmark suite https://github.com/python/performance
which is more reliable and includes a portable version of pybench working on
Python 2 and Python 3. (bpo-15369)
Bug Fixes
- Fix python-gdb.py didn't support new dict implementation. (bpo-28023)
Tests
- Various caches now are cleared before running every test file. (bpo-23839)
- Use proper command line parsing in _testembed (bpo-24932)
- Fix the test_socket failures on Android - getservbyname(), getservbyport() and getaddrinfo() are broken on some Android API levels. (bpo-26936)
- Add the support.setswitchinterval() function to fix test_functools hanging on the Android armv7 qemu emulator. (bpo-26939)
- Fix test_posix for Android where 'id -G' is entirely wrong or missing the effective gid. (bpo-26944)
- Skip test_asyncore and test_eintr poll failures on macOS. Skip some tests of select.poll when running on macOS due to unresolved issues with the underlying system poll function on some macOS versions. (bpo-28087)
- Adds _testconsole module to test console input. (bpo-28217)
- regrtest: fix the parser of command line arguments. (bpo-28409)
- Now test.support.rmtree is able to remove unwritable or unreadable directories. (bpo-28666)
- Fix the tests that bind() a unix socket and raise PermissionError on Android for a non-root user. (bpo-28683)
- Disallow -j0 to be combined with -T/-l in regrtest command line arguments. (bpo-28950)
- To match the behaviour of the
re.LOCALE
flag, test_re.test_locale_flag now useslocale.getpreferredencoding(False)
to determine the candidate encoding for the test regex (allowing it to correctly skip the test when the default locale encoding is a multi-byte encoding) (bpo-29571)