News
News
News
Python News
+++++++++++
Build
-----
- Issue #28598: Support __rmod__ for subclasses of str being called before
str.__mod__. Patch by Martijn Pieters.
- Issue #29337: Fixed possible BytesWarning when compare the code objects.
Warnings could be emitted at compile time.
- Issue #29327: Fixed a crash when pass the iterable keyword argument to
sorted().
- Issue #25677: Correct the positioning of the syntax error caret for
indented blocks. Based on patch by Michael Layzell.
- Issue #29000: Fixed bytes formatting of octals with zero padding in alternate
form.
- Issue #28918: Fix the cross compilation of xxlimited when Python has been
built with Py_DEBUG defined.
Extension Modules
-----------------
Library
-------
- bpo-28624: Add a test that checks that cwd parameter of Popen() accepts
PathLike objects. Patch by Sayan Chowdhury.
- Issue #29290: Fix a regression in argparse that help messages would wrap at
non-breaking spaces.
- Issue #29011: Fix an important omission by adding Deque to the typing module.
- Issue #29094: Offsets in a ZIP file created with extern file object and modes
"w" and "x" now are relative to the start of the file.
- Issue #29061: Fixed bug in secrets.randbelow() which would hang when given
a negative input. Patch by Brendan Donegan.
- Issue #28427: old keys should not remove new values from
WeakValueDictionary when collecting from another thread.
- Issue #28847: dbm.dumb now supports reading read-only files and no longer
writes the index file when it is not changed.
- Issue #26937: 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.
Windows
-------
- Issue #29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev)
- Issue #28164: Correctly handle special console filenames (patch by Eryk Sun)
- Issue #29409: Implement PEP 529 for io.FileIO (Patch by Eryk Sun)
- Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
- Issue #25778: winreg does not truncate string correctly (Patch by Eryk Sun)
C API
-----
- Issue #29058: 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.
Documentation
-------------
- Issue #26355: Add canonical header link on each page to corresponding major
version of the documentation. Patch by Matthias Bussonnier.
- Issue #29349: Fix Python 2 syntax in code for building the documentation.
Tests
-----
- Issue #28683: Fix the tests that bind() a unix socket and raise
PermissionError on Android for a non-root user.
Build
-----
- Issue #28762: lockf() is available on Android API level 24, but the F_LOCK
macro is not defined in android-ndk-r13.
- Issue #28538: Fix the compilation error that occurs because if_nameindex() is
available on Android API level 24, but the if_nameindex structure is not
defined.
- Issue #20211: 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.
Tools/Demos
-----------
Windows
-------
Build
-----
- Issue #23722: Rather than silently producing a class that doesn't support
zero-argument ``super()`` in methods, failing to pass the new
``__classcell__`` namespace entry up to ``type.__new__`` now results in a
``DeprecationWarning`` and a class that supports zero-argument ``super()``.
- Issue #28797: 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.
- Issue #28782: Fix a bug in the implementation ``yield from`` when checking
if the next instruction is YIELD_FROM. Regression introduced by WORDCODE
(issue #26647).
Library
-------
- Issue #27172: 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.
C API
-----
Documentation
-------------
- Issue #23722: The data model reference and the porting section in the What's
New guide now cover the additional ``__classcell__`` handling needed for
custom metaclasses to fully support PEP 487 and zero-argument ``super()``.
Tools/Demos
-----------
- Issue #26920: Fix not getting the locale's charset upon initializing the
interpreter, on platforms that do not have langinfo.
Library
-------
- Issue #28563: 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.
- Issue #28652: Make loop methods reject socket kinds they do not support.
Documentation
-------------
- Issue #28513: Documented command-line interface of zipfile.
Tests
-----
- Issue #23839: Various caches now are cleared before running every test file.
Build
-----
- Issue #10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and
Michael Haubenwallner.
- Issue #28128: 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.
- Issue #28517: Fixed of-by-one error in the peephole optimizer that caused
keeping unreachable code.
- Issue #28471: Fix "Python memory allocator called without holding the GIL"
crash in socket.setblocking.
Library
-------
- Issue #23262: The webbrowser module now supports Firefox 36+ and derived
browsers. Based on patch by Oleg Broytman.
- Issue #27025: Generated names for Tkinter widgets now start by the "!" prefix
for readability (was "`").
- Issue #25953: 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.
- Issue #28500: Fix asyncio to handle async gens GC from another thread.
Windows
-------
Build
-----
- Issue #28208: Update Windows build and OS X installers to use SQLite 3.14.2.
- Issue #28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
Tests
-----
- Issue #26944: Fix test_posix for Android where 'id -G' is entirely wrong or
missing the effective gid.
- Issue #28376: The type of long range iterator is now registered as Iterator.
Patch by Oren Milman.
- Issue #28376: The constructor of range_iterator now checks that step is not 0.
Patch by Oren Milman.
- Issue #28201: Dict reduces possibility of 2nd conflict in hash table when
hashes have same lower bits.
- Issue #27942: String constants now interned recursively in tuples and frozensets.
- Issue #21578: Fixed misleading error message when ImportError called with
invalid keyword args.
- Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly
optimize memcpy().
- Issue #28120: Fix dict.pop() for splitted dictionary when trying to remove a
"pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
- Issue #26182: Raise DeprecationWarning when async and await keywords are
used as variable/attribute/class/function name.
Library
-------
- Issue #26293: 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.
- Issue #28380: unittest.mock Mock autospec functions now properly support
assert_called, assert_not_called, and assert_called_once.
- Issue #28321: Fixed writing non-BMP characters with binary format in plistlib.
- Issue #28225: bz2 module now supports pathlib. Initial patch by Ethan Furman.
- Issue #28322: Fixed possible crashes when unpickle itertools objects from
incorrect pickle data. Based on patch by John Leitch.
- Issue #28314: Fix function declaration (C flags) for the getiterator() method
of xml.etree.ElementTree.Element.
- Issue #27611: Fixed support of default root window in the tkinter.tix module.
Added the master parameter in the DisplayStyle constructor.
- Issue #27348: In the traceback module, restore the formatting of exception
messages like "Exception: None". This fixes a regression introduced in
3.5a2.
- Issue #25651: Allow falsy values to be used for msg parameter of subTest().
- Issue #22493: Warning message emitted by using inline flags in the middle of
regular expression now contains a (truncated) regex pattern.
Patch by Tim Graham.
- Issue #28114: Fix a crash in parse_envlist() when env contains byte strings.
Patch by Eryk Sun.
- Issue #27906: Fix socket accept exhaustion during high TCP traffic.
Patch by Kevin Conway.
Windows
-------
- Issue #28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by
Eryk Sun)
- Issue #28110: launcher.msi has different product codes between 32-bit and
64-bit
C API
-----
Build
-----
- Issue #28258: Fixed build with Estonian locale (python-config and distclean
targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis.
- Issue #26661: setup.py now detects system libffi with multiarch wrapper.
- Issue #15819: Remove redundant include search directory option for building
outside the source tree.
Tests
-----
- Issue #27080: Implement formatting support for PEP 515. Initial patch
by Chris Angelico.
- Issue #26331: Implement tokenizing support for PEP 515. Patch by Georg Brandl.
- Issue #27999: Make "global after use" a SyntaxError, and ditto for nonlocal.
Patch by Ivan Levkivskyi.
- Issue #26058: Add a new private version to the builtin dict type, incremented
at each dictionary creation and at each dictionary change. Implementation of
the PEP 509.
- Issue #17884: Python now requires systems with inttypes.h and stdint.h
- Issue #27355: Removed support for Windows CE. It was never finished,
and Windows CE is no longer a relevant platform for Python.
- Issue #27811: Fix a crash when a coroutine that has not been awaited is
finalized with warnings-as-errors enabled.
- Issue #27587: Fix another issue found by PVS-Studio: Null pointer check
after use of 'def' in _PyState_AddModule().
Initial patch by Christian Heimes.
- Issue #27662: Fix an overflow check in ``List_New``: the original code was
checking against ``Py_SIZE_MAX`` instead of the correct upper bound of
``Py_SSIZE_T_MAX``. Patch by Xiang Zhang.
- Issue #27782: Multi-phase extension module import now correctly allows the
``m_methods`` field to be used to add module level functions to instances
of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
- Issue #27157: Make only type() itself accept the one-argument form.
Patch by Eryk Sun and Emanuel Barry.
Library
-------
- Issue #22493: Inline flags now should be used only at the start of the
regular expression. Deprecation warning is emitted if uses them in the
middle of the regular expression.
- Issue #26885: xmlrpc now supports unmarshalling additional data types used
by Apache XML-RPC implementation for numerics and None.
- Issue #19500: Add client-side SSL session resumption to the ssl module.
- Fix possible integer overflows and crashes in the mmap module with unusual
usage patterns.
- Issue #1703178: Fix the ability to pass the --link-objects option to the
distutils build_ext command.
- Issue #18401: Pdb now supports the 'readrc' keyword argument to control
whether .pdbrc files should be read. Patch by Martin Matusiak and
Sam Kimbrel.
- Issue #14977: mailcap now respects the order of the lines in the mailcap
files ("first match"), as required by RFC 1542. Patch by Michael Lazar.
- Issue #28025: Convert all ssl module constants to IntEnum and IntFlags.
SSLContext properties now return flags and enums.
- Issue #28047: Fixed calculation of line length used for the base64 CTE
in the new email policies.
- Issue #24277: The new email API is no longer provisional, and the docs
have been reorganized and rewritten to emphasize the new API.
- Issue #22450: urllib now includes an "Accept: */*" header among the
default headers. This makes the results of REST API requests more
consistent and predictable especially when proxy servers are involved.
- Issue #27570: Avoid zero-length memcpy() etc calls with null source
pointers in the "ctypes" and "array" modules.
- Issue #22233: Break email header lines *only* on the RFC specified CR and LF
characters, not on arbitrary unicode line breaks. This also fixes a bug in
HTTP header parsing.
- Issue 27331: The email.mime classes now all accept an optional policy keyword.
- Issue #27776: The :func:`os.urandom` function does now block on Linux 3.17
and newer until the system urandom entropy pool is initialized to increase
the security. This change is part of the :pep:`524`.
- Issue #27691: Fix ssl module's parsing of GEN_RID subject alternative name
fields in X.509 certs.
- Issue #27850: Remove 3DES from ssl module's default cipher list to counter
measure sweet32 attack (CVE-2016-2183).
- Issue #27766: Add ChaCha20 Poly1305 to ssl module's default ciper list.
(Required OpenSSL 1.1.0 or LibreSSL).
- Issue #11734: Add support for IEEE 754 half-precision floats to the
struct module. Based on a patch by Eli Stevens.
- Remove support for passing a file descriptor to os.access. It never worked but
previously didn't raise.
- Issue #27819: In distutils sdists, simply produce the "gztar" (gzipped tar
format) distributions on all platforms unless "formats" is supplied.
IDLE
----
- Issue #27891: Consistently group and sort imports within idlelib modules.
- Issue #27821: Fix 3.6.0a3 regression that prevented custom key sets
from being selected when no custom theme was defined.
C API
-----
- Issue #26900: Excluded underscored names and other private API from limited API.
Tests
-----
- Issue #27427: Additional tests for the math module. Patch by Francisco Couzo.
- Issue #27953: Skip math and cmath tests that fail on OS X 10.4 due to a
poor libm implementation of tan.
- Issue #26040: Improve test_math and test_cmath coverage and rigour. Patch by
Jeff Allen.
- Issue #27787: Call gc.collect() before checking each test for "dangling
threads", since the dangling threads are weak references.
Build
-----
- Issue #27566: Fix clean target in freeze makefile (patch by Lisa Roach)
- Issue #27976: Deprecate building _ctypes with the bundled copy of libffi on
non-OSX UNIX platforms.
- Issue #26307: The profile-opt build now applies PGO to the built-in modules.
- Issue #26359: Add the --with-optimizations flag to turn on LTO and PGO build
support when available.
Tools/Demos
-----------
Windows
-------
- Issue #1602: Windows console doesn't input or print Unicode (PEP 528)
- Issue #27781: Change file system encoding on Windows to UTF-8 (PEP 529)
- Issue #27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to
codec lookup.
- Issue #27982: The functions of the winsound module now accept keyword
arguments.
- Issue #20366: Build full text search support into SQLite on Windows.
- Issue #27756: Adds new icons for Python files and processes on Windows.
Designs by Cherry Wang.
- Issue #27704: Optimized creating bytes and bytearray from byte-like objects
and iterables. Speed up to 3 times for short objects. Original patch by
Naoki Inada.
- Issue #1621: Avoid signed integer overflow in list and tuple operations.
Patch by Xiang Zhang.
- Issue #27514: Make having too many statically nested blocks a SyntaxError
instead of SystemError.
Library
-------
- Issue #26027, #27524: Add PEP 519/__fspath__() support to the os and os.path
modules. Includes code from Jelle Zijlstra.
- Issue #12345: Add mathematical constant tau to math and cmath. See also
PEP 628.
- Issue #27758: Fix possible integer overflow in the _csv module for large
record lengths.
- Issue #27567: Expose the EPOLLRDHUP and POLLRDHUP constants in the select
module.
- Issue #1621: Avoid signed int negation overflow in the "audioop" module.
IDLE
----
- Issue #27621: Put query response validation error messages in the query
box itself instead of in a separate massagebox. Redo tests to match.
Add Mac OSX refinements. Original patch by Mark Roseman.
- Issue #27609: IDLE: tab after initial whitespace should tab, not
autocomplete. This fixes problem with writing docstrings at least
twice indented.
- Issue #27609: Explicitly return None when there are also non-None
returns. In a few cases, reverse a condition and eliminate a return.
- Issue #25507: IDLE no longer runs buggy code because of its tkinter imports.
Users must include the same imports required to run directly in Python.
- Issue #27173: Add 'IDLE Modern Unix' to the built-in key sets.
Make the default key set depend on the platform.
Add tests for the changes to the config module.
- Issue #27452: add line counter and crc to IDLE configHandler test dump.
Tests
-----
- Issue #25805: Skip a test in test_pkgutil as needed that doesn't work when
``__name__ == __main__``. Patch by SilentGhost.
- Issue #27594: Prevent assertion error when running test_ast with coverage
enabled: ensure code object has a valid first line number.
Patch suggested by Ivan Levkivskyi.
Windows
-------
- Issue #27469: Adds a shell extension to the launcher so that drag and drop
works correctly.
Build
-----
- Issue #27641: The configure script now inserts comments into the makefile
to prevent the pgen and _freeze_importlib executables from being cross-
compiled.
- Issue #23034: The output of a special Python build with defined COUNT_ALLOCS,
SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by default. It can
be re-enabled using the "-X showalloccount" option. It now outputs to stderr
instead of stdout.
- Issue #27007: The fromhex() class methods of bytes and bytearray subclasses
now return an instance of corresponding subclass.
Library
-------
- Issue #23804: Fix SSL zero-length recv() calls to not block and not raise
an error about unclean EOF.
- Issue #21708: Deprecated dbm.dumb behavior that differs from common dbm
behavior: creating a database in 'r' and 'w' modes and modifying a database
in 'r' mode.
- Issue #27294: Numerical state in the repr for Tkinter event objects is now
represented as a combination of known flags.
- Issue #27177: Match objects in the re module now support index-like objects
as group indices. Based on patches by Jeroen Demeyer and Xiang Zhang.
- Issue #27238: Got rid of bare excepts in the turtle module. Original patch
by Jelle Zijlstra.
- Issue #27122: When an exception is raised within the context being managed
by a contextlib.ExitStack() and one of the exit stack generators
catches and raises it in a chain, do not re-raise the original exception
when exiting, let the new chained one through. This avoids the PEP 479
bug described in issue25782.
- Issue #8637: Honor a pager set by the env var MANPAGER (in preference to
one set by the env var PAGER).
- Issue #16182: Fix various functions in the "readline" module to use the
locale encoding, and fix get_begidx() and get_endidx() to return code point
indexes.
IDLE
----
- Issue #27173: Add 'IDLE Modern Unix' to the built-in key sets.
Make the default key set depend on the platform.
Add tests for the changes to the config module.
- Issue #27452: add line counter and crc to IDLE configHandler test dump.
- Issue #27380: IDLE: add query.py with base Query dialog and ttk widgets.
Module had subclasses SectionName, ModuleName, and HelpSource, which are
used to get information from users by configdialog and file =>Load Module.
Each subclass has itw own validity checks. Using ModuleName allows users
to edit bad module names instead of starting over.
Add tests and delete the two files combined into the new one.
- Issue #27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names.
- Issue #27245: IDLE: Cleanly delete custom themes and key bindings.
Previously, when IDLE was started from a console or by import, a cascade
of warnings was emitted. Patch by Serhiy Storchaka.
- Issue #24137: Run IDLE, test_idle, and htest with tkinter default root
disabled. Fix code and tests that fail with this restriction. Fix htests to
not create a second and redundant root and mainloop.
C API
-----
Build
-----
- Issue #28066: Fix the logic that searches build directories for generated
include files when building outside the source tree.
- Issue #27442: Expose the Android API level that python was built against, in
sysconfig.get_config_vars() as 'ANDROID_API_LEVEL'.
- Issue #27434: The interpreter that runs the cross-build, found in PATH, must
now be of the same feature version (e.g. 3.6) as the source being built.
Tools/Demos
-----------
- Issue #27332: Fixed the type of the first argument of module-level functions
generated by Argument Clinic. Patch by Petr Viktorin.
Documentation
-------------
- Issue #19489: Moved the search box from the sidebar to the header and footer
of each page. Patch by Ammar Askar.
Tests
-----
- Issue #27186: Add support for os.PathLike objects to open() (part of PEP 519).
- Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode.
Patch by Demur Rumed.
Library
-------
- Issue #27025: Generated names for Tkinter widgets are now more meanful
and recognizirable.
- Issue #23883: Added missing APIs to __all__ to match the documented APIs
for the following modules: cgi, mailbox, mimetypes, plistlib and smtpd.
Patches by Jacek Koodziej.
- Issue #27164: In the zlib module, allow decompressing raw Deflate streams
with a predefined zdict. Based on patch by Xiang Zhang.
- signal, socket, and ssl module IntEnum constant name lookups now return a
consistent name for values having multiple names. Ex: signal.Signals(6)
now refers to itself as signal.SIGALRM rather than flipping between that
and signal.SIGIOT based on the interpreter's hash randomization seed.
IDLE
----
- Issue #5124: Paste with text selected now replaces the selection on X11.
This matches how paste works on Windows, Mac, most modern Linux apps,
and ttk widgets. Original patch by Serhiy Storchaka.
- Issue #27262: move Aqua unbinding code, which enable context menus, to maxosx.
- Issue #27117: Make colorizer htest and turtledemo work with dark themes.
Move code for configuring text widget colors to a new function.
- Issue #24225: Rename many `idlelib/*.py` and `idle_test/test_*.py` files.
Edit files to replace old names with new names when the old name
referred to the module rather than the class it contained.
See the issue and IDLE section in What's New in 3.6 for more.
Documentation
-------------
- Issue #16484: Change the default PYTHONDOCS URL to "https:", and fix the
resulting links to use lowercase. Patch by Sean Rodman, test by Kaushik
Nadikuditi.
- Issue #24136: Document the new PEP 448 unpacking syntax of 3.5.
- Issue #22558: Add remaining doc links to source code for Python-coded modules.
Patch by Yoni Lavi.
Tests
-----
- Issue #25285: regrtest now uses subprocesses when the -j1 command line option
is used: each test file runs in a fresh child process. Before, the -j1 option
was ignored.
Windows
-------
Build
-----
- Issue #27229: Fix the cross-compiling pgen rule for in-tree builds. Patch
by Xavier de Gaye.
- Issue #26930: Update OS X 10.5+ 32-bit-only installer to build
and link with OpenSSL 1.0.2h.
Misc
----
C API
-----
Tools/Demos
-----------
- Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"
format unit.
- Issue #26991: Fix possible refleak when creating a function with annotations.
- Issue #27039: Fixed bytearray.remove() for values greater than 127. Based on
patch by Joe Jevnik.
- Issue #27005: Optimized the float.fromhex() class method for exact float.
It is now 2 times faster.
- Issue #26659: Make the builtin slice type support cycle collection.
- Issue #25339: PYTHONIOENCODING now has priority over locale in setting the
error handler for stdin and stdout.
- Issue #21099: Switch applicable importlib tests to use PEP 451 API.
- Issue #26563: Debug hooks on Python memory allocators now raise a fatal
error if functions of the :c:func:`PyMem_Malloc` family are called without
holding the GIL.
- Issue #26564: On error, the debug hooks on Python memory allocators now use
the :mod:`tracemalloc` module to get the traceback where a memory block was
allocated.
- Issue #26516: In debug mode, debug hooks are now also installed on Python
memory allocators when Python is configured without pymalloc.
- Issue #26464: Fix str.translate() when string is ASCII and first replacements
removes character, but next replacement uses a non-ASCII character or a
string longer than 1 character. Regression introduced in Python 3.5.0.
- Issue #26204: The compiler now ignores all constant statements: bytes, str,
int, float, complex, name constants (None, False, True), Ellipsis
and ast.Constant; not only str and int. For example, ``1.0`` is now ignored
in ``def f(): 1.0``.
- Issue #4806: Avoid masking the original TypeError exception when using star
(*) unpacking in function calls. Based on patch by Hagen Frstenau and
Daniel Urban.
- Issue #26146: Add a new kind of AST node: ``ast.Constant``. It can be used
by external AST optimizers, but the compiler does not emit directly such
node.
- Issue #25843: When compiling code, don't merge constants if they are equal
but have a different types. For example, ``f1, f2 = lambda: 1, lambda: 1.0``
is now correctly compiled to two different functions: ``f1()`` returns ``1``
(``int``) and ``f2()`` returns ``1.0`` (``float``), even if ``1`` and ``1.0``
are equal.
- Issue #25973: Fix segfault when an invalid nonlocal statement binds a name
starting with two underscores.
- Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
- Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
- Issue #25709: Fixed problem with in-place string concatenation and utf-8
cache.
- Issue #5319: New Py_FinalizeEx() API allowing Python to set an exit status
of 120 on failure to flush buffered streams.
- Issue #25388: Fixed tokenizer crash when processing undecodable source code
with a null byte.
- Issue #25462: The hash of the key now is calculated only once in most
operations in C implementation of OrderedDict.
- Issue #24802: Avoid buffer overreads when int(), float(), compile(), exec()
and eval() are passed bytes-like objects. These objects are not
necessarily terminated by a null byte, but the functions assumed they were.
- Issue #25555: Fix parser and AST: fill lineno and col_offset of "arg" node
when compiling AST from Python objects.
- Issue #24726: Fixed a crash and leaking NULL in repr() of OrderedDict that
was mutated by direct calls of dict methods.
- Issue #25449: Iterating OrderedDict with keys with unstable hash now raises
KeyError in C implementations as well as in Python implementation.
- Issue #25395: Fixed crash when highly nested OrderedDict structures were
garbage collected.
- Issue #25399: Optimize bytearray % args using the new private _PyBytesWriter
API. Formatting is now between 2.5 and 5 times faster.
- Issue #25349: Optimize bytes % args using the new private _PyBytesWriter API.
Formatting is now up to 2 times faster.
- Issue #24806: Prevent builtin types that are not allowed to be subclassed from
being subclassed through multiple inheritance.
- Issue #25301: The UTF-8 decoder is now up to 15 times as fast for error
handlers: ``ignore``, ``replace`` and ``surrogateescape``.
- Issue #25267: The UTF-8 encoder is now up to 75 times as fast for error
handlers: ``ignore``, ``replace``, ``surrogateescape``, ``surrogatepass``.
Patch co-written with Serhiy Storchaka.
- Issue #25280: Import trace messages emitted in verbose (-v) mode are no
longer formatted twice.
- Issue #25227: Optimize ASCII and latin1 encoders with the ``surrogateescape``
error handler: the encoders are now up to 3 times as fast. Initial patch
written by Serhiy Storchaka.
- Issue #26478: Fix semantic bugs when using binary operators with dictionary
views and tuples.
- Issues #26289 and #26315: Optimize floor and modulo division for
single-digit longs. Microbenchmarks show 2-2.5x improvement. Built-in
'divmod' function is now also ~10% faster.
Library
-------
- Issue #27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure!
- Issue #14132: Fix urllib.request redirect handling when the target only has
a query string. Original fix by Jn Janech.
- Issue #26039: zipfile.ZipFile.open() can now be used to write data into a ZIP
file, as well as for extracting data. Patch by Thomas Kluyver.
- Issue #26977: Removed unnecessary, and ignored, call to sum of squares helper
in statistics.pvariance.
- Issue #26881: The modulefinder module now supports extended opcode arguments.
- Issue #26915: The __contains__ methods in the collections ABCs now check
for identity before checking equality. This better matches the behavior
of the concrete classes, allows sensible handling of NaNs, and makes it
easier to reason about container invariants.
The bug only occurs on SunOS when the ctypes implementation searches
for the `crle` program. Patch by Xiang Zhang. Tested on SunOS by
Kees Bos.
- Issue #26733: Disassembling a class now disassembles class and static methods.
Patch by Xiang Zhang.
- Issue #24838: tarfile's ustar and gnu formats now correctly calculate name
and link field limits for multibyte character encodings like utf-8.
- Issue #26717: Stop encoding Latin-1-ized WSGI paths with UTF-8. Patch by
Anthony Sottile.
- Issue #26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading
more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of
1024 bytes per call.
- Issue #26587: the site module now allows .pth files to specify files to be
added to sys.path (e.g. zip files).
- Issue #23735: Handle terminal resizing with Readline 6.3+ by installing our
own SIGWINCH handler. Patch by Eric Price.
- Issue #26586: In http.server, respond with "413 Request header fields too
large" if there are too many header fields to parse, rather than killing
the connection and raising an unhandled exception. Patch by Xiang Zhang.
- Issue #26492: Exhausted iterator of array.array now conforms with the behavior
of iterators of other mutable sequences: it lefts exhausted even if iterated
array is extended.
- Issue #23804: Fix SSL recv(0) and read(0) methods to return zero bytes
instead of up to 1024.
- Issue #24266: Ctrl+C during Readline history search now cancels the search
mode when compiled with Readline 7.
- Issue #26590: Implement a safe finalizer for the _socket.socket type. It now
releases the GIL to close the socket.
- Issue #23718: Fixed parsing time in week 0 before Jan 1. Original patch by
Tams Bence Gedai.
- Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets.
- Issue #25718: Fixed pickling and copying the accumulate() iterator with
total is None.
- Issue #26475: Fixed debugging output for regular expressions with the (?x)
flag.
- Issue #26335: Make mmap.write() return the number of bytes written like
other write methods. Patch by Jakub Stasiak.
- Issue #26457: Fixed the subnets() methods in IP network classes for the case
when resulting prefix length is equal to maximal prefix length.
Based on patch by Xiang Zhang.
- Issue #26402: Fix XML-RPC client to retry when the server shuts down a
persistent connection. This was a regression related to the new
http.client.RemoteDisconnected exception in 3.5.0a4.
- Issue #26309: In the "socketserver" module, shut down the request (closing
the connected socket) when verify_request() returns false. Patch by Aviv
Palivoda.
- Issue #25995: os.walk() no longer uses FDs proportional to the tree depth.
- Issue #25994: Added the close() method and the support of the context manager
protocol for the os.scandir() iterator.
- Issue #26117: The os.scandir() iterator now closes file descriptor not only
when the iteration is finished, but when it was failed with error.
- Issue #25949: __dict__ for an OrderedDict instance is now created only when
needed.
- Issue #25945: Fixed a crash when unpickle the functools.partial object with
wrong state. Fixed a leak in failed functools.partial constructor.
"args" and "keywords" attributes of functools.partial have now always types
tuple and dict correspondingly.
- Issue #26099: The site module now writes an error into stderr if
sitecustomize module can be imported but executing the module raise an
ImportError. Same change for usercustomize.
- Issue #26147: xmlrpc now works with strings not encodable with used
non-UTF-8 encoding.
- Issue #25935: Garbage collector now breaks reference loops with OrderedDict.
- Issue #25447: fileinput now uses sys.stdin as-is if it does not have a
buffer attribute (restores backward compatibility).
- Issue #25971: Optimized creating Fractions from floats by 2 times and from
Decimals by 3 times.
- Issue #25447: Copying the lru_cache() wrapper object now always works,
independently from the type of the wrapped object (by returning the original
object unchanged).
- Issue #6478: _strptime's regexp cache now is reset after changing timezone
with time.tzset().
- Issue #14285: When executing a package with the "python -m package" option,
and package initialization fails, a proper traceback is now reported. The
"runpy" module now lets exceptions from package initialization pass back to
the caller, rather than raising ImportError.
- Issue #19771: Also in runpy and the "-m" option, omit the irrelevant
message ". . . is a package and cannot be directly executed" if the package
could not even be initialized (e.g. due to a bad ``*.pyc`` file).
- Issue #25177: Fixed problem with the mean of very small and very large
numbers. As a side effect, statistics.mean and statistics.variance should
be significantly faster.
- Issue #25718: Fixed copying object with state with boolean value is false.
- Issue #25624: ZipFile now always writes a ZIP_STORED header for directory
entries. Patch by Dingyuan Wang.
- Issue #25626: Change three zlib functions to accept sizes that fit in
Py_ssize_t, but internally cap those sizes to UINT_MAX. This resolves a
regression in 3.5 where GzipFile.read() failed to read chunks larger than 2
or 4 GiB. The change affects the zlib.Decompress.decompress() max_length
parameter, the zlib.decompress() bufsize parameter, and the
zlib.Decompress.flush() length parameter.
- Issue #23883: Added missing APIs to __all__ to match the documented APIs
for the following modules: calendar, csv, enum, fileinput, ftplib, logging,
optparse, tarfile, threading and wave. Also added a
test.support.check__all__() helper. Patches by Jacek Koodziej, Mauro
S. M. Rodrigues and Joel Taddei.
- Issue #25590: In the Readline completer, only call getattr() once per
attribute. Also complete names of attributes such as properties and slots
which are listed by dir() but not yet created on an instance.
- Issue #25584: Added "escape" to the __all__ list in the glob module.
- Issue #25584: Fixed recursive glob() with patterns starting with '\*\*'.
- Issue #18010: Fix the pydoc web server's module search function to handle
exceptions from importing packages.
- Issue #18973: Command-line interface of the calendar module now uses argparse
instead of optparse.
- Issue #21827: Fixed textwrap.dedent() for the case when largest common
whitespace is a substring of smallest leading whitespace.
Based on patch by Robert Li.
- Issue #25447: The lru_cache() wrapper objects now can be copied and pickled
(by returning the original object unchanged).
- Issue #25441: asyncio: Raise error from drain() when socket is closed.
- Issue #25382: pickletools.dis() now outputs implicit memo index for the
MEMOIZE opcode.
- Issue #24164: Objects that need calling ``__new__`` with keyword arguments,
can now be pickled using pickle protocols older than protocol version 4.
- Issue #25232: Fix CGIRequestHandler to split the query from the URL at the
first question mark (?) rather than the last. Patch from Xiang Zhang.
- Issue #25011: rlcompleter now omits private and special attribute names unless
the prefix starts with underscores.
- Issue #25209: rlcompleter now can add a space or a colon after completed
keyword.
- Issue #23552: Timeit now warns when there is substantial (4x) variance
between best and worst times. Patch from Serhiy Storchaka.
- Issue #24879: help() and pydoc can now list named tuple fields in the
order they were defined rather than alphabetically. The ordering is
determined by the _fields attribute if present.
- Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond.
- Issue #2091: open() accepted a 'U' mode string containing '+', but 'U' can
only be used with 'r'. Patch from Jeff Balogh and John O'Connor.
- Issue #8585: improved tests for zipimporter2. Patch from Mark Lawrence.
- Issue #25530: Disable the vulnerable SSLv3 protocol by default when creating
ssl.SSLContext.
IDLE
----
- Issue #24455: Prevent IDLE from hanging when a) closing the shell while the
debugger is active (15347); b) closing the debugger with the [X] button
(15348); and c) activating the debugger when already active (24455).
The patch by Mark Roseman does this by making two changes.
1. Suspend and resume the gui.interaction method with the tcl vwait
mechanism intended for this purpose (instead of root.mainloop & .quit).
2. In gui.run, allow any existing interaction to terminate first.
- Issue #24750: Improve the appearance of the IDLE editor window status bar.
Patch by Mark Roseman.
- Issue #25313: Change the handling of new built-in text color themes to better
address the compatibility problem introduced by the addition of IDLE Dark.
Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
- Issue #24782: Extension configuration is now a tab in the IDLE Preferences
dialog rather than a separate dialog. The former tabs are now a sorted
list. Patch by Mark Roseman.
- Issue #22726: Re-activate the config dialog help button with some content
about the other buttons and the new IDLE Dark theme.
- Issue #24820: IDLE now has an 'IDLE Dark' built-in text color theme.
It is more or less IDLE Classic inverted, with a cobalt blue background.
Strings, comments, keywords, ... are still green, red, orange, ... .
To use it with IDLEs released before November 2015, hit the
'Save as New Custom Theme' button and enter a new name,
such as 'Custom Dark'. The custom theme will work with any IDLE
release, and can be modified.
- Issue #25224: README.txt is now an idlelib index for IDLE developers and
curious users. The previous user content is now in the IDLE doc chapter.
'IDLE' now means 'Integrated Development and Learning Environment'.
- Issue #24570: Idle: make calltip and completion boxes appear on Macs
affected by a tk regression. Initial patch by Mark Roseman.
- Issue #24801: Make right-click for context menu work on Mac Aqua.
Patch by Mark Roseman.
- Issue #25198: Enhance the initial html viewer now used for Idle Help.
* Properly indent fixed-pitch text (patch by Mark Roseman).
* Give code snippet a very Sphinx-like light blueish-gray background.
* Re-use initial width and height set by users for shell and editor.
* When the Table of Contents (TOC) menu is used, put the section header
at the top of the screen.
- Issue #25225: Condense and rewrite Idle doc section on text colors.
- Issue #21995: Explain some differences between IDLE and console Python.
- Issue #22820: Explain need for *print* when running file from Idle editor.
- Issue #25224: Doc: augment Idle feature list and no-subprocess section.
- Issue #16893: Replace help.txt with help.html for Idle doc display.
The new idlelib/help.html is rstripped Doc/build/html/library/idle.html.
It looks better than help.txt and will better document Idle as released.
The tkinter html viewer that works for this file was written by Rose Roseman.
The now unused EditorWindow.HelpDialog class and helt.txt file are deprecated.
- Issue #24790: Remove extraneous code (which also create 2 & 3 conflicts).
Documentation
-------------
- Issue #26736: Used HTTPS for external links in the documentation if possible.
Tests
-----
- Issue #21916: Added tests for the turtle module. Patch by ingrid,
Gregory Loyse and Jelle Zijlstra.
- Issue #26015: Added new tests for pickling iterators of mutable sequences.
- Issue #25940: Changed test_ssl to use its internal local server more. This
avoids relying on svn.python.org, which recently changed root certificate.
- Issue #18174: ``python -m test --huntrleaks ...`` now also checks for leak of
file descriptors. Patch written by Richard Oudkerk.
Build
-----
- Issue #22359: Disable the rules for running _freeze_importlib and pgen when
cross-compiling. The output of these programs is normally saved with the
source code anyway, and is still regenerated when doing a native build.
Patch by Xavier de Gaye.
- Issue #25702: A --with-lto configure option has been added that will
enable link time optimizations at build time during a make profile-opt.
Some compilers and toolchains are known to not produce stable code when
using LTO, be sure to test things thoroughly before relying on it.
It can provide a few % speed up over profile-opt alone.
- Issue #26079: Fixing the build output folder for tix-8.4.3.6. Patch by
Bjoern Thiel.
- Issue #25827: Add support for building with ICC to ``configure``, including
a new ``--with-icc`` flag.
- Issue #25136: Support Apple Xcode 7's new textual SDK stub libraries.
Windows
-------
Tools/Demos
-----------
- Issue #26799: Fix python-gdb.py: don't get C types once when the Python code
is loaded, but get C types on demand. The C types can change if
python-gdb.py is loaded before the Python executable. Patch written by Thomas
Ilsche.
- Issue #26271: Fix the Freeze tool to properly use flags passed through
configure. Patch by Daniel Shaulov.
- Issue #26312: SystemError is now raised in all programming bugs with using
PyArg_ParseTupleAndKeywords(). RuntimeError did raised before in some
programming bugs.
- Issue #25677: Correct the positioning of the syntax error caret for
indented blocks. Based on patch by Michael Layzell.
- Issue #29000: Fixed bytes formatting of octals with zero padding in alternate
form.
- Issue #28376: The type of long range iterator is now registered as Iterator.
Patch by Oren Milman.
- Issue #28376: The constructor of range_iterator now checks that step is not 0.
Patch by Oren Milman.
- Issue #27942: String constants now interned recursively in tuples and frozensets.
- Issue #21578: Fixed misleading error message when ImportError called with
invalid keyword args.
- Issue #27811: Fix a crash when a coroutine that has not been awaited is
finalized with warnings-as-errors enabled.
- Issue #27587: Fix another issue found by PVS-Studio: Null pointer check
after use of 'def' in _PyState_AddModule().
Initial patch by Christian Heimes.
- Issue #26020: set literal evaluation order did not match documented behaviour.
- Issue #27782: Multi-phase extension module import now correctly allows the
``m_methods`` field to be used to add module level functions to instances
of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
- Issue #27514: Make having too many statically nested blocks a SyntaxError
instead of SystemError.
Library
-------
- Issue #29094: Offsets in a ZIP file created with extern file object and modes
"w" and "x" now are relative to the start of the file.
- Issue #28427: old keys should not remove new values from
WeakValueDictionary when collecting from another thread.
- Issue 28923: Remove editor artifacts from Tix.py.
- Issue #28847: dbm.dumb now supports reading read-only files and no longer
writes the index file when it is not changed.
- Issue #28449: 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.
- Issue #23262: The webbrowser module now supports Firefox 36+ and derived
browsers. Based on patch by Oleg Broytman.
- Issue #26293: 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.
- Issue #28321: Fixed writing non-BMP characters with binary format in plistlib.
- Issue #28322: Fixed possible crashes when unpickle itertools objects from
incorrect pickle data. Based on patch by John Leitch.
- Fix possible integer overflows and crashes in the mmap module with unusual
usage patterns.
- Issue #1703178: Fix the ability to pass the --link-objects option to the
distutils build_ext command.
- Issue #27611: Fixed support of default root window in the tkinter.tix module.
- Issue #25651: Allow falsy values to be used for msg parameter of subTest().
- Issue #14977: mailcap now respects the order of the lines in the mailcap
files ("first match"), as required by RFC 1542. Patch by Michael Lazar.
- Issue #28047: Fixed calculation of line length used for the base64 CTE
in the new email policies.
- Issue #22450: urllib now includes an "Accept: */*" header among the
default headers. This makes the results of REST API requests more
consistent and predictable especially when proxy servers are involved.
- Issue #27570: Avoid zero-length memcpy() etc calls with null source
pointers in the "ctypes" and "array" modules.
- Issue #22233: Break email header lines *only* on the RFC specified CR and LF
characters, not on arbitrary unicode line breaks. This also fixes a bug in
HTTP header parsing.
- Issue #27691: Fix ssl module's parsing of GEN_RID subject alternative name
fields in X.509 certs.
- Issue #27850: Remove 3DES from ssl module's default cipher list to counter
measure sweet32 attack (CVE-2016-2183).
- Issue #27766: Add ChaCha20 Poly1305 to ssl module's default ciper list.
(Required OpenSSL 1.1.0 or LibreSSL).
- Remove support for passing a file descriptor to os.access. It never worked but
previously didn't raise.
- Issue #12885: Fix error when distutils encounters symlink.
- Issue #27758: Fix possible integer overflow in the _csv module for large
record lengths.
- Issue #23804: Fix SSL zero-length recv() calls to not block and not raise
an error about unclean EOF.
- Issue #27238: Got rid of bare excepts in the turtle module. Original patch
by Jelle Zijlstra.
- Issue #27122: When an exception is raised within the context being managed
by a contextlib.ExitStack() and one of the exit stack generators
catches and raises it in a chain, do not re-raise the original exception
when exiting, let the new chained one through. This avoids the PEP 479
bug described in issue25782.
- Issue #16182: Fix various functions in the "readline" module to use the
locale encoding, and fix get_begidx() and get_endidx() to return code point
indexes.
- Issue #27906: Fix socket accept exhaustion during high TCP traffic.
Patch by Kevin Conway.
- Issue #28652: Make loop methods reject socket kinds they do not support.
IDLE
----
- Issue #27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
- Issue #25507: IDLE no longer runs buggy code because of its tkinter imports.
Users must include the same imports required to run directly in Python.
- Issue #27452: add line counter and crc to IDLE configHandler test dump.
- Issue #27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names.
- Issue #27245: IDLE: Cleanly delete custom themes and key bindings.
Previously, when IDLE was started from a console or by import, a cascade
of warnings was emitted. Patch by Serhiy Storchaka.
C API
-----
Tests
-----
- Issue #23839: Various caches now are cleared before running every test file.
- Issue #27787: Call gc.collect() before checking each test for "dangling
threads", since the dangling threads are weak references.
Tools/Demos
-----------
- Issue #27332: Fixed the type of the first argument of module-level functions
generated by Argument Clinic. Patch by Petr Viktorin.
Windows
-------
- Issue #28110: launcher.msi has different product codes between 32-bit and
64-bit
- Issue #27469: Adds a shell extension to the launcher so that drag and drop
works correctly.
Build
-----
- Issue #28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
- Issue #28258: Fixed build with Estonian locale (python-config and distclean
targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis.
- Issue #26661: setup.py now detects system libffi with multiarch wrapper.
- Issue #28066: Fix the logic that searches build directories for generated
include files when building outside the source tree.
- Issue #15819: Remove redundant include search directory option for building
outside the source tree.
- Issue #27566: Fix clean target in freeze makefile (patch by Lisa Roach)
- Issue #26307: The profile-opt build now applies PGO to the built-in modules.
- Issue #27641: The configure script now inserts comments into the makefile
to prevent the pgen and _freeze_importlib executables from being cross-
compiled.
Tests
-----
IDLE
----
- Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"
format unit.
- Issue #26991: Fix possible refleak when creating a function with annotations.
- Issue #27039: Fixed bytearray.remove() for values greater than 127. Patch by
Joe Jevnik.
- Issue #26659: Make the builtin slice type support cycle collection.
- Issue #25339: PYTHONIOENCODING now has priority over locale in setting the
error handler for stdin and stdout.
- Issue #26464: Fix str.translate() when string is ASCII and first replacements
removes character, but next replacement uses a non-ASCII character or a
string longer than 1 character. Regression introduced in Python 3.5.0.
- Issue #4806: Avoid masking the original TypeError exception when using star
(*) unpacking in function calls. Based on patch by Hagen Frstenau and
Daniel Urban.
- Issue #26194: Deque.insert() gave odd results for bounded deques that had
reached their maximum size. Now an IndexError will be raised when attempting
to insert into a full deque.
- Issue #25843: When compiling code, don't merge constants if they are equal
but have a different types. For example, ``f1, f2 = lambda: 1, lambda: 1.0``
is now correctly compiled to two different functions: ``f1()`` returns ``1``
(``int``) and ``f2()`` returns ``1.0`` (``int``), even if ``1`` and ``1.0``
are equal.
- Issue #22995: [UPDATE] Comment out the one of the pickleability tests in
_PyObject_GetState() due to regressions observed in Cython-based projects.
- Issue #25973: Fix segfault when an invalid nonlocal statement binds a name
starting with two underscores.
- Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
- Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
- Issue #25709: Fixed problem with in-place string concatenation and utf-8
cache.
- Issue #26478: Fix semantic bugs when using binary operators with dictionary
views and tuples.
Library
-------
- Issue #27164: In the zlib module, allow decompressing raw Deflate streams
with a predefined zdict. Based on patch by Xiang Zhang.
- Issue #27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure!
- Issue #14132: Fix urllib.request redirect handling when the target only has
a query string. Original fix by Jn Janech.
- Issue #26977: Removed unnecessary, and ignored, call to sum of squares helper
in statistics.pvariance.
- Issue #26881: The modulefinder module now supports extended opcode arguments.
The bug only occurs on SunOS when the ctypes implementation searches
for the `crle` program. Patch by Xiang Zhang. Tested on SunOS by
Kees Bos.
- Issue #26733: Disassembling a class now disassembles class and static methods.
Patch by Xiang Zhang.
- Issue #24838: tarfile's ustar and gnu formats now correctly calculate name
and link field limits for multibyte character encodings like utf-8.
- Issue #26717: Stop encoding Latin-1-ized WSGI paths with UTF-8. Patch by
Anthony Sottile.
- Issue #26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading
more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of
1024 bytes per call.
- Issue #23735: Handle terminal resizing with Readline 6.3+ by installing our
own SIGWINCH handler. Patch by Eric Price.
- Issue #26586: In http.server, respond with "413 Request header fields too
large" if there are too many header fields to parse, rather than killing
the connection and raising an unhandled exception. Patch by Xiang Zhang.
- Issue #23804: Fix SSL recv(0) and read(0) methods to return zero bytes
instead of up to 1024.
- Issue #24266: Ctrl+C during Readline history search now cancels the search
mode when compiled with Readline 7.
- Issue #23718: Fixed parsing time in week 0 before Jan 1. Original patch by
Tams Bence Gedai.
- Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets.
- Issue #25718: Fixed pickling and copying the accumulate() iterator with
total is None.
- Issue #26475: Fixed debugging output for regular expressions with the (?x)
flag.
- Issue #26457: Fixed the subnets() methods in IP network classes for the case
when resulting prefix length is equal to maximal prefix length.
Based on patch by Xiang Zhang.
- Issue #26402: Fix XML-RPC client to retry when the server shuts down a
persistent connection. This was a regression related to the new
http.client.RemoteDisconnected exception in 3.5.0a4.
- Issue #26309: In the "socketserver" module, shut down the request (closing
the connected socket) when verify_request() returns false. Patch by Aviv
Palivoda.
- Issue #25995: os.walk() no longer uses FDs proportional to the tree depth.
- Issue #26117: The os.scandir() iterator now closes file descriptor not only
when the iteration is finished, but when it was failed with error.
- Issue #25911: Restored support of bytes paths in os.walk() on Windows.
- Issue #25945: Fixed a crash when unpickle the functools.partial object with
wrong state. Fixed a leak in failed functools.partial constructor.
"args" and "keywords" attributes of functools.partial have now always types
tuple and dict correspondingly.
- Issue #26147: xmlrpc now works with strings not encodable with used
non-UTF-8 encoding.
- Issue #25935: Garbage collector now breaks reference loops with OrderedDict.
- Issue #25447: fileinput now uses sys.stdin as-is if it does not have a
buffer attribute (restores backward compatibility).
- Issue #25447: Copying the lru_cache() wrapper object now always works,
independedly from the type of the wrapped object (by returning the original
object unchanged).
- Issue #6478: _strptime's regexp cache now is reset after changing timezone
with time.tzset().
- Issue #14285: When executing a package with the "python -m package" option,
and package initialization fails, a proper traceback is now reported. The
"runpy" module now lets exceptions from package initialization pass back to
the caller, rather than raising ImportError.
- Issue #19771: Also in runpy and the "-m" option, omit the irrelevant
message ". . . is a package and cannot be directly executed" if the package
could not even be initialized (e.g. due to a bad ``*.pyc`` file).
- Issue #25177: Fixed problem with the mean of very small and very large
numbers. As a side effect, statistics.mean and statistics.variance should
be significantly faster.
- Issue #25718: Fixed copying object with state with boolean value is false.
- Issue #25624: ZipFile now always writes a ZIP_STORED header for directory
entries. Patch by Dingyuan Wang.
- Skip getaddrinfo if host is already resolved.
Patch by A. Jesse Jiryu Davis.
IDLE
----
- Issue #5124: Paste with text selected now replaces the selection on X11.
This matches how paste works on Windows, Mac, most modern Linux apps,
and ttk widgets. Original patch by Serhiy Storchaka.
- Issue #27117: Make colorizer htest and turtledemo work with dark themes.
Move code for configuring text widget colors to a new function.
Documentation
-------------
- Issue #19489: Moved the search box from the sidebar to the header and footer
of each page. Patch by Ammar Askar.
- Issue #24136: Document the new PEP 448 unpacking syntax of 3.5.
- Issue #26736: Used HTTPS for external links in the documentation if possible.
- Issue #25500: Fix documentation to not claim that __import__ is searched for
in the global scope.
Tests
-----
- Issue #21916: Added tests for the turtle module. Patch by ingrid,
Gregory Loyse and Jelle Zijlstra.
- Issue #26015: Added new tests for pickling iterators of mutable sequences.
Build
-----
- Issue #22359: Disable the rules for running _freeze_importlib and pgen when
cross-compiling. The output of these programs is normally saved with the
source code anyway, and is still regenerated when doing a native build.
Patch by Xavier de Gaye.
- Issue #27229: Fix the cross-compiling pgen rule for in-tree builds. Patch
by Xavier de Gaye.
- Issue #25702: A --with-lto configure option has been added that will
enable link time optimizations at build time during a make profile-opt.
Some compilers and toolchains are known to not produce stable code when
using LTO, be sure to test things thoroughly before relying on it.
It can provide a few % speed up over profile-opt alone.
- Issue #26079: Fixing the build output folder for tix-8.4.3.6. Patch by
Bjoern Thiel.
- Issue #25827: Add support for building with ICC to ``configure``, including
a new ``--with-icc`` flag.
Windows
-------
Tools/Demos
-----------
- Issue #26799: Fix python-gdb.py: don't get C types once when the Python code
is loaded, but get C types on demand. The C types can change if
python-gdb.py is loaded before the Python executable. Patch written by Thomas
Ilsche.
- Issue #26271: Fix the Freeze tool to properly use flags passed through
configure. Patch by Daniel Shaulov.
Misc
----
Windows
-------
- Issue #25715: Python 3.5.1 installer shows wrong upgrade path and incorrect
logic for launcher detection.
- Issue #25388: Fixed tokenizer crash when processing undecodable source code
with a null byte.
- Issue #25462: The hash of the key now is calculated only once in most
operations in C implementation of OrderedDict.
- Issue #25555: Fix parser and AST: fill lineno and col_offset of "arg" node
when compiling AST from Python objects.
- Issue #24802: Avoid buffer overreads when int(), float(), compile(), exec()
and eval() are passed bytes-like objects. These objects are not
necessarily terminated by a null byte, but the functions assumed they were.
- Issue #24726: Fixed a crash and leaking NULL in repr() of OrderedDict that
was mutated by direct calls of dict methods.
- Issue #25449: Iterating OrderedDict with keys with unstable hash now raises
KeyError in C implementations as well as in Python implementation.
- Issue #25395: Fixed crash when highly nested OrderedDict structures were
garbage collected.
- Issue #24806: Prevent builtin types that are not allowed to be subclassed from
being subclassed through multiple inheritance.
- Issue #25131: Make the line number and column offset of set/dict literals and
comprehensions correspond to the opening brace.
- Issue #25150: Hide the private _Py_atomic_xxx symbols from the public
Python.h header to fix a compilation error with OpenMP. PyThreadState_GET()
becomes an alias to PyThreadState_Get() to avoid ABI incompatibilies.
Library
-------
- Issue #25626: Change three zlib functions to accept sizes that fit in
Py_ssize_t, but internally cap those sizes to UINT_MAX. This resolves a
regression in 3.5 where GzipFile.read() failed to read chunks larger than 2
or 4 GiB. The change affects the zlib.Decompress.decompress() max_length
parameter, the zlib.decompress() bufsize parameter, and the
zlib.Decompress.flush() length parameter.
- Issue #25590: In the Readline completer, only call getattr() once per
attribute.
- Issue #25584: Added "escape" to the __all__ list in the glob module.
- Issue #25584: Fixed recursive glob() with patterns starting with '\*\*'.
- Issue #18010: Fix the pydoc web server's module search function to handle
exceptions from importing packages.
- Issue #21827: Fixed textwrap.dedent() for the case when largest common
whitespace is a substring of smallest leading whitespace.
Based on patch by Robert Li.
- Issue #25447: The lru_cache() wrapper objects now can be copied and pickled
(by returning the original object unchanged).
- Issue #25441: asyncio: Raise error from drain() when socket is closed.
- Issue #25232: Fix CGIRequestHandler to split the query from the URL at the
first question mark (?) rather than the last. Patch from Xiang Zhang.
- Issue #23329: Allow the ssl module to be built with older versions of
LibreSSL.
- Issue #25047: The XML encoding declaration written by Element Tree now
respects the letter case given by the user. This restores the ability to
write encoding names in uppercase like "UTF-8", which worked in Python 2.
- Issue #25135: Make deque_clear() safer by emptying the deque before clearing.
This helps avoid possible reentrancy issues.
- Issue #19143: platform module now reads Windows version from kernel32.dll to
avoid compatibility shims.
- Issue #25092: Fix datetime.strftime() failure when errno was already set to
EINVAL.
- Issue #23144: Make sure that HTMLParser.feed() returns all the data, even
when convert_charrefs is True.
- Issue #24982: shutil.make_archive() with the "zip" format now adds entries
for directories (including empty directories) in ZIP file.
- Issue #25019: Fixed a crash caused by setting non-string key of expat parser.
Based on patch by John Leitch.
- Issue #16180: Exit pdb if file has syntax error, instead of trapping user
in an infinite loop. Patch by Xavier de Gaye.
- Issue #24891: Fix a race condition at Python startup if the file descriptor
of stdin (0), stdout (1) or stderr (2) is closed while Python is creating
sys.stdin, sys.stdout and sys.stderr objects. These attributes are now set
to None if the creation of the object failed, instead of raising an OSError
exception. Initial patch written by Marco Paolini.
- Issue #24992: Fix error handling and a race condition (related to garbage
collection) in collections.OrderedDict constructor.
- Issue #25530: Disable the vulnerable SSLv3 protocol by default when creating
ssl.SSLContext.
IDLE
----
- Issue #24455: Prevent IDLE from hanging when a) closing the shell while the
debugger is active (15347); b) closing the debugger with the [X] button
(15348); and c) activating the debugger when already active (24455).
The patch by Mark Roseman does this by making two changes.
1. Suspend and resume the gui.interaction method with the tcl vwait
mechanism intended for this purpose (instead of root.mainloop & .quit).
2. In gui.run, allow any existing interaction to terminate first.
- Issue #24750: Improve the appearance of the IDLE editor window status bar.
Patch by Mark Roseman.
- Issue #25313: Change the handling of new built-in text color themes to better
address the compatibility problem introduced by the addition of IDLE Dark.
Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
- Issue #22726: Re-activate the config dialog help button with some content
about the other buttons and the new IDLE Dark theme.
- Issue #24820: IDLE now has an 'IDLE Dark' built-in text color theme.
It is more or less IDLE Classic inverted, with a cobalt blue background.
Strings, comments, keywords, ... are still green, red, orange, ... .
To use it with IDLEs released before November 2015, hit the
'Save as New Custom Theme' button and enter a new name,
such as 'Custom Dark'. The custom theme will work with any IDLE
release, and can be modified.
- Issue #25224: README.txt is now an idlelib index for IDLE developers and
curious users. The previous user content is now in the IDLE doc chapter.
'IDLE' now means 'Integrated Development and Learning Environment'.
- Issue #24570: Idle: make calltip and completion boxes appear on Macs
affected by a tk regression. Initial patch by Mark Roseman.
- Issue #24801: Make right-click for context menu work on Mac Aqua.
Patch by Mark Roseman.
- Issue #25198: Enhance the initial html viewer now used for Idle Help.
* Properly indent fixed-pitch text (patch by Mark Roseman).
* Give code snippet a very Sphinx-like light blueish-gray background.
* Re-use initial width and height set by users for shell and editor.
* When the Table of Contents (TOC) menu is used, put the section header
at the top of the screen.
- Issue #25225: Condense and rewrite Idle doc section on text colors.
- Issue #21995: Explain some differences between IDLE and console Python.
- Issue #22820: Explain need for *print* when running file from Idle editor.
- Issue #25224: Doc: augment Idle feature list and no-subprocess section.
- Issue #16893: Replace help.txt with help.html for Idle doc display.
The new idlelib/help.html is rstripped Doc/build/html/library/idle.html.
It looks better than help.txt and will better document Idle as released.
The tkinter html viewer that works for this file was written by Mark Roseman.
The now unused EditorWindow.HelpDialog class and helt.txt file are deprecated.
- Issue #24790: Remove extraneous code (which also create 2 & 3 conflicts).
Documentation
-------------
- Issue #22558: Add remaining doc links to source code for Python-coded modules.
Patch by Yoni Lavi.
Tests
-----
- Issue #25099: Make test_compileall not fail when an entry on sys.path cannot
be written to (commonly seen in administrative installs on Windows).
Build
-----
- Issue #24915: Add LLVM support for PGO builds and use the test suite to
generate the profile data. Initial patch by Alecsandru Patrascu of Intel.
Windows
-------
- Issue #25089: Adds logging to installer for case where launcher is not
selected on upgrade.
- Issue #25081: Makes Back button in installer go back to upgrade page when
upgrading.
- Issue #25126: Clarifies that the non-web installer will download some
components.
Tools/Demos
-----------
Build
-----
Library
-------
Build
-----
- Issue #24305: Prevent import subsystem stack frames from being counted
by the warnings.warn(stacklevel=) parameter.
Library
-------
- Issue #21167: NAN operations are now handled correctly when python is
compiled with ICC even if -fp-model strict is not specified.
Library
-------
- Issue #24667: Resize odict in all cases that the underlying dict resizes.
Library
-------
- Issue #24634: Importing uuid should not try to load libc on Windows
- Issue #23004: mock_open() now reads binary data correctly when the type of
read_data is bytes. Initial patch by Aaron Hill.
- Issue #23652: Make it possible to compile the select module against the
libc headers from the Linux Standard Base, which do not include some
EPOLL macros. Patch by Matt Frank.
- Issue #19450: Update Windows and OS X installer builds to use SQLite 3.8.11.
- Issue #24791: Fix grammar regression for call syntax: 'g(\*a or b)'.
IDLE
----
- Issue #23672: Allow Idle to edit and run files with astral chars in name.
Patch by Mohd Sanad Zaki Rizvi.
- Issue #21192: Idle editor. When a file is run, put its name in the restart bar.
Do not print false prompts. Original patch by Adnan Umer.
- Issue #13884: Idle menus. Remove tearoff lines. Patch by Roger Serwy.
Documentation
-------------
- Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
Tests
-----
- Issue #24751: When running regrtest with the ``-w`` command line option,
a test run is no longer marked as a failure if all tests succeed when
re-run.
- Issue #24583: Fix crash when set is mutated while being updated.
- Issue #24407: Fix crash when dict is mutated while being updated.
Library
-------
- Issue #23441: rcompleter now prints a tab character instead of displaying
possible completions for an empty word. Initial patch by Martin Sekera.
- Issue #24620: Random.setstate() now validates the value of state last element.
- Issue #22153: Improve unittest docs. Patch from Martin Panter and evilzero.
- Issue #24580: Symbolic group references to open group in re patterns now are
explicitly forbidden as well as numeric group references.
- Issue #24631: Fixed regression in the timeit module with multiline setup.
- Issue #15014: SMTP.auth() and SMTP.login() now support RFC 4954's optional
initial-response argument to the SMTP AUTH command.
Build
-----
- Issue #24603: Update Windows builds and OS X 10.5 installer to use OpenSSL
1.0.2d.
What's New in Python 3.5.0 beta 3?
==================================
- Issue #24400: Introduce a distinct type for PEP 492 coroutines; add
types.CoroutineType, inspect.getcoroutinestate, inspect.getcoroutinelocals;
coroutines no longer use CO_GENERATOR flag; sys.set_coroutine_wrapper
works only for 'async def' coroutines; inspect.iscoroutine no longer
uses collections.abc.Coroutine, it's intended to test for pure 'async def'
coroutines only; add new opcode: GET_YIELD_FROM_ITER; fix generators wrapper
used in types.coroutine to be instance of collections.abc.Generator;
collections.abc.Awaitable and collections.abc.Coroutine can no longer
be used to detect generator-based coroutines--use inspect.isawaitable
instead.
Library
-------
- Issue #24552: Fix use after free in an error case of the _pickle module.
- Issue #24336: The contextmanager decorator now works with functions with
keyword arguments called "func" and "self". Patch by Martin Panter.
Tests
-----
Documentation
-------------
Build
-----
- Issue #24432: Update Windows builds and OS X 10.5 installer to use OpenSSL
1.0.2c.
- Issue #24284: The startswith and endswith methods of the str class no longer
return True when finding the empty string and the indexes are completely out
of range.
- Issue #11205: In dictionary displays, evaluate the key before the value.
Library
-------
- Issue #24270: Add math.isclose() and cmath.isclose() functions as per PEP 485.
Contributed by Chris Barker and Tal Einat.
- Issue #5633: Fixed timeit when the statement is a string and the setup is not.
- Issue #23985: Fix a possible buffer overrun when deleting a slice from
the front of a bytearray and then appending some other bytes data.
- Issue #23290: Optimize set_merge() for cases where the target is empty.
(Contributed by Serhiy Storchaka.)
- Issue #24022: Fix tokenizer crash when processing undecodable source code.
- Issue #24017: PEP 492: Coroutines with async and await syntax.
Library
-------
- Issue #24230: The tempfile module now accepts bytes for prefix, suffix and dir
parameters and returns bytes in such situations (matching the os module APIs).
- Issue #20035: Replaced the ``tkinter._fix`` module used for setting up the
Tcl/Tk environment on Windows with a private function in the ``_tkinter``
module that makes no permanent changes to the environment.
- Issue #20098: New mangle_from policy option for email, default True
for compat32, but False for all other policies.
- Issue #24211: The email library now supports RFC 6532: it can generate
headers using utf-8 instead of encoded words.
- Issue #23488: Random generator objects now consume 2x less memory on 64-bit.
- Issue #23796: peek and read1 methods of BufferedReader now raise ValueError
if they called on a closed object. Patch by John Hergenroeder.
- Issue #21800: imaplib now supports RFC 5161 (enable), RFC 6855
(utf8/internationalized email) and automatically encodes non-ASCII
usernames and passwords to UTF8.
- Issue #20274: Remove ignored and erroneous "kwargs" parameters from three
METH_VARARGS methods on _sqlite.Connection.
- Issue #24094: Fix possible crash in json.encode with poorly behaved dict
subclasses.
- Issue #9246: On POSIX, os.getcwd() now supports paths longer than 1025 bytes.
Patch written by William Orr.
- Issue #23008: Fixed resolving attributes with boolean value is False in pydoc.
- Issue #23908: os functions now reject paths with embedded null character
on Windows instead of silently truncating them.
IDLE
----
Tests
-----
Documentation
-------------
- Issue #24029: Document the name binding behavior for submodule imports.
- Issue #24077: Fix typo in man page for -I command option: -s, not -S
Tools/Demos
-----------
- 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 #23726: Don't enable GC for user subclasses of non-GC types that
don't add any new fields. Patch by Eugene Toder.
- Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on
non-integer input.
Library
-------
- Issue #23840: tokenize.open() now closes the temporary binary file on error
to fix a resource warning.
- 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 #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 #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 #23400: Raise same exception on both Python 2 and 3 if sem_open is not
available. Patch by Davin Potts.
- Issue #2175: SAX parsers now support a character stream of InputSource object.
- Issue #16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and
arbitrary precision integers added in Tcl 8.5.
- 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 #21526: Tkinter now supports new boolean type in Tcl 8.5.
- Issue #23838: linecache now clears the cache and returns an empty result on
MemoryError.
- 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 #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 #23704: collections.deque() objects now support __add__, __mul__, and
__imul__().
- Issue #23745: The new email header parser now handles duplicate MIME
parameter names without error, similar to how get_param behaves.
- Issue #22117: Fix os.utime(), it now rounds the timestamp towards minus
infinity (-inf) instead of rounding towards zero.
Build
-----
- Issue #23817: FreeBSD now uses "1.0" in the SOVERSION as other operating
systems, instead of just "1".
- Issue #23501: Argument Clinic now generates code into separate files by default.
Tests
-----
Tools/Demos
-----------
- Issue #23944: Argument Clinic now wraps long impl prototypes at column 78.
- Issue #20586: Argument Clinic now ensures that functions without docstrings
have signatures.
- Issue #23492: Argument Clinic now generates argument parsing code with
PyArg_Parse instead of PyArg_ParseTuple if possible.
- 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.
C API
-----
- Issue #23681: The -b option now affects comparisons of bytes with int.
Library
-------
- Issue #22364: Improved some re error messages using regex for hints.
- Issue #21802: The reader in BufferedRWPair now is closed even when closing
writer failed in BufferedRWPair.close().
- Issue #17530: pprint now wraps long bytes objects and bytearrays.
- 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 #23657: Avoid explicit checks for str in zipapp, adding support
for pathlib.Path objects as arguments.
- Issue #23252: Added support for writing ZIP files to unseekable streams.
- 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 #23136: _strptime now uniformly handles all days in week 0, including
Dec 30 of previous year. Based on patch by Jim Carroll.
- Issue #22903: The fake test case created by unittest.loader when it fails
importing a test module is now picklable.
- 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 #23138: Fixed parsing cookies with absent keys or values in cookiejar.
Patch by Demian Brecht.
- Issue #23615: Modules bz2, tarfile and tokenize now can be reloaded with
imp.reload(). Patch by Thomas Kluyver.
Build
-----
Tests
-----
Tools/Demos
-----------
Library
-------
- 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 #23576: Avoid stalling in SSL reads when EOF has been reached in the
SSL layer but the underlying connection hasn't been closed.
- Issue #21619: Popen objects no longer leave a zombie after exit in the with
statement if the pipe was broken. Patch by Martin Panter.
- Issues #814253, #9179: Group references and conditional group references now
work in lookbehind assertions in regular expressions.
- 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 #23374: Fixed pydoc failure with non-ASCII files when stdout encoding
differs from file system encoding (e.g. on Mac OS).
- Issue #23481: Remove RC4 from the SSL module's default cipher list.
- Issue #23096: Pickle representation of floats with protocol 0 now is the same
for both Python and C implementations.
- Issue #19105: pprint now more efficiently uses free space at the right.
- Issue #19705: turtledemo now has a visual sorting algorithm demo. Original
patch from Jason Yeo.
- Issue #23801: Fix issue where cgi.FieldStorage did not always ignore the
entire preamble to a multipart body.
Build
-----
- Issue #23445: pydebug builds now use "gcc -Og" where possible, to make
the resulting executable faster.
C API
-----
- Issue #20204: Deprecation warning is now raised for builtin types without the
__module__ attribute.
Windows
-------
- Issue #23465: Implement PEP 486 - Make the Python Launcher aware of virtual
environments. Patch by Paul Moore.
- Issue #23437: Make user scripts directory versioned on Windows. Patch by Paul
Moore.
- Issue #22735: Fix many edge cases (including crashes) involving custom mro()
implementations.
- Issue #21295: Revert some changes (issue #16795) to AST line numbers and
column offsets that constituted a regression.
- Issue #22986: Allow changing an object's __class__ between a dynamic type and
static type in some cases.
- Issue #22038: pyatomic.h now uses stdatomic.h or GCC built-in functions for
atomic memory access if available. Patch written by Vitor de Lima and Gustavo
Temple.
- Issue #20284: %-interpolation (aka printf) formatting added for bytes and
bytearray.
- Issue #23048: Fix jumping out of an infinite while loop in the pdb.
- Issue #20335: bytes constructor now raises TypeError when encoding or errors
is specified with non-string argument. Based on patch by Renaud Blanch.
- Issue #22869: Move the interpreter startup & shutdown code to a new
dedicated pylifecycle.c module
- Issue #22653: Fix an assertion failure in debug mode when doing a reentrant
dict insertion in debug mode.
- 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).
- Issue #22520: Fix overflow checking when generating the repr of a unicode
object.
- Issue #22215: Now ValueError is raised instead of TypeError when str or bytes
argument contains not permitted null character or byte.
- Issue #22077: Improve index error messages for bytearrays, bytes, lists,
and tuples by adding 'or slices'. Added ', not <typename>' for bytearrays.
Original patch by Claudiu Popa.
- Issue #21897: Fix a crash with the f_locals attribute with closure
variables when frame.clear() has been called.
- Issue #21205: Add a new ``__qualname__`` attribute to generator, the
qualified name, and use it in the representation of a generator
(``repr(gen)``). The default name of the generator (``__name__`` attribute)
is now get from the function instead of the code. Use ``gen.gi_code.co_name``
to get the name of the code.
- Issue #21418: Fix a crash in the builtin function super() when called without
argument and without current frame (ex: embedded Python).
- Issue #20355: -W command line options now have higher priority than the
PYTHONWARNINGS environment variable. Patch by Arfrever.
- Issue #21209: Fix sending tuples to custom generator objects with the yield
from syntax.
- Issue #21193: pow(a, b, c) now raises ValueError rather than TypeError when b
is negative. Patch by Josh Rosenberg.
- PEP 465 and Issue #21176: Add the '@' operator for matrix multiplication.
- Issue #8297: Attributes missing from modules now include the module name
in the error text. Original patch by ysj.ray.
- Issue #19995: %c, %o, %x, and %X now raise TypeError on non-integer input.
- Issue #19655: The ASDL parser - used by the build process to generate code for
managing the Python AST in C - was rewritten. The new parser is self contained
and does not require to carry long the spark.py parser-generator library;
spark.py was removed from the source base.
- Issue #12546: Allow ``\x00`` to be used as a fill character when using str, int,
float, and complex __format__ methods.
- Issue #8931: Make alternate formatting ('#') for type 'c' raise an
exception. In versions prior to 3.5, '#' with 'c' had no effect. Now
specifying it is an error. Patch by Torsten Landschoff.
Library
-------
- Issue #13128: Print response headers for CONNECT requests when debuglevel
> 0. Patch by Demian Brecht.
- Issue #22818: Splitting on a pattern that could match an empty string now
raises a warning. Patterns that can only match empty strings are now
rejected.
- Issue #18518: timeit now rejects statements which can't be compiled outside
a function or a loop (e.g. "return" or "break").
- Issue #23133: Pickling of ipaddress objects now produces more compact and
portable representation.
- Issue #23248: Update ssl error codes from latest OpenSSL git master.
- Issue #15955: Add an option to limit output size when decompressing LZMA
data. Patch by Nikolaus Rath and Martin Panter.
- Issue #23063: In the disutils' check command, fix parsing of reST with code or
code-block directives.
- Issue #17911: Provide a way to seed the linecache for a PEP-302 module
without actually loading the code.
- Issue #17911: Provide a new object API for traceback, including the ability
to not lookup lines at all until the traceback is actually rendered, without
any trace of the original objects being kept alive.
- Issue #23112: Fix SimpleHTTPServer to correctly carry the query string and
fragment when it redirects to add a trailing slash.
- Issue #23093: In the io, module allow more operations to work on detached
streams.
- Issue #22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(),
instead of reading /dev/urandom, to get pseudo-random bytes.
- Issue #19104: pprint now produces evaluable output for wrapped strings.
- Issue #22783: Pickling now uses the NEWOBJ opcode instead of the NEWOBJ_EX
opcode if possible.
- Issue #16043: Add a default limit for the amount of data xmlrpclib.gzip_decode
will return. This resolves CVE-2013-1753.
- 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 #21971: Update turtledemo doc and add module to the index.
- Issue #22407: Deprecated the use of re.LOCALE flag with str patterns or
re.ASCII. It was newer worked.
- Issue #22902: The "ip" command is now used on Linux to determine MAC address
in uuid.getnode(). Pach by Bruno Cauet.
- Issue #22915: SAX parser now supports files opened with file descriptor or
bytes path.
- Issue #12728: Different Unicode characters having the same uppercase but
different lowercase are now matched in case-insensitive regular expressions.
- Issue #22824: Updated reprlib output format for sets to use set literals.
Patch contributed by Berker Peksag.
- Issue #22824: Updated reprlib output format for arrays to display empty
arrays without an unnecessary empty list. Suggested by Serhiy Storchaka.
- Issue #17293: uuid.getnode() now determines MAC address on AIX using netstat.
Based on patch by Aivars Kalvns.
- Issue #22776: Brought excluded code into the scope of a try block in
SysLogHandler.emit().
- Issue #6623: Remove deprecated Netrc class in the ftplib module. Patch by
Matt Chaput.
- Issue #22410: Module level functions in the re module now cache compiled
locale-dependent regular expressions taking into account the locale.
- 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.
- Issue #18216: gettext now raises an error when a .mo file has an
unsupported major version number. Patch by Aaron Hill.
- Issue #22676: Make the pickling of global objects which don't have a
__module__ attribute less slow.
- Issue #7559: unittest test loading ImportErrors are reported as import errors
with their import exception rather than as attribute errors after the import
has already failed.
- Issue #22641: In asyncio, the default SSL context for client connections
is now created using ssl.create_default_context(), for stronger security.
- Issue #20152: Convert the array and cmath modules to Argument Clinic.
- Issue #22435: Fix a file descriptor leak when socketserver bind fails.
- Issue #1519638: Now unmatched groups are replaced with empty strings in re.sub()
and re.subn().
- Issue #21965: Add support for in-memory SSL to the ssl module. Patch
by Geert Jansen.
- Issue #22219: The zipfile module CLI now adds entries for directories
(including empty directories) in ZIP file.
- Issue #22508: The email.__version__ variable has been removed; the email
code is no longer shipped separately from the stdlib, and __version__
hasn't been updated in several releases.
- Issue #20076: Added non derived UTF-8 aliases to locale aliases table.
- Issue #20079: Added locales supported in glibc 2.18 to locale alias table.
- Issue #23392: Added tests for marshal C API that works with FILE*.
- Issue #10510: distutils register and upload methods now use HTML standards
compliant CRLF line endings.
- Issue #5309: distutils' build and build_ext commands now accept a ``-j``
option to enable parallel building of extension modules.
- Issue #20912: Now directories added to ZIP file have correct Unix and MS-DOS
directory attributes.
- Issue #22278: Fix urljoin problem with relative urls, a regression observed
after changes to issue22118 were submitted.
- Issue #4180: The warnings registries are now reset when the filters
are modified.
- Issue #22419: Limit the length of incoming HTTP request in wsgiref server to
65536 bytes and send a 414 error code for higher lengths. Patch contributed
by Devin Cook.
- Issue #21147: sqlite3 now raises an exception if the request contains a null
character instead of truncating it. Based on patch by Victor Stinner.
- Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with
empty string or tuple argument.
- Issue #21951: Tkinter now most likely raises MemoryError instead of crash
if the memory allocation fails.
- Issue #22338: Fix a crash in the json module on memory allocation failure.
- Issue #22226: First letter no longer is stripped from the "status" key in
the result of Treeview.heading().
- Issue #19524: Fixed resource leak in the HTTP connection when an invalid
response is received. Patch by Martin Panter.
- Issue #20421: Add a .version() method to SSL sockets exposing the actual
protocol version in use.
- Issue #19546: configparser exceptions no longer expose implementation details.
Chained KeyErrors are removed, which leads to cleaner tracebacks. Patch by
Claudiu Popa.
- Issue #21933: Turtledemo users can change the code font size with a menu
selection or control(command) '-' or '+' or control-mousewheel.
Original patch by Lita Cho.
- Issue #21597: The separator between the turtledemo text pane and the drawing
canvas can now be grabbed and dragged with a mouse. The code text pane can
be widened to easily view or copy the full width of the text. The canvas
can be widened on small screens. Original patches by Jan Kanis and Lita Cho.
- Issue #22216: smtplib now resets its state more completely after a quit. The
most obvious consequence of the previous behavior was a STARTTLS failure
during a connect/starttls/quit/connect/starttls sequence.
- Issue #22118: Switch urllib.parse to use RFC 3986 semantics for the
resolution of relative URLs, rather than RFCs 1808 and 2396.
Patch by Demian Brecht.
- Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter.
- Issue #22184: The functools LRU Cache decorator factory now gives an earlier
and clearer error message when the user forgets the required parameters.
- Issue #17923: glob() patterns ending with a slash no longer match non-dirs on
AIX. Based on patch by Delhallt.
- Issue #22176: Update the ctypes module's libffi to v3.1. This release
adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
architectures.
- Issue #5411: Added support for the "xztar" format in the shutil module.
- Issue #21975: Fixed crash when using uninitialized sqlite3.Row (in particular
when unpickling pickled sqlite3.Row). sqlite3.Row is now initialized in the
__new__() method.
- Issue #22127: Bypass IDNA for pure-ASCII host names in the socket module
(in particular for numeric IPs).
- Issue #21047: set the default value for the *convert_charrefs* argument
of HTMLParser to True. Patch by Berker Peksag.
- Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows initializing images from binary data.
- Issue #17172: Make turtledemo start as active on OS X even when run with
subprocess. Patch by Lita Cho.
- Issue #22033: Reprs of most Python implemened classes now contain actual
class name instead of hardcoded one.
- Issue #19884: readline: Disable the meta modifier key if stdout is not
a terminal to not write the ANSI sequence ``"\033[1034h"`` into stdout. This
sequence is used on some terminal (ex: TERM=xterm-256color") to enable
support of 8 bit characters.
- Issue #4350: Removed a number of out-of-dated and non-working for a long time
Tkinter methods.
- Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
- Issue #22031: Reprs now always use hexadecimal format with the "0x" prefix
when contain an id in form " at 0x...".
- Issue #21942: Fixed source file viewing in pydoc's server mode on Windows.
- Issue #21151: Fixed a segfault in the winreg module when ``None`` is passed
as a ``REG_BINARY`` value to SetValueEx. Patch by John Ehresman.
- Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,
it ignored I/O errors if at least the first C call read() succeed.
- Issue #21863: cProfile now displays the module name of C extension functions,
in addition to their own name.
- Issue #21729: Used the "with" statement in the dbm.dumb module to ensure
files closing. Patch by Claudiu Popa.
- Issue #21722: The distutils "upload" command now exits with a non-zero
return code when uploading fails. Patch by Martin Dengler.
- Issue #21723: asyncio.Queue: support any type of number (ex: float) for the
maximum size. Patch written by Vajrasky Kok.
- Issue #21711: support for "site-python" directories has now been removed
from the site module (it was deprecated in 3.4).
- Issue #18039: dbm.dump.open() now always creates a new database when the
flag has the value 'n'. Patch by Claudiu Popa.
- Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods
that use 'self' in the example code is generated correctly.
- Issue #21618: The subprocess module could fail to close open fds that were
inherited by the calling process and already higher than POSIX resource
limits would otherwise allow. On systems with a functioning /proc/self/fd
or /dev/fd interface the max is now ignored and all fds are closed.
- Issue #21552: Fixed possible integer overflow of too long string lengths in
the tkinter module on 64-bit platforms.
- Issue #14315: The zipfile module now ignores extra fields in the central
directory that are too short to be parsed instead of letting a struct.unpack
error bubble up as this "bad data" appears in many real world zip files in
the wild and is ignored by other zip tools.
- Issue #21402: tkinter.ttk now works when default root window is not set.
- Issue #18807: If copying (no symlinks) specified for a venv, then the python
interpreter aliases (python, python3) are now created by copying rather than
symlinking.
- Issue #20197: Added support for the WebP image type in the imghdr module.
Patch by Fabrice Aneche and Claudiu Popa.
- Issue #21137: Improve the repr for threading.Lock() and its variants
by showing the "locked" or "unlocked" status. Patch by Berker Peksag.
- Issue #21538: The plistlib module now supports loading of binary plist files
when reference or offset size is not a power of two.
- Issue #21525: Most Tkinter methods which accepted tuples now accept lists too.
- Issue #22236: Tkinter tests now don't reuse default root window. New root
window is created for every test class.
- Issue #10744: Fix PEP 3118 format strings on ctypes objects with a nontrivial
shape.
- Issue #13916: Disallowed the surrogatepass error handler for non UTF-\*
encodings.
- Issue #21398: Fix a unicode error in the pydoc pager when the documentation
contains characters not encodable to the stdout encoding.
- Issue #18314: Unlink now removes junctions on Windows. Patch by Kim Grsman
- Issue #19385: Make operations on a closed dbm.dumb database always raise the
same exception.
- Issue #21207: Detect when the os.urandom cached fd has been closed or
replaced, and open it anew.
- Issue #21127: Path objects can now be instantiated from str subclass
instances (such as ``numpy.str_``).
- Issue #21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX.
- Issue #17498: Some SMTP servers disconnect after certain errors, violating
strict RFC conformance. Instead of losing the error code when we issue the
subsequent RSET, smtplib now returns the error code and defers raising the
SMTPServerDisconnected error until the next command is issued.
- Issue #20539: Improved math.factorial error message for large positive inputs
and changed exception type (OverflowError -> ValueError) for large negative
inputs.
- Issue #19505: The items, keys, and values views of OrderedDict now support
reverse iteration using reversed().
- Issue #21082: In os.makedirs, do not set the process-wide umask. Note this
changes behavior of makedirs when exist_ok=True.
- Issue #20995: Enhance default ciphers used by the ssl module to enable
better security and prioritize perfect forward secrecy.
- Issue #19977: When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale),
:py:data:`sys.stdin` and :py:data:`sys.stdout` are now using the
``surrogateescape`` error handler, instead of the ``strict`` error handler.
- Issue #20574: Implement incremental decoder for cp65001 code (Windows code
page 65001, Microsoft UTF-8).
- Issue #20879: Delay the initialization of encoding and decoding tables for
base32, ascii85 and base85 codecs in the base64 module, and delay the
initialization of the unquote_to_bytes() table of the urllib.parse module, to
not waste memory if these modules are not used.
- Issue #19157: Include the broadcast address in the usuable hosts for IPv6
in ipaddress.
- Issue #11599: When an external command (e.g. compiler) fails, distutils now
prints out the whole command line (instead of just the command name) if the
environment variable DISTUTILS_DEBUG is set.
- Issue #4931: distutils should not produce unhelpful "error: None" messages
anymore. distutils.util.grok_environment_error is kept but doc-deprecated.
- Issue #20283: RE pattern methods now accept the string keyword parameters
as documented. The pattern and source keyword parameters are left as
deprecated aliases.
- Issue #20791: copy.copy() now doesn't make a copy when the input is
a bytes object. Initial patch by Peter Otten.
- Issue #11571: Ensure that the turtle window becomes the topmost window
when launched on OS X.
IDLE
----
- 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 #16893: Update Idle doc chapter to match current Idle and add new
information.
- 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 #21139: Change default paragraph width to 72, the PEP 8 recommendation.
- Issue #21284: Paragraph reformat test passes after user changes reformat width.
Build
-----
- Issue #22935: Allow the ssl module to be compiled if openssl doesn't support
SSL 3.
- Issue #22592: Drop support of the Borland C compiler to build Python. The
distutils module still supports it to build extensions.
- Issue #21958: Define HAVE_ROUND when building with Visual Studio 2013 and
above. Patch by Zachary Turner.
- Issue #18093: the programs that embed the CPython runtime are now in a
separate "Programs" directory, rather than being kept in the Modules
directory.
- Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
now display special message when and only when there are failures.
- Issue #21141: The Windows build process no longer attempts to find Perl,
instead relying on OpenSSL source being configured and ready to build. The
``PCbuild\build_ssl.py`` script has been re-written and re-named to
``PCbuild\prepare_ssl.py``, and takes care of configuring OpenSSL source
for both 32 and 64 bit platforms. OpenSSL sources obtained from
svn.python.org will always be pre-configured and ready to build.
- Issue #19962: The Windows build process now creates "python.bat" in the
root of the source tree, which passes all arguments through to the most
recently built interpreter.
- Issue #21285: Refactor and fix curses configure check to always search
in a ncursesw directory.
- Issue #15234: For BerkelyDB and Sqlite, only add the found library and
include directories if they aren't already being searched. This avoids
an explicit runtime library dependency.
- Issue #15968: Incorporated Tcl, Tk, and Tix builds into the Windows build
solution.
- Issue #17219: Add library build dir for Python extension cross-builds.
- Issue #22919: Windows build updated to support VC 14.0 (Visual Studio 2015),
which will be used for the official release.
C API
-----
- Issue #22079: PyType_Ready() now checks that statically allocated type has
no dynamically allocated bases.
Documentation
-------------
- 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.
- Issue #21777: The binary sequence methods on bytes and bytearray are now
documented explicitly, rather than assuming users will be able to derive
the expected behaviour from the behaviour of the corresponding str methods.
Tests
-----
- Issue #22838: All test_re tests now work with unittest test discovery.
- Issue #20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier
de Gaye.
- Issue #19493: Refactored the ctypes test package to skip tests explicitly
rather than silently.
- Issue #18492: All resources are now allowed when tests are not run by
regrtest.py.
- Issue #21634: Fix pystone micro-benchmark: use floor division instead of true
division to benchmark integers instead of floating point numbers. Set pystone
version to 1.2. Patch written by Lennart Regebro.
- Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
- Issue #17756: Fix test_code test when run from the installed location.
- Issue #17752: Fix distutils tests when run from the installed location.
- Issue #18604: Consolidated checks for GUI availability. All platforms now
at least check whether Tk can be instantiated when the GUI resource is
requested.
- Issue #23345: Prevent test_ssl failures with large OpenSSL patch level
values (like 0.9.8zc).
Tools/Demos
-----------
- Issue #22314: pydoc now works when the LINES environment variable is set.
- Issue #22615: Argument Clinic now supports the "type" argument for the
int converter. This permits using the int converter with enums and
typedefs.
- Issue #20079: The makelocalealias.py script now can parse the SUPPORTED file
from glibc sources and supports command line options for source paths.
- Add support for the PEP 465 matrix multiplication operator to 2to3.
- Issue #16047: Fix module exception list and __file__ handling in freeze.
Patch by Meador Inge.
Windows
-------
- The bundled version of Tcl/Tk has been updated to 8.6.3. The most visible
result of this change is the addition of new native file dialogs when
running on Windows Vista or newer. See Tcl/Tk's TIP 432 for more
information. Also, this version of Tcl/Tk includes support for Windows 10.
- Issue #17896: The Windows build scripts now expect external library sources
to be in ``PCbuild\..\externals`` rather than ``PCbuild\..\..``.
- Issue #17717: The Windows build scripts now use a copy of NASM pulled from
svn.python.org to build OpenSSL.
- Issue #21907: Improved the batch scripts provided for building Python.
- Issue #22644: The bundled version of OpenSSL has been updated to 1.0.1j.
- Issue #22980: .pyd files with a version and platform tag (for example,
".cp35-win32.pyd") will now be loaded in preference to those without tags.