Python Changelog

What's new in Python 3.12.3

Apr 9, 2024
  • New features:
  • More flexible f-string parsing, allowing many things previously disallowed (PEP 701).
  • Support for the buffer protocol in Python code (PEP 688).
  • A new debugging/profiling API (PEP 669).
  • Support for isolated subinterpreters with separate Global Interpreter Locks (PEP 684).
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Support for the Linux perf profiler to report Python function names in traces.
  • Many large and small performance improvements (like PEP 709 and support for the BOLT binary optimizer), delivering an estimated 5% overall performance improvement.
  • Type annotations:
  • New type annotation syntax for generic classes (PEP 695).
  • New override decorator for methods (PEP 698).
  • Deprecations:
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation for performance enhancements. (This should not affect most users as it is an internal detail, but it may cause problems for Cython-generated code.)

New in Python 3.13.0 Alpha 5 (Mar 13, 2024)

  • The most notable changes so far:
  • In the interactive interpreter, exception tracebacks are now colorized by default.
  • A preliminary, experimental JIT was added, providing the ground work for significant performance improvements.
  • Docstrings now have their leading indentation stripped, reducing memory use and the size of .pyc files. (Most tools handling docstrings already strip leading indentation.)
  • The dbm module has a new dbm.sqlite3 backend that is used by default when creating new files.
  • PEP 594 (Removing dead batteries from the standard library) scheduled removals of many deprecated modules: aifc, audioop, chunk, cgi, cgitb, crypt, imghdr, mailcap, msilib, nis, nntplib, ossaudiodev, pipes, sndhdr, spwd, sunau, telnetlib, uu, xdrlib, lib2to3.
  • Many other removals of deprecated classes, functions and methods in various standard library modules.
  • New deprecations, most of which are scheduled for removal from Python 3.15 or 3.16.
  • C API removals and deprecations. (Some removals present in alpha 1 have been reverted in alpha 2, as the removals were deemed too disruptive at this time.)

New in Python 3.13.0 Alpha 4 (Feb 16, 2024)

  • The most notable changes so far:
  • In the interactive interpreter, exception tracebacks are now colorized by default.
  • A preliminary, experimental JIT was added, providing the ground work for significant performance improvements.
  • Docstrings now have their leading indentation stripped, reducing memory use and the size of .pyc files. (Most tools handling docstrings already strip leading indentation.)
  • PEP 594 (Removing dead batteries from the standard library) scheduled removals of many deprecated modules: aifc, audioop, chunk, cgi, cgitb, crypt, imghdr, mailcap, msilib, nis, nntplib, ossaudiodev, pipes, sndhdr, spwd, sunau, telnetlib, uu, xdrlib, lib2to3.
  • Many other removals of deprecated classes, functions and methods in various standard library modules.
  • New deprecations, most of which are scheduled for removal from Python 3.15 or 3.16.
  • C API removals and deprecations. (Some removals present in alpha 1 have been reverted in alpha 2, as the removals were deemed too disruptive at this time.)

New in Python 3.12.2 (Feb 7, 2024)

  • New features:
  • More flexible f-string parsing, allowing many things previously disallowed (PEP 701).
  • Support for the buffer protocol in Python code (PEP 688).
  • A new debugging/profiling API (PEP 669).
  • Support for isolated subinterpreters with separate Global Interpreter Locks (PEP 684).
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Support for the Linux perf profiler to report Python function names in traces.
  • Many large and small performance improvements (like PEP 709 and support for the BOLT binary optimizer), delivering an estimated 5% overall performance improvement.
  • Type annotations:
  • New type annotation syntax for generic classes (PEP 695).
  • New override decorator for methods (PEP 698).
  • Deprecations:
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation for performance enhancements. (This should not affect most users as it is an internal detail, but it may cause problems for Cython-generated code.)

New in Python 3.12.1 (Dec 8, 2023)

  • 3.12.1 is the latest maintenance release, containing more than 400 bugfixes, build improvements and documentation changes since 3.12.0.

New in Python 3.12.0 (Oct 2, 2023)

  • New features:
  • More flexible f-string parsing, allowing many things previously disallowed (PEP 701).
  • Support for the buffer protocol in Python code (PEP 688).
  • A new debugging/profiling API (PEP 669).
  • Support for isolated subinterpreters with separate Global Interpreter Locks (PEP 684).
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Support for the Linux perf profiler to report Python function names in traces.
  • Many large and small performance improvements (like PEP 709 and support for the BOLT binary optimizer), delivering an estimated 5% overall performance improvement.
  • Type annotations:
  • New type annotation syntax for generic classes (PEP 695).
  • New override decorator for methods (PEP 698).
  • Deprecations:
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation for performance enhancements. (This should not affect most users as it is an internal detail, but it may cause problems for Cython-generated code.)

New in Python 3.11.6 (Oct 2, 2023)

  • Core and Builtins:
  • gh-109351: Fix crash when compiling an invalid AST involving a named (walrus) expression.
  • gh-109207: Fix a SystemError in __repr__ of symtable entry object.
  • gh-109179: Fix bug where the C traceback display drops notes from SyntaxError.
  • gh-88943: Improve syntax error for non-ASCII character that follows a numerical literal. It now points on the invalid non-ASCII character, not on the valid numerical literal.
  • gh-108959: Fix caret placement for error locations for subscript and binary operations that involve non-semantic parentheses and spaces. Patch by Pablo Galindo
  • gh-108520: Fix multiprocessing.synchronize.SemLock.__setstate__() to properly initialize multiprocessing.synchronize.SemLock._is_fork_ctx. This fixes a regression when passing a SemLock accross nested processes.
  • Rename multiprocessing.synchronize.SemLock.is_fork_ctx to multiprocessing.synchronize.SemLock._is_fork_ctx to avoid exposing it as public API.
  • Library:
  • gh-110036: On Windows, multiprocessing Popen.terminate() now catchs PermissionError and get the process exit code. If the process is still running, raise again the PermissionError. Otherwise, the process terminated as expected: store its exit code. Patch by Victor Stinner.
  • gh-110038: Fixed an issue that caused KqueueSelector.select() to not return all the ready events in some cases when a file descriptor is registered for both read and write.
  • gh-109631: re functions such as re.findall(), re.split(), re.search() and re.sub() which perform short repeated matches can now be interrupted by user.
  • gh-109593: Avoid deadlocking on a reentrant call to the multiprocessing resource tracker. Such a reentrant call, though unlikely, can happen if a GC pass invokes the finalizer for a multiprocessing object such as SemLock.
  • gh-109613: Fix os.stat() and os.DirEntry.stat(): check for exceptions. Previously, on Python built in debug mode, these functions could trigger a fatal Python error (and abort the process) when a function succeeded with an exception set. Patch by Victor Stinner.
  • gh-109375: The pdb alias command now prevents registering aliases without arguments.
  • gh-107219: Fix a race condition in concurrent.futures. When a process in the process pool was terminated abruptly (while the future was running or pending), close the connection write end. If the call queue is blocked on sending bytes to a worker process, closing the connection write end interrupts the send, so the queue can be closed. Patch by Victor Stinner.
  • gh-50644: Attempts to pickle or create a shallow or deep copy of codecs streams now raise a TypeError. Previously, copying failed with a RecursionError, while pickling produced wrong results that eventually caused unpickling to fail with a RecursionError.
  • gh-108987: Fix _thread.start_new_thread() race condition. If a thread is created during Python finalization, the newly spawned thread now exits immediately instead of trying to access freed memory and lead to a crash. Patch by Victor Stinner.
  • gh-108843: Fix an issue in ast.unparse() when unparsing f-strings containing many quote types.
  • gh-108682: Enum: raise TypeError if super().__new__() is called from a custom __new__.
  • gh-105829: Fix concurrent.futures.ProcessPoolExecutor deadlock
  • gh-64662: Fix support for virtual tables in sqlite3.Connection.iterdump(). Patch by Aviv Palivoda.
  • gh-107913: Fix possible losses of errno and winerror values in OSError exceptions if they were cleared or modified by the cleanup code before creating the exception object.
  • gh-104372: On Linux where subprocess can use the vfork() syscall for faster spawning, prevent the parent process from blocking other threads by dropping the GIL while it waits for the vfork’ed child process exec() outcome. This prevents spawning a binary from a slow filesystem from blocking the rest of the application.
  • gh-84867: unittest.TestLoader no longer loads test cases from exact unittest.TestCase and unittest.FunctionTestCase classes.
  • Documentation
  • gh-109209: The minimum Sphinx version required for the documentation is now 4.2.
  • gh-105052: Update timeit doc to specify that time in seconds is just the default.
  • gh-102823: Document the return type of x // y when x and y have type float.
  • Tests
  • gh-110031: Skip test_threading tests using thread+fork if Python is built with Address Sanitizer (ASAN). Patch by Victor Stinner.
  • gh-110088: Fix test_asyncio timeouts: don’t measure the maximum duration, a test should not measure a CI performance. Only measure the minimum duration when a task has a timeout or delay. Add CLOCK_RES to test_asyncio.utils. Patch by Victor Stinner.
  • gh-110033: Fix test_interprocess_signal() of test_signal. Make sure that the subprocess.Popen object is deleted before the test raising an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as Exception ignored in: ... and the test fails. Patch by Victor Stinner.
  • gh-109594: Fix test_timeout() of test_concurrent_futures.test_wait. Remove the future which may or may not complete depending if it takes longer than the timeout ot not. Keep the second future which does not complete before wait() timeout. Patch by Victor Stinner.
  • gh-109748: Fix test_zippath_from_non_installed_posix() of test_venv: don’t copy __pycache__/ sub-directories, because they can be modified by other Python tests running in parallel. Patch by Victor Stinner.
  • gh-103053: Skip test_freeze_simple_script() of test_tools.test_freeze if Python is built with ./configure --enable-optimizations, which means with Profile Guided Optimization (PGO): it just makes the test too slow. The freeze tool is tested by many other CIs with other (faster) compiler flags. Patch by Victor Stinner.
  • gh-109396: Fix test_socket.test_hmac_sha1() in FIPS mode. Use a longer key: FIPS mode requires at least of at least 112 bits. The previous key was only 32 bits. Patch by Victor Stinner.
  • gh-104736: Fix test_gdb on Python built with LLVM clang 16 on Linux ppc64le (ex: Fedora 38). Search patterns in gdb “bt” command output to detect when gdb fails to retrieve the traceback. For example, skip a test if Backtrace stopped: frame did not save the PC is found. Patch by Victor Stinner.
  • gh-109237: Fix test_site.test_underpth_basic() when the working directory contains at least one non-ASCII character: encode the ._pth file to UTF-8 and enable the UTF-8 Mode to use UTF-8 for the child process stdout. Patch by Victor Stinner.
  • gh-109230: Fix test_pyexpat.test_exception(): it can now be run from a directory different than Python source code directory. Before, the test failed in this case. Skip the test if Modules/pyexpat.c source is not available. Skip also the test on Python implementations other than CPython. Patch by Victor Stinner.
  • gh-109015: Fix test_asyncio, test_imaplib and test_socket tests on FreeBSD if the TCP blackhole is enabled (sysctl net.inet.tcp.blackhole). Skip the few tests which failed with ETIMEDOUT which such non standard configuration. Currently, the FreeBSD GCP image enables TCP and UDP blackhole (sysctl net.inet.tcp.blackhole=2 and sysctl net.inet.udp.blackhole=1). Patch by Victor Stinner.
  • gh-91960: Skip test_gdb if gdb is unable to retrieve Python frame objects: if a frame is <optimized out>. When Python is built with “clang -Og”, gdb can fail to retrive the frame parameter of _PyEval_EvalFrameDefault(). In this case, tests like py_bt() are likely to fail. Without getting access to Python frames, python-gdb.py is mostly clueless on retrieving the Python traceback. Moreover, test_gdb is no longer skipped on macOS if Python is built with Clang. Patch by Victor Stinner.
  • gh-108962: Skip test_tempfile.test_flags() if chflags() fails with “OSError: [Errno 45] Operation not supported” (ex: on FreeBSD 13). Patch by Victor Stinner.
  • gh-89392: Removed support of test_main() function in tests. They now always use normal unittest test runner.
  • gh-108851: Fix test_tomllib recursion tests for WASI buildbots: reduce the recursion limit and compute the maximum nested array/dict depending on the current available recursion limit. Patch by Victor Stinner.
  • gh-108851: Add get_recursion_available() and get_recursion_depth() functions to the test.support module. Patch by Victor Stinner.
  • gh-108822: regrtest now computes statistics on all tests: successes, failures and skipped. test_netrc, test_pep646_syntax and test_xml_etree now return results in their test_main() function. Patch by Victor Stinner and Alex Waygood.
  • gh-108388: Convert test_concurrent_futures to a package of 7 sub-tests. Patch by Victor Stinner.
  • gh-108388: Split test_multiprocessing_fork, test_multiprocessing_forkserver and test_multiprocessing_spawn into test packages. Each package is made of 4 sub-tests: processes, threads, manager and misc. It allows running more tests in parallel and so reduce the total test duration. Patch by Victor Stinner.
  • gh-101634: When running the Python test suite with -jN option, if a worker stdout cannot be decoded from the locale encoding report a failed testn so the exitcode is non-zero. Patch by Victor Stinner.
  • gh-100086: The Python test runner (libregrtest) now logs Python build information like “debug” vs “release” build, or LTO and PGO optimizations. Patch by Victor Stinner.
  • gh-98903: The Python test suite now fails wit exit code 4 if no tests ran. It should help detecting typos in test names and test methods.
  • gh-95027: On Windows, when the Python test suite is run with the -jN option, the ANSI code page is now used as the encoding for the stdout temporary file, rather than using UTF-8 which can lead to decoding errors. Patch by Victor Stinner.
  • gh-93353: regrtest now checks if a test leaks temporary files or directories if run with -jN option. Patch by Victor Stinner.
  • Build
  • gh-63760: Fix Solaris build: no longer redefine the gethostname() function. Solaris defines the function since 2005. Patch by Victor Stinner, original patch by Jakub Kulík.
  • gh-108740: Fix a race condition in make regen-all. The deepfreeze.c source and files generated by Argument Clinic are now generated or updated before generating “global objects”. Previously, some identifiers may miss depending on the order in which these files were generated. Patch by Victor Stinner.
  • Windows:
  • gh-109991: Update Windows build to use OpenSSL 3.0.11.
  • gh-107565: Update Windows build to use OpenSSL 3.0.10.
  • Tools/Demos:
  • gh-109991: Update GitHub CI workflows to use OpenSSL 3.0.11 and multissltests to use 1.1.1w, 3.0.11, and 3.1.3.

New in Python 3.12.0 RC 2 (Sep 6, 2023)

  • New features:
  • More flexible f-string parsing, allowing many things previously disallowed (PEP 701).
  • Support for the buffer protocol in Python code (PEP 688).
  • A new debugging/profiling API (PEP 669).
  • Support for isolated subinterpreters with separate Global Interpreter Locks (PEP 684).
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Support for the Linux perf profiler to report Python function names in traces.
  • Many large and small performance improvements (like PEP 709), delivering an estimated 5% overall performance improvementcitation needed.
  • Type annotations:
  • New type annotation syntax for generic classes (PEP 695).
  • New override decorator for methods (PEP 698).
  • Deprecations:
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation for performance enhancements. (This should not affect most users as it is an internal detail, but it may cause problems for Cython-generated code.)

New in Python 3.11.5 (Aug 25, 2023)

  • General changes:
  • PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
  • PEP 654 -- Exception Groups and except*
  • PEP 680 -- tomllib: Support for Parsing TOML in the Standard Library
  • gh-90908 -- Introduce task groups to asyncio
  • gh-34627 -- Atomic grouping ((?>...)) and possessive quantifiers (*+, ++, ?+, {m,n}+) are now supported in regular expressions.
  • The Faster CPython Project is already yielding some exciting results. Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.22x speedup on the standard benchmark suite. See Faster CPython for details.
  • Typing and typing language changes:
  • PEP 673 -- Self Type
  • PEP 646 -- Variadic Generics
  • PEP 675 -- Arbitrary Literal String Type
  • PEP 655 -- Marking individual TypedDict items as required or potentially-missing
  • PEP 681 -- Data Class Transforms

New in Python 3.11.4 (Jun 7, 2023)

  • General changes:
  • PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
  • PEP 654 -- Exception Groups and except*
  • PEP 680 -- tomllib: Support for Parsing TOML in the Standard Library
  • gh-90908 -- Introduce task groups to asyncio
  • gh-34627 -- Atomic grouping ((?>...)) and possessive quantifiers (*+, ++, ?+, {m,n}+) are now supported in regular expressions.
  • The Faster CPython Project is already yielding some exciting results. Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.22x speedup on the standard benchmark suite. See Faster CPython for details.
  • Typing and typing language changes:
  • PEP 673 -- Self Type
  • PEP 646 -- Variadic Generics
  • PEP 675 -- Arbitrary Literal String Type
  • PEP 655 -- Marking individual TypedDict items as required or potentially-missing
  • PEP 681 -- Data Class Transforms

New in Python 3.12.0 Beta 2 (Jun 7, 2023)

  • Some of the new major new features and changes in Python 3.12 are:
  • New type annotation syntax for generic classes (PEP 695).
  • More flexible f-string parsing, allowing many things previously disallowed (PEP 701).
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Many large and small performance improvements (like PEP 709).
  • Support for the Linux perf profiler to report Python function names in traces.
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation for performance enhancements. (This should not affect most users as it is an internal detail, but it may cause problems for Cython-generated code.)
  • (Hey, fellow core developer, if a feature you find important is missing from this list, let Thomas know.)

New in Python 3.11.3 (Apr 5, 2023)

  • General changes:
  • PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
  • PEP 654 -- Exception Groups and except*
  • PEP 680 -- tomllib: Support for Parsing TOML in the Standard Library
  • gh-90908 -- Introduce task groups to asyncio
  • gh-34627 -- Atomic grouping ((?>...)) and possessive quantifiers (*+, ++, ?+, {m,n}+) are now supported in regular expressions.
  • The Faster CPython Project is already yielding some exciting results. Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.22x speedup on the standard benchmark suite. See Faster CPython for details.
  • Typing and typing language changes:
  • PEP 673 -- Self Type
  • PEP 646 -- Variadic Generics
  • PEP 675 -- Arbitrary Literal String Type
  • PEP 655 -- Marking individual TypedDict items as required or potentially-missing
  • PEP 681 -- Data Class Transforms

New in Python 3.12.0 Alpha 6 (Mar 8, 2023)

  • Many new features for Python 3.12 are still being planned and written. Among the new major new features and changes so far:
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Support for the Linux perf profiler to report Python function names in traces.
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package (installed by default in virtualenvs and many other places) continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • Invalid backslash escape sequences in strings now warn with SyntaxWarning instead of DeprecationWarning, making them more visible. (They will become syntax errors in the future.)
  • The internal representation of integers has changed in preparation for performance enhancements. (This should not affect most users as it is an internal detail, but it may cause problems for Cython-generated code.)
  • (Hey, fellow core developer, if a feature you find important is missing from this list, let Thomas know.)

New in Python 3.11.2 (Feb 8, 2023)

  • General changes:
  • Include Fine-Grained Error Locations in Tracebacks
  • Exception Groups and except*
  • - tomllib: Support for Parsing TOML in the Standard Library
  • Introduce task groups to asyncio
  • Atomic grouping ((?>...)) and possessive quantifiers (*+, ++, ?+, {m,n}+) are now supported in regular expressions.
  • The Faster CPython Project is already yielding some exciting results. Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.22x speedup on the standard benchmark suite. See Faster CPython for details.
  • Typing and typing language changes:
  • Self Type
  • Variadic Generics
  • Arbitrary Literal String Type
  • Data Class Transforms

New in Python 3.11.1 (Dec 7, 2022)

  • General changes:
  • PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
  • PEP 654 -- Exception Groups and except*
  • PEP 680 -- tomllib: Support for Parsing TOML in the Standard Library
  • gh-90908 -- Introduce task groups to asyncio
  • gh-34627 -- Atomic grouping ((?>...)) and possessive quantifiers (*+, ++, ?+, {m,n}+) are now supported in regular expressions.
  • The Faster CPython Project is already yielding some exciting results. Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.22x speedup on the standard benchmark suite. See Faster CPython for details.
  • Typing and typing language changes:
  • PEP 673 -- Self Type
  • PEP 646 -- Variadic Generics
  • PEP 675 -- Arbitrary Literal String Type
  • PEP 655 -- Marking individual TypedDict items as required or potentially-missing
  • PEP 681 -- Data Class Transforms
  • More resources:
  • Online Documentation
  • PEP 664, 3.11 Release Schedule
  • Report bugs at https://github.com/python/cpython/issues.
  • Help fund Python and its community.
  • And now for something completely different:
  • Quark–gluon plasma (QGP) or quark soup is an interacting localized assembly of quarks and gluons at thermal and chemical equilibrium. The word plasma signals that free colour charges are allowed. In a 1987 summary, Léon van Hove pointed out the equivalence of the three terms: quark-gluon plasma, quark matter and a new state of matter. Since the temperature is above the Hagedorn temperature—and thus above the scale of light u,d-quark mass—the pressure exhibits the relativistic Stefan-Boltzmann format governed by temperature to the fourth power (T^4) and many practically massless quark and gluon constituents. It can be said that QGP emerges to be the new phase of strongly interacting matter which manifests its physical properties in terms of nearly free dynamics of practically massless gluons and quarks. Both quarks and gluons must be present in conditions near chemical equilibrium with their colour charge open for a new state of matter to be referred to as QGP.
  • In the Big Bang theory, quark–gluon plasma filled the entire Universe before matter as we know it was created. Theories predicting the existence of quark–gluon plasma were developed in the late 1970s and early 1980s. Discussions around heavy ion experimentation followed suit and the first experiment proposals were put forward at CERN and BNL in the following years. Quark–gluon plasma was detected for the first time in the laboratory at CERN in the year 2000.

New in Python 3.12.0 Alpha 2 (Nov 17, 2022)

  • Many new features for Python 3.12 are still being planned and written. Among the new major new features and changes so far:
  • Even more improved error messages. More exceptions potentially caused by typos now make suggestions to the user.
  • Support for the Linux perf profiler to report Python function names in traces.
  • The deprecated wstr and wstr_length members of the C implementation of unicode objects were removed, per PEP 623.
  • In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2).
  • The deprecated smtpd and distutils modules have been removed (see PEP 594 and PEP 632. The setuptools package (installed by default in virtualenvs and many other places) continues to provide the distutils module.
  • A number of other old, broken and deprecated functions, classes and methods have been removed.
  • (Hey, fellow core developer, if a feature you find important is missing from this list, let Thomas know.)

New in Python 3.11.0 (Oct 25, 2022)

  • General changes:
  • PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
  • PEP 654 -- Exception Groups and except*
  • PEP 680 -- tomllib: Support for Parsing TOML in the Standard Library
  • gh-90908 -- Introduce task groups to asyncio
  • gh-34627 -- Atomic grouping ((?>...)) and possessive quantifiers (*+, ++, ?+, {m,n}+) are now supported in regular expressions.
  • The Faster CPython Project is already yielding some exciting results. Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.22x speedup on the standard benchmark suite. See Faster CPython for details.
  • Typing and typing language changes:
  • PEP 673 -- Self Type
  • PEP 646 -- Variadic Generics
  • PEP 675 -- Arbitrary Literal String Type
  • PEP 655 -- Marking individual TypedDict items as required or potentially-missing
  • PEP 681 -- Data Class Transforms

New in Python 3.10.5 (Jun 6, 2022)

  • Among the new major new features and changes so far:
  • PEP 623 -- Deprecate and prepare for the removal of the wstr member in PyUnicodeObject.
  • PEP 604 -- Allow writing union types as X | Y
  • PEP 612 -- Parameter Specification Variables
  • PEP 626 -- Precise line numbers for debugging and other tools.
  • PEP 618 -- Add Optional Length-Checking To zip.
  • Bpo-12782: Parenthesized context managers are now officially allowed.
  • PEP 632 -- Deprecate distutils module.
  • PEP 613 -- Explicit Type Aliases
  • PEP 634 -- Structural Pattern Matching: Specification
  • PEP 635 -- Structural Pattern Matching: Motivation and Rationale
  • PEP 636 -- Structural Pattern Matching: Tutorial
  • PEP 644 -- Require OpenSSL 1.1.1 or newer
  • PEP 624 -- Remove Py_UNICODE encoder APIs
  • PEP 597 -- Add optional EncodingWarning
  • Bpo-38605: from __future__ import annotations (PEP 563) used to be on this list in previous pre-releases but it has been postponed to Python 3.11 due to some compatibility concerns. You can read the Steering Council communication about it here to learn more.

New in Python 3.11.0 Beta 3 (Jun 2, 2022)

  • General changes:
  • Include Fine-Grained Error Locations in Tracebacks
  • Exception Groups and except*
  • tomllib: Support for Parsing TOML in the Standard Library
  • Data Class Transforms
  • Introduce task groups to asyncio
  • Atomic grouping ((?>...)) and possessive quantifiers (*+, ++, ?+, {m,n}+) are now supported in regular expressions.
  • The Faster Cpython Project is already yielding some exciting results. Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.22x speedup on the standard benchmark suite. See Faster CPython for details.
  • Typing and typing language changes:
  • Self Type
  • Variadic Generics
  • Arbitrary Literal String Type
  • Marking individual TypedDict items as required or potentially-missing

New in Python 3.11.0 Beta 2 (Jun 1, 2022)

  • General changes:
  • PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
  • PEP 654 -- Exception Groups and except*
  • PEP 680-- tomllib: Support for Parsing TOML in the Standard Library
  • PEP 681-- Data Class Transforms
  • bpo-46752-- Introduce task groups to asyncio
  • bpo-433030 -- Atomic grouping ((?>...)) and possessive quantifiers (*+, ++, ?+, {m,n}+) are now supported in regular expressions.
  • The Faster Cpython Project is already yielding some exciting results. Python 3.11 is up to 10-60% faster than Python 3.10. On average, we measured a 1.22x speedup on the standard benchmark suite. See Faster CPython for details.
  • Typing and typing language changes:
  • PEP 673 -- Self Type
  • PEP 646-- Variadic Generics
  • PEP 675-- Arbitrary Literal String Type
  • PEP 655-- Marking individual TypedDict items as required or potentially-missing

New in Python 3.10.4 (Mar 24, 2022)

  • Deprecate and prepare for the removal of the wstr member in PyUnicodeObject.
  • Allow writing union types as X | Y
  • PParameter Specification Variables
  • Precise line numbers for debugging and other tools.
  • Add Optional Length-Checking To zip.
  • Parenthesized context managers are now officially allowed.
  • Deprecate distutils module.
  • Explicit Type Aliases
  • Structural Pattern Matching: Specification
  • PStructural Pattern Matching: Motivation and Rationale
  • Structural Pattern Matching: Tutorial
  • Require OpenSSL 1.1.1 or newer
  • Remove Py_UNICODE encoder APIs
  • Add optional EncodingWarning

New in Python 3.10.2 (Jan 17, 2022)

  • Core and Builtins:
  • bpo-46347: Fix memory leak in PyEval_EvalCodeEx.
  • bpo-46289: ASDL declaration of FormattedValue has changed to reflect conversion field is not optional.
  • bpo-46237: Fix the line number of tokenizer errors inside f-strings. Patch by Pablo Galindo.
  • bpo-46006: Fix a regression when a type method like __init__() is modified in a subinterpreter. Fix a regression in _PyUnicode_EqualToASCIIId() and type update_slot(). Revert the change which made the Unicode dictionary of interned strings compatible with subinterpreters: the internal interned dictionary is shared again by all interpreters. Patch by Victor Stinner.
  • bpo-46085: Fix iterator cache mechanism of OrderedDict.
  • bpo-46110: Add a maximum recursion check to the PEG parser to avoid stack overflow. Patch by Pablo Galindo
  • bpo-46054: Fix parser error when parsing non-utf8 characters in source files. Patch by Pablo Galindo.
  • bpo-46042: Improve the location of the caret in SyntaxError exceptions emitted by the symbol table. Patch by Pablo Galindo.
  • bpo-46025: Fix a crash in the atexit module involving functions that unregister themselves before raising exceptions. Patch by Pablo Galindo.
  • bpo-46009: Restore behavior from 3.9 and earlier when sending non-None to newly started generator. In 3.9 this did not affect the state of the generator. In 3.10.0 and 3.10.1 gen_func().send(0) is equivalent to gen_func().throw(TypeError(...) which exhausts the generator. In 3.10.2 onward, the behavior has been reverted to that of 3.9.
  • bpo-46000: Improve compatibility of the curses module with NetBSD curses.
  • bpo-46004: Fix the SyntaxError location for errors involving for loops with invalid targets. Patch by Pablo Galindo
  • bpo-42918: Fix bug where the built-in compile() function did not always raise a SyntaxError when passed multiple statements in ‘single’ mode. Patch by Weipeng Hong.
  • Library:
  • bpo-40479: Fix hashlib usedforsecurity option to work correctly with OpenSSL 3.0.0 in FIPS mode.
  • bpo-46070: Fix possible segfault when importing the asyncio module from different sub-interpreters in parallel. Patch by Erlend E. Aasland.
  • bpo-46278: Reflect context argument in AbstractEventLoop.call_*() methods. Loop implementations already support it.
  • bpo-46239: Improve error message when importing asyncio.windows_events on non-Windows.
  • bpo-20369: concurrent.futures.wait() no longer blocks forever when given duplicate Futures. Patch by Kumar Aditya.
  • bpo-46105: Honor spec when generating requirement specs with urls and extras (importlib_metadata 4.8.3).
  • bpo-26952: argparse raises ValueError with clear message when trying to render usage for an empty mutually-exclusive group. Previously it raised a cryptic IndexError.
  • bpo-27718: Fix help for the signal module. Some functions (e.g. signal() and getsignal()) were omitted.
  • bpo-46032: The registry() method of functools.singledispatch() functions checks now the first argument or the first parameter annotation and raises a TypeError if it is not supported. Previously unsupported “types” were ignored (e.g. typing.List[int]) or caused an error at calling time (e.g. list[int]).
  • bpo-46018: Ensure that math.expm1() does not raise on underflow.
  • bpo-45755: typing generic aliases now reveal the class attributes of the original generic class when passed to dir(). This was the behavior up to Python 3.6, but was changed in 3.7-3.9.
  • bpo-13236: unittest.TextTestResult and unittest.TextTestRunner flush now the output stream more often.
  • bpo-42378: Fixes the issue with log file being overwritten when logging.FileHandler is used in atexit with filemode set to 'w'. Note this will cause the message in atexit not being logged if the log stream is already closed due to shutdown of logging.
  • Documentation:
  • bpo-46120: State that | is preferred for readability over Union in the typing docs.
  • bpo-46040: Fix removal Python version for @asyncio.coroutine, the correct value is 3.11.
  • bpo-19737: Update the documentation for the globals() function.
  • bpo-45840: Improve cross-references in the documentation for the data model.
  • Tests:
  • bpo-46205: Fix hang in runtest_mp due to race condition
  • bpo-46263: Fix test_capi on FreeBSD 14-dev: instruct jemalloc to not fill freed memory with junk byte.
  • bpo-46150: Now fakename in test_pathlib.PosixPathTest.test_expanduser is checked to be non-existent.
  • bpo-46129: Rewrite asyncio.locks tests with unittest.IsolatedAsyncioTestCase usage.
  • bpo-46114: Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses 0xMNN00PP0L.
  • Build:
  • bpo-46263: configure no longer sets MULTIARCH on FreeBSD platforms.
  • bpo-46106: Updated OpenSSL to 1.1.1m in Windows builds, macOS installer builds, and CI. Patch by Kumar Aditya.
  • C API:
  • bpo-46236: Fix a bug in PyFunction_GetAnnotations() that caused it to return a tuple instead of a dict.

New in Python 3.10.1 (Dec 7, 2021)

  • Major new features of the 3.10 series, compared to 3.9:
  • Among the new major new features and changes so far:
  • PEP 623 -- Deprecate and prepare for the removal of the wstr member in PyUnicodeObject.
  • PEP 604 -- Allow writing union types as X | Y
  • PEP 612 -- Parameter Specification Variables
  • PEP 626 -- Precise line numbers for debugging and other tools.
  • PEP 618 -- Add Optional Length-Checking To zip.
  • bpo-12782: Parenthesized context managers are now officially allowed.
  • PEP 632 -- Deprecate distutils module.
  • PEP 613 -- Explicit Type Aliases
  • PEP 634 -- Structural Pattern Matching: Specification
  • PEP 635 -- Structural Pattern Matching: Motivation and Rationale
  • PEP 636 -- Structural Pattern Matching: Tutorial
  • PEP 644 -- Require OpenSSL 1.1.1 or newer
  • PEP 624 -- Remove Py_UNICODE encoder APIs
  • PEP 597 -- Add optional EncodingWarning

New in Python 3.11.0 Alpha 2 (Nov 5, 2021)

  • Python 3.11 is still in development. This release, 3.11.0a2 is the second of seven planned alpha releases.
  • Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process.
  • During the alpha phase, features may be added up until the start of the beta phase (2022-05-06) and, if necessary, may be modified or deleted up until the release candidate phase (2022-08-01). Please keep in mind that this is a preview release and its use is not recommended for production environments.
  • Many new features for Python 3.11 are still being planned and written. Among the new major new features and changes so far:
  • PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
  • The Faster Cpython Project is already yielding some exciting results: this version of CPython 3.11 is ~12% faster on the geometric mean of the PyPerformance benchmarks, compared to 3.10.0.

New in Python 3.11.0 Alpha 1 (Oct 7, 2021)

  • Many new features for Python 3.11 are still being planned and written. Among the new major new features and changes so far:
  • PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
  • PEP 654 -- PEP 654 -- Exception Groups and except*

New in Python 3.10.0 (Oct 4, 2021)

  • Among the new major new features and changes so far:
  • PEP 623 -- Deprecate and prepare for the removal of the wstr member in PyUnicodeObject.
  • PEP 604 -- Allow writing union types as X | Y
  • PEP 612 -- Parameter Specification Variables
  • PEP 626 -- Precise line numbers for debugging and other tools.
  • PEP 618 -- Add Optional Length-Checking To zip.
  • bpo-12782: Parenthesized context managers are now officially allowed.
  • PEP 632 -- Deprecate distutils module.
  • PEP 613 -- Explicit Type Aliases
  • PEP 634 -- Structural Pattern Matching: Specification
  • PEP 635 -- Structural Pattern Matching: Motivation and Rationale
  • PEP 636 -- Structural Pattern Matching: Tutorial
  • PEP 644 -- Require OpenSSL 1.1.1 or newer
  • PEP 624 -- Remove Py_UNICODE encoder APIs
  • PEP 597 -- Add optional EncodingWarning

New in Python 3.9.7 (Aug 31, 2021)

  • PEP 573, Module State Access from C Extension Methods
  • PEP 584, Union Operators in dict
  • PEP 585, Type Hinting Generics In Standard Collections
  • PEP 593, Flexible function and variable annotations
  • PEP 602, Python adopts a stable annual release cadence
  • PEP 614, Relaxing Grammar Restrictions On Decorators
  • PEP 615, Support for the IANA Time Zone Database in the Standard Library
  • PEP 616, String methods to remove prefixes and suffixes
  • PEP 617, New PEG parser for CPython
  • BPO 38379, garbage collection does not block on resurrected objects;
  • BPO 38692, os.pidfd_open added that allows process management without races and signals;
  • BPO 39926, Unicode support updated to version 13.0.0;
  • BPO 1635741, when Python is initialized multiple times in the same process, it does not leak memory anymore;
  • A number of Python builtins (range, tuple, set, frozenset, list, dict) are now sped up using PEP 590 vectorcall;
  • A number of Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, operator, resource, time, _weakref) now use multiphase initialization as defined by PEP 489;
  • A number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.

New in Python 3.10.0 RC 1 (Aug 4, 2021)

  • Many new features for Python 3.10 are still being planned and written. Among the new major new features and changes so far:
  • PEP 623 -- Deprecate and prepare for the removal of the wstr member in PyUnicodeObject.
  • PEP 604 -- Allow writing union types as X | Y
  • PEP 612 -- Parameter Specification Variables
  • PEP 626 -- Precise line numbers for debugging and other tools.
  • PEP 618 -- Add Optional Length-Checking To zip.
  • bpo-12782: Parenthesized context managers are now officially allowed.
  • PEP 632 -- Deprecate distutils module.
  • PEP 613 -- Explicit Type Aliases
  • PEP 634 -- Structural Pattern Matching: Specification
  • PEP 635 -- Structural Pattern Matching: Motivation and Rationale
  • PEP 636 -- Structural Pattern Matching: Tutorial
  • PEP 644 -- Require OpenSSL 1.1.1 or newer
  • PEP 624 -- Remove Py_UNICODE encoder APIs
  • PEP 597 -- Add optional EncodingWarning

New in Python 3.9.6 (Jun 28, 2021)

  • This is the sixth maintenance release of Python 3.9:
  • Python 3.9.6 is the newest major release of the Python programming language, and it contains many new features and optimizations. There's been 146 commits since 3.9.5 which is a similar amount compared to 3.8 at the same stage of the release cycle. See the changelog for details.
  • Major new features of the 3.9 series, compared to 3.8
  • Some of the new major new features and changes in Python 3.9 are:
  • PEP 573, Module State Access from C Extension Methods
  • PEP 584, Union Operators in dict
  • PEP 585, Type Hinting Generics In Standard Collections
  • PEP 593, Flexible function and variable annotations
  • PEP 602, Python adopts a stable annual release cadence
  • PEP 614, Relaxing Grammar Restrictions On Decorators
  • PEP 615, Support for the IANA Time Zone Database in the Standard Library
  • PEP 616, String methods to remove prefixes and suffixes
  • PEP 617, New PEG parser for CPython
  • BPO 38379, garbage collection does not block on resurrected objects;
  • BPO 38692, os.pidfd_open added that allows process management without races and signals;
  • BPO 39926, Unicode support updated to version 13.0.0;
  • BPO 1635741, when Python is initialized multiple times in the same process, it does not leak memory anymore;
  • A number of Python builtins (range, tuple, set, frozenset, list, dict) are now sped up using PEP 590 vectorcall;
  • A number of Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, operator, resource, time, _weakref) now use multiphase initialization as defined by PEP 489;
  • A number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.
  • You can find a more comprehensive list in this release's "What's New" (https://docs.python.org/release/3.9.0/whatsnew/3.9.html) document.

New in Python 3.10.0 Beta 3 (Jun 28, 2021)

  • Many new features for Python 3.10 are still being planned and written. Among the new major new features and changes so far:
  • PEP 623 -- Deprecate and prepare for the removal of the wstr member in PyUnicodeObject.
  • PEP 604 -- Allow writing union types as X | Y
  • PEP 612 -- Parameter Specification Variables
  • PEP 626 -- Precise line numbers for debugging and other tools.
  • PEP 618 -- Add Optional Length-Checking To zip.
  • bpo-12782: Parenthesized context managers are now officially allowed.
  • PEP 632 -- Deprecate distutils module.
  • PEP 613 -- Explicit Type Aliases
  • PEP 634 -- Structural Pattern Matching: Specification
  • PEP 635 -- Structural Pattern Matching: Motivation and Rationale
  • PEP 636 -- Structural Pattern Matching: Tutorial
  • PEP 644 -- Require OpenSSL 1.1.1 or newer
  • PEP 624 -- Remove Py_UNICODE encoder APIs
  • PEP 597 -- Add optional EncodingWarning

New in Python 3.9.5 (May 4, 2021)

  • Security:
  • Creating a sqlite3.Connection object now also produces a sqlite3.connect auditing event. Previously this event was only produced by sqlite3.connect() calls. Patch by Erlend E. Aasland.
  • The presence of newline or tab characters in parts of a URL could allow some forms of attacks.
  • Following the controlling specification for URLs defined by WHATWG urllib.parse() now removes ASCII newlines and tabs from URLs, preventing such attacks.
  • Ensures interpreter-level audit hooks receive the cpython.PyInterpreterState_New event when called through the _xxsubinterpreters module.
  • ipaddress module no longer accepts any leading zeros in IPv4 address strings. Leading zeros are ambiguous and interpreted as octal notation by some libraries. For example the legacy function socket.inet_aton() treats leading zeros as octal notatation. glibc implementation of modern inet_pton() does not accept any leading zeros. For a while the ipaddress module used to accept ambiguous leading zeros.
  • Fix Regular Expression Denial of Service (ReDoS) vulnerability in urllib.request.AbstractBasicAuthHandler. The ReDoS-vulnerable regex has quadratic worst-case complexity and it allows cause a denial of service when identifying crafted invalid RFCs. This ReDoS issue is on the client side and needs remote attackers to control the HTTP server.
  • Audit hooks are now fired for frame.f_code, traceback.tb_frame, and generator code/frame attribute access.
  • Core and Builtins:
  • Importlib now resolves relative paths when creating module spec objects from file locations.
  • Fix bytearray repetition incorrectly copying data from the start of the buffer, even if the data is offset within the buffer (e.g. after reassigning a slice at the start of the bytearray to a shorter byte string).
  • Library:
  • Update bundled pip to 21.1.1.
  • Fixed the turtle module working with non-default root window.
  • Update bundled pip to 21.1 and setuptools to 56.0.0
  • OpenSSL 3.0.0: load_verify_locations() now returns a consistent error message when cadata contains no valid certificate.
  • urllib can now convert Windows paths with \? prefixes into URL paths.
  • platform.win32_ver derives the windows version from sys.getwindowsversion().platform_version which in turn derives the version from kernel32.dll (which can be of a different version than Windows itself). Therefore change the platform.win32_ver to determine the version using the platform module’s _syscmd_ver private function to return an accurate version.
  • [Enum] ensure exceptions raised in _missing__ are released
  • OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 to suppress deprecation warnings. Python requires OpenSSL 1.1.1 APIs.
  • Add ssl.OP_IGNORE_UNEXPECTED_EOF constants (OpenSSL 3.0.0)
  • OpenSSL 3.0.0: Don’t call the password callback function a second time when first call has signaled an error condition.
  • The header files for ssl error codes are now OpenSSL version-specific. Exceptions will now show correct reason and library codes. The make_ssl_data.py script has been rewritten to use OpenSSL’s text file with error codes.
  • tkinter dialog windows are now recognized as dialogs by window managers on macOS and X Window.
  • turtle.textinput() and turtle.numinput() create now a transient window working on behalf of the canvas window.
  • Fix problem with hostname_checks_common_name. OpenSSL does not copy hostflags from struct SSL_CTX to struct SSL.
  • Allow bytes separator argument in urllib.parse.parse_qs and urllib.parse.parse_qsl when parsing str query strings. Previously, this raised a TypeError.
  • Fixed processing of a dataclass that inherits from a frozen dataclass with no fields. It is now correctly detected as an error.
  • Fix thread locks in zlib module may go wrong in rare case. Patch by Ma Lin.
  • Fix dataclasses with InitVars and replace(). Patch by Claudiu Popa.
  • Fix a regression in the handling of ctypes’ ctypes.c_wchar_p type: embedded null characters would cause a ValueError to be raised. Patch by Zackery Spytz.
  • Documentation:
  • The documentation on the PyContextVar C-API was clarified.
  • Update dataclasses documentation to express that FrozenInstanceError is derived from AttributeError.
  • Update documentation to reflect that unparenthesized lambda expressions can no longer be the expression part in an if clause in comprehensions and generator expressions since Python 3.9.
  • Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.
  • Tests:
  • Fix test_logging.test_namer_rotator_inheritance() on Windows: use os.replace() rather than os.rename(). Patch by Victor Stinner.
  • Fix a race condition in the SMTP test of test_logging. Don’t close a file descriptor (socket) from a different thread while asyncore.loop() is polling the file descriptor. Patch by Victor Stinner.
  • Tests multiple OpenSSL versions on GitHub Actions. Use ccache to speed up testing.
  • OpenSSL 3.0.0: Disable testing of legacy protocols TLS 1.0 and 1.1. Tests are failing with TLSV1_ALERT_INTERNAL_ERROR.
  • Windows:
  • Avoid raising errors from pathlib.Path.exists() when passed an invalid filename.
  • Fixed os.stat() failing on inaccessible directories with a trailing slash, rather than falling back to the parent directory’s metadata. This implicitly affected os.path.exists() and os.path.isdir().
  • Fixed decoding of host names in socket.gethostbyaddr() and socket.gethostbyname_ex().
  • Updated pegen regeneration script on Windows to find and use Python 3.8 or higher. Prior to this, pegen regeneration already required 3.8 or higher, but the script may have used lower versions of Python.
  • Actually updates Windows release to OpenSSL 1.1.1k. Earlier releases were mislabelled and actually included 1.1.1i again.
  • Upgrade Windows installer to use SQLite 3.35.5.
  • IDLE:
  • IDLE dialog windows are now recognized as dialogs by window managers on macOS and X Window.

New in Python 3.9.4 (Apr 5, 2021)

  • Core and Builtins:
  • bpo-43710: Reverted the fix for https://bugs.python.org/issue42500 as it changed the PyThreadState struct size and broke the 3.9.x ABI in the 3.9.3 release (visible on 32-bit platforms using binaries compiled using an earlier version of Python 3.9.x headers).
  • Library:
  • bpo-26053: Fixed bug where the pdb interactive run command echoed the args from the shell command line, even if those have been overridden at the pdb prompt.

New in Python 3.9.3 (Apr 3, 2021)

  • Security:
  • bpo-42988: CVE-2021-3426: Remove the getfile feature of the pydoc module which could be abused to read arbitrary files on the disk (directory traversal vulnerability). Moreover, even source code of Python modules can contain sensitive data like passwords. Vulnerability reported by David Schwörer.
  • bpo-43285: ftplib no longer trusts the IP address value returned from the server in response to the PASV command by default. This prevents a malicious FTP server from using the response to probe IPv4 address and port combinations on the client network.
  • Code that requires the former vulnerable behavior may set a trust_server_pasv_ipv4_address attribute on their ftplib.FTP instances to True to re-enable it.
  • bpo-43439: Add audit hooks for gc.get_objects(), gc.get_referrers() and gc.get_referents(). Patch by Pablo Galindo.
  • Core and Builtins:
  • bpo-43660: Fix crash that happens when replacing sys.stderr with a callable that can remove the object while an exception is being printed. Patch by Pablo Galindo.
  • bpo-43555: Report the column offset for SyntaxError for invalid line continuation characters. Patch by Pablo Galindo.
  • bpo-43517: Fix misdetection of circular imports when using from pkg.mod import attr, which caused false positives in non-trivial multi-threaded code.
  • bpo-35883: Python no longer fails at startup with a fatal error if a command line argument contains an invalid Unicode character. The Py_DecodeLocale() function now escapes byte sequences which would be decoded as Unicode characters outside the [U+0000; U+10ffff] range.
  • bpo-43406: Fix a possible race condition where PyErr_CheckSignals tries to execute a non-Python signal handler.
  • bpo-42500: Improve handling of exceptions near recursion limit. Converts a number of Fatal Errors in RecursionErrors.
  • Library:
  • bpo-43433: xmlrpc.client.ServerProxy no longer ignores query and fragment in the URL of the server.
  • bpo-35930: Raising an exception raised in a “future” instance will create reference cycles.
  • bpo-43577: Fix deadlock when using ssl.SSLContext debug callback with ssl.SSLContext.sni_callback().
  • bpo-43521: ast.unparse can now render NaNs and empty sets.
  • bpo-43423: subprocess.communicate() no longer raises an IndexError when there is an empty stdout or stderr IO buffer during a timeout on Windows.
  • bpo-27820: Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN with initial_response_ok=False will fail.
  • The cause is that SMTP.auth_login _always_ returns a password if provided with a challenge string, thus non-compliant with the standard for AUTH LOGIN.
  • Also fixes bug with the test for smtpd.
  • bpo-43332: Improves the networking efficiency of http.client when using a proxy via set_tunnel(). Fewer small send calls are made during connection setup.
  • bpo-43399: Fix ElementTree.extend not working on iterators when using the Python implementation
  • bpo-43316: The python -m gzip command line application now properly fails when detecting an unsupported extension. It exits with a non-zero exit code and prints an error message to stderr.
  • bpo-43260: Fix TextIOWrapper can not flush internal buffer forever after very large text is written.
  • bpo-42782: Fail fast in shutil.move() to avoid creating destination directories on failure.
  • bpo-37193: Fixed memory leak in socketserver.ThreadingMixIn introduced in Python 3.7.
  • Documentation:
  • bpo-43199: Answer “Why is there no goto?” in the Design and History FAQ.
  • bpo-43407: Clarified that a result from time.monotonic(), time.perf_counter(), time.process_time(), or time.thread_time() can be compared with the result from any following call to the same function - not just the next immediate call.
  • bpo-27646: Clarify that ‘yield from <expr>’ works with any iterable, not just iterators.
  • bpo-36346: Update some deprecated unicode APIs which are documented as “will be removed in 4.0” to “3.12”. See PEP 623 for detail.
  • Tests:
  • bpo-37945: Fix test_getsetlocale_issue1813() of test_locale: skip the test if setlocale() fails. Patch by Victor Stinner.
  • bpo-41561: Add workaround for Ubuntu’s custom OpenSSL security level policy.
  • bpo-43288: Fix test_importlib to correctly skip Unicode file tests if the fileystem does not support them.
  • Build:
  • bpo-43631: Update macOS, Windows, and CI to OpenSSL 1.1.1k.
  • bpo-43617: Improve configure.ac: Check for presence of autoconf-archive package and remove our copies of M4 macros.
  • macOS:
  • bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j.
  • IDLE:
  • bpo-42225: Document that IDLE can fail on Unix either from misconfigured IP masquerage rules or failure displaying complex colored (non-ascii) characters.
  • bpo-43283: Document why printing to IDLE’s Shell is often slower than printing to a system terminal and that it can be made faster by pre-formatting a single string before printing.

New in Python 3.10.0 Alpha 6 (Mar 2, 2021)

  • Many new features for Python 3.10 are still being planned and written. Among the new major new features and changes so far:
  • PEP 623 -- Remove wstr from Unicode
  • PEP 604 -- Allow writing union types as X | Y
  • PEP 612 -- Parameter Specification Variables
  • PEP 626 -- Precise line numbers for debugging and other tools.
  • bpo-38605: from __future__ import annotations (PEP 563) is now the default.
  • PEP 618 -- Add Optional Length-Checking To zip.
  • bpo-12782: Parenthesized context managers are now officially allowed.
  • PEP 632 -- Deprecate distutils module.
  • PEP 613 -- Explicit Type Aliases
  • PEP 634 -- Structural Pattern Matching: Specification
  • PEP 635 -- Structural Pattern Matching: Motivation and Rationale
  • PEP 636 -- Structural Pattern Matching: Tutorial
  • The next pre-release of Python 3.10 will be 3.10.0a7 ( last alpha release), currently scheduled for Monday, 2021-04-05.
  • More resources:
  • Online Documentation
  • PEP 619, 3.10 Release Schedule
  • Report bugs at https://bugs.python.org.
  • Help fund Python and its community.
  • And now for something completely different:
  • Schwarzschild wormholes, also known as Einstein–Rosen bridges (named after Albert Einstein and Nathan Rosen), are connections between areas of space that can be modelled as vacuum solutions to the Einstein field equations, and that are now understood to be intrinsic parts of the maximally extended version of the Schwarzschild metric describing an eternal black hole with no charge and no rotation. Here, "maximally extended" refers to the idea that the spacetime should not have any "edges": it should be possible to continue this path arbitrarily far into the particle's future or past for any possible trajectory of a free-falling particle (following a geodesic in the spacetime).
  • Although Schwarzschild wormholes are not traversable in both directions, their existence inspired Kip Thorne to imagine traversable wormholes created by holding the "throat" of a Schwarzschild wormhole open with exotic matter (material that has negative mass/energy).

New in Python 3.9.2 (Feb 22, 2021)

  • This release, just as the candidate before it, contains two security fixes:
  • bpo-42938: Avoid static buffers when computing the repr of ctypes.c_double and ctypes.c_longdouble values. This issue was assigned CVE-2021-3177.
  • bpo-42967: Fix web cache poisoning vulnerability by defaulting the query args separator to &, and allowing the user to choose a custom separator. This issue was assigned CVE-2021-23336.
  • What’s New:
  • New syntax features:
  • PEP 584, union operators added to dict;
  • PEP 585, type hinting generics in standard collections;
  • PEP 614, relaxed grammar restrictions on decorators.
  • New built-in features:
  • PEP 616, string methods to remove prefixes and suffixes.
  • New features in the standard library
  • PEP 593, flexible function and variable annotations;
  • os.pidfd_open() added that allows process management without races and signals.
  • Interpreter improvements:
  • PEP 573, fast access to module state from methods of C extension types;
  • PEP 617, CPython now uses a new parser based on PEG;
  • a number of Python builtins (range, tuple, set, frozenset, list, dict) are now sped up using PEP 590 vectorcall;
  • garbage collection does not block on resurrected objects;
  • a number of Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, math, operator, resource, time, _weakref) now use multiphase initialization as defined by PEP 489;
  • a number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.
  • New library modules:
  • PEP 615, the IANA Time Zone Database is now present in the standard library in the zoneinfo module;
  • an implementation of a topological sort of a graph is now provided in the new graphlib module.
  • Release process changes:
  • PEP 602, CPython adopts an annual release cycle.

New in Python 3.10.0 Alpha 5 (Feb 4, 2021)

  • Security:
  • Avoid static buffers when computing the repr of ctypes.c_double and ctypes.c_longdouble values.
  • Core and Builtins:
  • Refactor the PyEval_ family of functions.
  • An new function _PyEval_Vector is added to simplify calls to Python from C.
  • _PyEval_EvalCodeWithName is removed
  • PyEval_EvalCodeEx is retained as part of the API, but is not used internally
  • Replace Py_FatalError() calls in the compiler with regular SystemError exceptions. Patch by Victor Stinner.
  • Improve error message for missing “:” before blocks. Patch by Pablo Galindo.
  • Improve error message in the parser when using un-parenthesised tuples in comprehensions. Patch by Pablo Galindo.
  • Fix parser crash when reporting syntax errors in f-string with newlines. Patch by Pablo Galindo.
  • Syntax errors for unterminated string literals now point to the start of the string instead of reporting EOF/EOL.
  • The inline cache for LOAD_ATTR now also optimizes access to attributes defined by __slots__. This makes reading such attribute up to 30% faster.
  • Improve error messages in the parser when parentheses are not closed. Patch by Pablo Galindo.
  • Fix bytearray repetition incorrectly copying data from the start of the buffer, even if the data is offset within the buffer (e.g. after reassigning a slice at the start of the bytearray to a shorter byte string).
  • Fix the _PyUnicode_FromId() function (_Py_IDENTIFIER(var) API) when Py_Initialize() / Py_Finalize() is called multiple times: preserve _PyRuntime.unicode_ids.next_index value.
  • Fix a crash when working out the error line of a SyntaxError in some multi-line expressions.
  • frame.f_lineno is correct even if frame.f_trace is set to True
  • Remove deprecated aliases to Collections Abstract Base Classes from the collections module.
  • Fixed possible leak in import when sys.modules is not a dict.
  • In string formatting, preceding the width field by '0' no longer affects the default alignment for strings.
  • Library:
  • Fixed a reference leak in the curses module. Patch by Pablo Galindo
  • Update the bundled pip to 21.0.1 and setuptools to 52.0.0.
  • Deprecate distutils in documentation and add warning on import.
  • Improve performance of tokenize by 20-30%. Patch by Anthony Sottile.
  • Fix math.nextafter() for NaN on AIX.
  • Add sys.stdlib_module_names, containing the list of the standard library module names. Patch by Victor Stinner.
  • Fix random.Random.sample when counts argument is not None.
  • Use TracebackException’s new compact param in TestResult to reduce time and memory consumed by traceback formatting.
  • Add randbytes() to random.__all__.
  • [Enum] Flags consisting of a single bit are now considered canonical, and will be the only flags returned from listing and iterating over a Flag class or a Flag member. Multi-bit flags are considered aliases; they will be returned from lookups and operations that result in their value. Iteration for both Flag and Flag members is in definition order.
  • bpo-42877: Added the compact parameter to the constructor of traceback.TracebackException to reduce time and memory for use cases that only need to call TracebackException.format() and TracebackException.format_exception_only().
  • The Py_FatalError() function and the faulthandler module now dump the list of extension modules on a fatal error.
  • Removed recursion from TracebackException to allow it to handle long exception chains.
  • [Enum] move member creation from EnumMeta.__new__ to _proto_member.__set_name__, allowing members to be created and visible in __init_subclass__.
  • Fix os.set_inheritable() for O_PATH file descriptors on Linux.
  • Fix a reference leak in the getcodec() function of CJK codecs. Patch by Victor Stinner.
  • Convert the 6 CJK codec extension modules (_codecs_cn, _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr and _codecs_tw) to the multiphase initialization API (PEP 489). Patch by Victor Stinner.
  • remove __init_subclass__ support for Enum members
  • Make internal caches of the _json module compatible with subinterpreters.
  • Fix HTMLParser parsing rules for element attributes containing commas with spaces. Patch by Karl Dubost.
  • Require SQLite 3.7.15 or newer. Patch by Erlend E. Aasland.
  • Convert the _multibytecodec extension module (CJK codecs) to multi-phase initialization (PEP 489). Patch by Erlend E. Aasland.
  • The distutils bdist_wininst command deprecated in Python 3.8 has been removed. The distutils bidst_wheel command is now recommended to distribute binary packages on Windows.
  • The undocumented built-in function sqlite3.enable_shared_cache is now deprecated, scheduled for removal in Python 3.12. Its use is strongly discouraged by the SQLite3 documentation. Patch by Erlend E. Aasland.
  • Make pdb populate sys.path[0] exactly the same as regular python execution.
  • Fix pdb: previously pdb would fail to restart the debugging target if it was specified using a relative path and the current directory changed.
  • Fix CLI of cProfile and profile to catch BrokenPipeError.
  • Don’t decrement the reference count of the previous user_ptr when set_panel_userptr fails.
  • Allow executing callables that have a boolean value of False when passed to Threading.thread as the target. Patch contributed by Barney Stratford.
  • Add an ‘end_lineno’ attribute to the Class and Function objects that appear in the tree returned by pyclbr functions. This and the existing ‘lineno’ attribute define the extent of class and def statements. Patch by Aviral Srivastava.
  • The BUTTON5_* constants are now exposed in the curses module if available.
  • Correct call to tkinter.colorchooser to return RGB triplet of ints instead of floats. Patch by Cheryl Sabella.
  • Documentation:
  • Fix doc for type(name, bases, dict). Patch by Boris Verkhovskiy and Éric Araujo.
  • Updated importlib.utils.resolve_name() doc to use __spec__.parent instead of __package__. (Thanks Yair Frid.)
  • Tests:
  • Use unittest.TestLoader().loadTestsFromTestCase() instead of unittest.makeSuite() in sqlite3 tests. Patch by Erlend E. Aasland.
  • In sqlite3, fix CheckTraceCallbackContent for SQLite pre 3.7.15.
  • Build:
  • Pass --timeout=$(TESTTIMEOUT) option to the default profile task ./python -m test --pgo command.
  • make regen-all now also runs regen-keyword. Patch by Victor Stinner.
  • Removed the grep -q and -E flags in the tzpath validation section of the configure script to better accomodate users of some platforms (specifically Solaris 10).
  • Add library search path by wr-cc in add_cross_compiling_paths() for VxWorks.
  • Add --with-wheel-pkg-dir=PATH option to the ./configure script. If specified, the ensurepip module looks for setuptools and pip wheel packages in this directory: if both are present, these wheel packages are used instead of ensurepip bundled wheel packages.
  • Windows:
  • Updated Windows installer to include OpenSSL 1.1.1i
  • Upgrade Windows installer to use SQLite 3.34.0.

New in Python 3.10.0 Alpha 2 (Nov 3, 2020)

  • Major new features of the 3.10 series, compared to 3.9:
  • Python 3.10 is still in development. This releasee, 3.10.0a2 is the second of six planned alpha releases. Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process. During the alpha phase, features may be added up until the start of the beta phase (2021-05-03) and, if necessary, may be modified or deleted up until the release candidate phase (2021-10-04). Please keep in mind that this is a preview release and its use is not recommended for production environments.
  • Many new features for Python 3.10 are still being planned and written. Among the new major new features and changes so far:
  • PEP 623 -- Remove wstr from Unicode
  • PEP 604 -- Allow writing union types as X | Y
  • PEP 612 -- Parameter Specification Variables
  • PEP 626 -- Precise line numbers for debugging and other tools.
  • bpo-38605: from __future__ import annotations (PEP 563) is now the default.
  • (Hey, fellow core developer, if a feature you find important is missing from this list, let Pablo know.)
  • The next pre-release of Python 3.10 will be 3.10.0a3, currently scheduled for 2020-12-07.
  • More resources:
  • Online Documentation
  • PEP 619, 3.10 Release Schedule
  • Report bugs at https://bugs.python.org.
  • Help fund Python and its community.
  • And now for something completely different:
  • The cardinality (the number of elements) of infinite sets can be one of the most surprising results of set theory. For example, there are the same amount of even natural numbers than natural numbers (which can be even or odd). There is also the same amount of rational numbers than natural numbers. But on the other hand, there are more real numbers between 0 and 1 than natural numbers! All these sets have infinite cardinality but turn out that some of these infinities are bigger than others. These infinite cardinalities normally are represented using aleph numbers. Infinite sets are strange beasts indeed.

New in Python 3.9.0 (Oct 5, 2020)

  • Some of the new major new features and changes in Python 3.9 are:
  • PEP 573, Module State Access from C Extension Methods
  • PEP 584, Union Operators in dict
  • PEP 585, Type Hinting Generics In Standard Collections
  • PEP 593, Flexible function and variable annotations
  • PEP 602, Python adopts a stable annual release cadence
  • PEP 614, Relaxing Grammar Restrictions On Decorators
  • PEP 615, Support for the IANA Time Zone Database in the Standard Library
  • PEP 616, String methods to remove prefixes and suffixes
  • PEP 617, New PEG parser for CPython
  • BPO 38379, garbage collection does not block on resurrected objects;
  • BPO 38692, os.pidfd_open added that allows process management without races and signals;
  • BPO 39926, Unicode support updated to version 13.0.0;
  • BPO 1635741, when Python is initialized multiple times in the same process, it does not leak memory anymore;
  • A number of Python builtins (range, tuple, set, frozenset, list, dict) are now sped up using PEP 590 vectorcall;
  • A number of Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, operator, resource, time, _weakref) now use multiphase initialization as defined by PEP 489;
  • A number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.

New in Python 3.9.0 RC 2 (Sep 29, 2020)

  • This is the second release candidate of Python 3.9:
  • This release, 3.9.0rc2, is the last preview before the final release of Python 3.9.0 on 2020-10-05. In the mean time, we strongly encourage maintainers of third-party Python projects to prepare their projects for 3.9 compatibility during this phase. As always, report any issues to the Python bug tracker.
  • Please keep in mind that this is a preview release and its use is not recommended for production environments.

New in Python 3.9.0 RC1 (Aug 12, 2020)

  • Some of the new major new features and changes in Python 3.9 are:
  • PEP 584, Union Operators in dict
  • PEP 585, Type Hinting Generics In Standard Collections
  • PEP 593, Flexible function and variable annotations
  • PEP 602, Python adopts a stable annual release cadence
  • PEP 615, Support for the IANA Time Zone Database in the Standard Library
  • PEP 616, String methods to remove prefixes and suffixes
  • PEP 617, New PEG parser for CPython
  • BPO 38379, garbage collection does not block on resurrected objects;
  • BPO 38692, os.pidfd_open added that allows process management without races and signals;
  • BPO 39926, Unicode support updated to version 13.0.0;
  • BPO 1635741, when Python is initialized multiple times in the same process, it does not leak memory anymore;
  • A number of Python builtins (range, tuple, set, frozenset, list, dict) are now sped up using PEP 590 vectorcall;
  • A number of Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, operator, resource, time, _weakref) now use multiphase initialization as defined by PEP 489;
  • A number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.

New in Python 3.8.4 (Jul 13, 2020)

  • Major new features of the 3.8 series, compared to 3.7:
  • PEP 572, Assignment expressions
  • PEP 570, Positional-only arguments
  • PEP 587, Python Initialization Configuration (improved embedding)
  • PEP 590, Vectorcall: a fast calling protocol for CPython
  • PEP 578, Runtime audit hooks
  • PEP 574, Pickle protocol 5 with out-of-band data
  • Typing-related: PEP 591 (Final qualifier), PEP 586 (Literal types), and PEP 589 (TypedDict)
  • Parallel filesystem cache for compiled bytecode
  • Debug builds share ABI as release builds
  • f-strings support a handy = specifier for debugging
  • continue is now legal in finally: blocks
  • on Windows, the default asyncio event loop is now ProactorEventLoop
  • on macOS, the spawn start method is now used by default in multiprocessing
  • multiprocessing can now use shared memory segments to avoid pickling costs between processes
  • typed_ast is merged back to CPython
  • LOAD_GLOBAL is now 40% faster
  • pickle now uses Protocol 4 by default, improving performance

New in Python 3.9.0 Beta 1 (May 19, 2020)

  • Some of the new major new features and changes in Python 3.9 are:
  • PEP 584, Union Operators in dict
  • PEP 585, Type Hinting Generics In Standard Collections
  • PEP 593, Flexible function and variable annotations
  • PEP 602, Python adopts a stable annual release cadence
  • PEP 616, String methods to remove prefixes and suffixes
  • PEP 617, New PEG parser for CPython
  • BPO 38379, garbage collection does not block on resurrected objects;
  • BPO 38692, os.pidfd_open added that allows process management without races and signals;
  • BPO 39926, Unicode support updated to version 13.0.0;
  • BPO 1635741, when Python is initialized multiple times in the same process, it does not leak memory anymore;
  • A number of Python builtins (range, tuple, set, frozenset, list, dict) are now sped up using PEP 590 vectorcall;
  • A number of Python modules (_abc, audioop, _bz2, _codecs, _contextvars, _crypt, _functools, _json, _locale, operator, resource, time, _weakref) now use multiphase initialization as defined by PEP 489;
  • A number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.

New in Python 3.8.3 RC1 (Apr 30, 2020)

  • Security:
  • bpo-40121: Fixes audit events raised on creating a new socket.
  • bpo-38576: Disallow control characters in hostnames in http.client, addressing CVE-2019-18348. Such potentially malicious header injection URLs now cause a InvalidURL to be raised.
  • bpo-39503: CVE-2020-8492: The AbstractBasicAuthHandler class of the urllib.request module uses an inefficient regular expression which can be exploited by an attacker to cause a denial of service. Fix the regex to prevent the catastrophic backtracking. Vulnerability reported by Ben Caller and Matt Schwager.
  • Core and Builtins:
  • bpo-20526: Fix PyThreadState_Clear(). PyThreadState.frame is a borrowed reference, not a strong reference: PyThreadState_Clear() must not call Py_CLEAR(tstate->frame).
  • bpo-39965: Correctly raise SyntaxError if await is used inside non-async functions and PyCF_ALLOW_TOP_LEVEL_AWAIT is set (like in the asyncio REPL). Patch by Pablo Galindo.
  • bpo-39562: Allow executing asynchronous comprehensions on the top level when the PyCF_ALLOW_TOP_LEVEL_AWAIT flag is given. Patch by Batuhan Taskaya.
  • bpo-38894: Fix a bug that was causing incomplete results when calling pathlib.Path.glob in the presence of symlinks that point to files where the user does not have read access. Patch by Pablo Galindo and Matt Wozniski.
  • bpo-39871: Fix a possible SystemError in math.{atan2,copysign,remainder}() when the first argument cannot be converted to a float. Patch by Zachary Spytz.
  • bpo-39776: Fix race condition where threads created by PyGILState_Ensure() could get a duplicate id.
  • This affects consumers of tstate->id like the contextvar caching machinery, which could return invalid cached objects under heavy thread load (observed in embedded scenarios).
  • bpo-39778: Fixed a crash due to incorrect handling of weak references in collections.OrderedDict classes. Patch by Pablo Galindo.
  • bpo-39520: Fix unparsing of ext slices with no items (foo[:,]). Patch by Batuhan Taskaya.
  • bpo-22490: Don’t leak environment variable __PYVENV_LAUNCHER__ into the interpreter session on macOS.
  • Library
  • bpo-40138: Fix the Windows implementation of os.waitpid() for exit code larger than INT_MAX >> 8. The exit status is now interpreted as an unsigned number.
  • bpo-39942: Set “__main__” as the default module name when “__name__” is missing in typing.TypeVar. Patch by Weipeng Hong.
  • bpo-40330: In ShareableList.__setitem__(), check the size of a new string item after encoding it to utf-8, not before.
  • bpo-40287: Fixed SpooledTemporaryFile.seek() to return the position.
  • bpo-40260: Ensure modulefinder uses io.open_code() and respects coding comments.
  • bpo-40196: Fix a bug in the symtable module that was causing incorrectly report global variables as local. Patch by Pablo Galindo.
  • bpo-40126: Fixed reverting multiple patches in unittest.mock. Patcher’s __exit__() is now never called if its __enter__() is failed. Returning true from __exit__() silences now the exception.
  • bpo-40089: Fix threading._after_fork(): if fork was not called by a thread spawned by threading.Thread, threading._after_fork() now creates a _MainThread instance for _main_thread, instead of a _DummyThread instance.
  • bpo-39503: AbstractBasicAuthHandler of urllib.request now parses all WWW-Authenticate HTTP headers and accepts multiple challenges per header: use the realm of the first Basic challenge.
  • bpo-40014: Fix os.getgrouplist(): if getgrouplist() function fails because the group list is too small, retry with a larger group list. On failure, the glibc implementation of getgrouplist() sets ngroups to the total number of groups. For other implementations, double the group list size.
  • bpo-40016: In re docstring, clarify the relationship between inline and argument compile flags.
  • bpo-39953: Update internal table of OpenSSL error codes in the ssl module.
  • bpo-39360: Ensure all workers exit when finalizing a multiprocessing.Pool implicitly via the module finalization handlers of multiprocessing. This fixes a deadlock situation that can be experienced when the Pool is not properly finalized via the context manager or a call to multiprocessing.Pool.terminate. Patch by Batuhan Taskaya and Pablo Galindo.
  • bpo-39652: The column name found in sqlite3.Cursor.description is now truncated on the first ‘[‘ only if the PARSE_COLNAMES option is set.
  • bpo-39915: Ensure unittest.mock.AsyncMock.await_args_list has call objects in the order of awaited arguments instead of using unittest.mock.Mock.call_args which has the last value of the call. Patch by Karthikeyan Singaravelan.
  • bpo-38662: The ensurepip module now invokes pip via the runpy module. Hence it is no longer tightly coupled with the internal API of the bundled pip version, allowing easier updates to a newer pip version both internally and for distributors.
  • bpo-39916: More reliable use of os.scandir() in Path.glob(). It no longer emits a ResourceWarning when interrupted.
  • bpo-39850: multiprocessing now supports abstract socket addresses (if abstract sockets are supported in the running platform). Patch by Pablo Galindo.
  • bpo-39828: Fix json.tool to catch BrokenPipeError. Patch by Dong-hee Na.
  • bpo-13487: Avoid a possible “RuntimeError: dictionary changed size during iteration” from inspect.getmodule() when it tried to loop through sys.modules.
  • bpo-39794: Add –without-decimal-contextvar build option. This enables a thread-local rather than a coroutine local context.
  • bpo-39769: The compileall.compile_dir() function’s ddir parameter and the compileall command line flag -d no longer write the wrong pathname to the generated pyc file for submodules beneath the root of the directory tree being compiled. This fixes a regression introduced with Python 3.5.
  • bpo-39517: Fix runpy.run_path() when using pathlike objects
  • bpo-39764: Fix AttributeError when calling get_stack on a PyAsyncGenObject Task
  • bpo-30566: Fix IndexError when trying to decode an invalid string with punycode codec.
  • bpo-39667: Correct performance degradation in zipfile.Path as found in zipp 3.0. While retaining compatibility, this change discourages the use of zipfile.Path.open due to the signature change in Python 3.9. For compatibility across Python 3.8 and later versions, consider using zipp.Path on Python 3.8.x and earlier.
  • bpo-39548: Fix handling of header in urllib.request.AbstractDigestAuthHandler when the optional qop parameter is not present.
  • bpo-38971: Open issue in the BPO indicated a desire to make the implementation of codecs.open() at parity with io.open(), which implements a try/except to assure file stream gets closed before an exception is raised.
  • bpo-38410: Properly handle sys.audit() failures in sys.set_asyncgen_hooks(). Based on patch by Zackery Spytz.
  • bpo-36541: lib2to3 now recognizes named assignment expressions (the walrus operator, :=)
  • bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object. Patch by Oren Milman.
  • Documentation:
  • bpo-27635: The pickle documentation incorrectly claimed that __new__ isn’t called by default when unpickling.
  • bpo-39879: Updated Data model docs to include dict() insertion order preservation. Patch by Furkan Onder and Samy Lahfa.
  • bpo-39868: Updated the Language Reference for PEP 572.
  • bpo-13790: Change ‘string’ to ‘specification’ in format doc.
  • bpo-17422: The language reference no longer restricts default class namespaces to dicts only.
  • bpo-39530: Fix misleading documentation about mixed-type numeric comparisons.
  • bpo-39718: Update token documentation to reflect additions in Python 3.8
  • bpo-39677: Changed operand name of MAKE_FUNCTION from argc to flags for module dis
  • bpo-38387: Document PyDoc_STRVAR macro in the C-API reference.
  • Tests:
  • bpo-40436: test_gdb and test.pythoninfo now check gdb command exit code.
  • bpo-40162: Update Travis CI configuration to OpenSSL 1.1.1f.
  • bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines.
  • bpo-40019: test_gdb now skips tests if it detects that gdb failed to read debug information because the Python binary is optimized.
  • bpo-27807: test_site.test_startup_imports() is now skipped if a path of sys.path contains a .pth file.
  • bpo-39793: Use the same domain when testing make_msgid. Patch by Batuhan Taskaya.
  • bpo-1812: Fix newline handling in doctest.testfile when loading from a package whose loader has a get_data method. Patch by Peter Donis.
  • bpo-37957: test.regrtest now can receive a list of test patterns to ignore (using the -i/–ignore argument) or a file with a list of patterns to ignore (using the –ignore-file argument). Patch by Pablo Galindo.
  • bpo-38502: test.regrtest now uses process groups in the multiprocessing mode (-jN command line option) if process groups are available: if os.setsid() and os.killpg() functions are available.
  • Build:
  • bpo-38360: Support single-argument form of macOS -isysroot flag.
  • bpo-40204: Pin Sphinx version to 1.8.2 in Doc/Makefile.
  • bpo-40158: Fix CPython MSBuild Properties in NuGet Package (build/native/python.props)
  • bpo-38527: Fix configure check on Solaris for “float word ordering”: sometimes, the correct “grep” command was not being used. Patch by Arnon Yaari.
  • Windows:
  • bpo-40164: Updates Windows to OpenSSL 1.1.1f
  • bpo-39930: Ensures the required vcruntime140.dll is included in install packages.
  • bpo-39847: Avoid hang when computer is hibernated whilst waiting for a mutex (for lock-related objects from threading) around 49-day uptime.
  • bpo-38597: distutils will no longer statically link vcruntime140.dll when a redistributable version is unavailable. All future releases of CPython will include a copy of this DLL to ensure distributed extensions can continue to load.
  • bpo-38380: Update Windows builds to use SQLite 3.31.1
  • bpo-39789: Update Windows release build machines to Visual Studio 2019 (MSVC 14.2).
  • bpo-34803: Package for nuget.org now includes repository reference and bundled icon image.
  • IDLE:
  • bpo-27115: For ‘Go to Line’, use a Query box subclass with IDLE standard behavior and improved error checking.
  • bpo-39885: Since clicking to get an IDLE context menu moves the cursor, any text selection should be and now is cleared.
  • bpo-39852: Edit “Go to line” now clears any selection, preventing accidental deletion. It also updates Ln and Col on the status bar.
  • bpo-39781: Selecting code context lines no longer causes a jump.
  • bpo-38439: Add a 256×256 pixel IDLE icon to support more modern environments. Created by Andrew Clover. Delete the unused macOS idle.icns icon file.
  • bpo-38689: IDLE will no longer freeze when inspect.signature fails when fetching a calltip.
  • Tools/Demos:
  • bpo-40179: Fixed translation of #elif in Argument Clinic.
  • bpo-36184: Port python-gdb.py to FreeBSD. python-gdb.py now checks for “take_gil” function name to check if a frame tries to acquire the GIL, instead of checking for “pthread_cond_timedwait” which is specific to Linux and can be a different condition than the GIL.
  • bpo-39889: Fixed unparse.py for extended slices containing a single element (e.g. a[i:j,]). Remove redundant tuples when index with a tuple (e.g. a[i, j]).
  • C API:
  • bpo-35370: If PySys_Audit() fails in PyEval_SetProfile() or PyEval_SetTrace(), log the error as an unraisable exception.
  • bpo-39884: PyDescr_NewMethod() and PyCFunction_NewEx() now include the method name in the SystemError “bad call flags” error message to ease debug.
  • bpo-38643: PyNumber_ToBase() now raises a SystemError instead of crashing when called with invalid base.
  • bpo-38913: Fixed segfault in Py_BuildValue() called with a format containing “#” and undefined PY_SSIZE_T_CLEAN whwn an exception is set.

New in Python 3.9.0 Alpha 5 (Apr 21, 2020)

  • Many new features for Python 3.9 are still being planned and written. Among the new major new features and changes so far:
  • PEP 584, Union Operators in dict
  • PEP 593, Flexible function and variable annotations
  • PEP 602, Python adopts a stable annual release cadence
  • BPO 38379, garbage collection does not block on resurrected objects;
  • BPO 38692, os.pidfd_open added that allows process management without races and signals;
  • BPO 39926, Unicode support updated to version 13.0.0
  • BPO 1635741, when Python is initialized multiple times in the same process, it does not leak memory anymore
  • A number of Python builtins (range, tuple, set, frozenset, list) are now sped up using PEP 590 vectorcall
  • A number of standard library modules (audioop, ast, grp, _hashlib, pwd, _posixsubprocess, random, select, struct, termios, zlib) are now using the stable ABI defined by PEP 384.

New in Python 3.8.2 (Mar 6, 2020)

  • Major new features of the 3.8 series, compared to 3.7:
  • PEP 572, Assignment expressions
  • PEP 570, Positional-only arguments
  • PEP 587, Python Initialization Configuration (improved embedding)
  • PEP 590, Vectorcall: a fast calling protocol for CPython
  • PEP 578, Runtime audit hooks
  • PEP 574, Pickle protocol 5 with out-of-band data
  • Typing-related: PEP 591 (Final qualifier), PEP 586 (Literal types), and PEP 589 (TypedDict)
  • Parallel filesystem cache for compiled bytecode
  • Debug builds share ABI as release builds
  • f-strings support a handy = specifier for debugging
  • continue is now legal in finally: blocks
  • on Windows, the default asyncio event loop is now ProactorEventLoop
  • on macOS, the spawn start method is now used by default in multiprocessing
  • multiprocessing can now use shared memory segments to avoid pickling costs between processes
  • typed_ast is merged back to CPython
  • LOAD_GLOBAL is now 40% faster
  • pickle now uses Protocol 4 by default, improving performance

New in Python 3.8.0 (Oct 15, 2019)

  • Major new features of the 3.8 series, compared to 3.7
  • PEP 572, Assignment expressions
  • PEP 570, Positional-only arguments
  • PEP 587, Python Initialization Configuration (improved embedding)
  • PEP 590, Vectorcall: a fast calling protocol for CPython
  • PEP 578, Runtime audit hooks
  • PEP 574, Pickle protocol 5 with out-of-band data
  • Typing-related: PEP 591 (Final qualifier), PEP 586 (Literal types), and PEP 589 (TypedDict)
  • Parallel filesystem cache for compiled bytecode
  • Debug builds share ABI as release builds
  • f-strings support a handy = specifier for debugging
  • continue is now legal in finally: blocks
  • on Windows, the default asyncio event loop is now ProactorEventLoop
  • on macOS, the spawn start method is now used by default in multiprocessing
  • multiprocessing can now use shared memory segments to avoid pickling costs between processes
  • typed_ast is merged back to CPython
  • LOAD_GLOBAL is now 40% faster
  • pickle now uses Protocol 4 by default, improving performance

New in Python 3.7.3 (Mar 26, 2019)

  • Among the major new features in Python 3.7 are:
  • PEP 539, new C API for thread-local storage
  • PEP 545, Python documentation translations
  • New documentation translations: Japanese, French, and Korean.
  • PEP 552, Deterministic pyc files
  • PEP 553, Built-in breakpoint()
  • PEP 557, Data Classes
  • PEP 560, Core support for typing module and generic types
  • PEP 562, Customization of access to module attributes
  • PEP 563, Postponed evaluation of annotations
  • PEP 564, Time functions with nanosecond resolution
  • PEP 565, Improved DeprecationWarning handling
  • PEP 567, Context Variables
  • Avoiding the use of ASCII as a default text encoding (PEP 538, legacy C locale coercion and PEP 540, forced UTF-8 runtime mode)
  • The insertion-order preservation nature of dict objects is now an official part of the Python language spec.
  • Notable performance improvements in many areas.

New in Python 2.7.3 RC1 (Mar 13, 2019)

  • PEP 539, new C API for thread-local storage
  • PEP 545, Python documentation translations
  • New documentation translations: Japanese, French, and Korean.
  • PEP 552, Deterministic pyc files
  • PEP 553, Built-in breakpoint()
  • PEP 557, Data Classes
  • PEP 560, Core support for typing module and generic types
  • PEP 562, Customization of access to module attributes
  • PEP 563, Postponed evaluation of annotations
  • PEP 564, Time functions with nanosecond resolution
  • PEP 565, Improved DeprecationWarning handling
  • PEP 567, Context Variables
  • Avoiding the use of ASCII as a default text encoding (PEP 538, legacy C locale coercion and PEP 540, forced UTF-8 runtime mode)
  • The insertion-order preservation nature of dict objects is now an official part of the Python language spec.
  • Notable performance improvements in many areas.

New in Python 3.7.0 RC 1 (Jun 12, 2018)

  • Core and Builtins:
  • bpo-33803: Fix a crash in hamt.c caused by enabling GC tracking for an object that hadn’t all of its fields set to NULL.
  • bpo-33706: Fix a crash in Python initialization when parsing the command line options. Thanks Christoph Gohlke for the bug report and the fix!
  • bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter shutdown even when there was a custom handler set previously. Patch by Philipp Kerling.
  • bpo-31849: Fix signed/unsigned comparison warning in pyhash.c.
  • Library:
  • bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by Steve Weber.
  • bpo-33812: Datetime instance d with non-None tzinfo, but with d.tzinfo.utcoffset(d) returning None is now treated as naive by the astimezone() method.
  • bpo-30805: Avoid race condition with debug logging
  • bpo-33694: asyncio: Fix a race condition causing data loss on pause_reading()/resume_reading() when using the ProactorEventLoop.
  • bpo-32493: Correct test for uuid_enc_be availability in configure.ac. Patch by Michael Felt.
  • bpo-33792: Add asyncio.WindowsSelectorEventLoopPolicy and asyncio.WindowsProactorEventLoopPolicy.
  • bpo-33778: Update unicodedata’s database to Unicode version 11.0.0.
  • bpo-33770: improve base64 exception message for encoded inputs of invalid length
  • bpo-33769: asyncio/start_tls: Fix error message; cancel callbacks in case of an unhandled error; mark SSLTransport as closed if it is aborted.
  • bpo-33767: The concatenation (+) and repetition (*) sequence operations now raise TypeError instead of SystemError when performed on mmap.mmap objects. Patch by Zackery Spytz.
  • bpo-33734: asyncio/ssl: Fix AttributeError, increase default handshake timeout
  • bpo-11874: Use a better regex when breaking usage into wrappable parts. Avoids bogus assertion errors from custom metavar strings.
  • bpo-33582: Emit a deprecation warning for inspect.formatargspec
  • Documentation:
  • bpo-33409: Clarified the relationship between PEP 538’s PYTHONCOERCECLOCALE and PEP 540’s PYTHONUTF8 mode.
  • bpo-33736: Improve the documentation of asyncio.open_connection(), asyncio.start_server() and their UNIX socket counterparts.
  • bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED flags for ssl.SSLContext.verify_mode.
  • Build:
  • bpo-5755: Move -Wstrict-prototypes option to CFLAGS_NODIST from OPT. This option emitted annoying warnings when building extension modules written in C++.
  • Windows:
  • bpo-33720: Reduces maximum marshal recursion depth on release builds.
  • IDLE:
  • bpo-33656: On Windows, add API call saying that tk scales for DPI. On Windows 8.1+ or 10, with DPI compatibility properties of the Python binary unchanged, and a monitor resolution greater than 96 DPI, this should make text and lines sharper. It should otherwise have no effect.
  • bpo-33768: Clicking on a context line moves that line to the top of the editor window.
  • bpo-33763: IDLE: Use read-only text widget for code context instead of label widget.
  • bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel and scrollbar slider moved text by a fixed number of pixels, resulting in partial lines at the top of the editor box. The change also applies to the shell and grep output windows, but not to read-only text views.
  • bpo-33679: Enable theme-specific color configuration for Code Context. Use the Highlights tab to see the setting for built-in themes or add settings to custom themes.
  • bpo-33642: Display up to maxlines non-blank lines for Code Context. If there is no current context, show a single blank line.

New in Python 3.7.0 Beta 4 (May 3, 2018)

  • Core and Builtins:
  • bpo-33363: Raise a SyntaxError for async with and async for statements outside of async functions.
  • bpo-33128: Fix a bug that causes PathFinder to appear twice on sys.meta_path. Patch by Pablo Galindo Salgado.
  • bpo-33312: Fixed clang ubsan (undefined behavior sanitizer) warnings in dictobject.c by adjusting how the internal struct _dictkeysobject shared keys structure is declared.
  • bpo-33231: Fix potential memory leak in normalizestring().
  • bpo-33205: Change dict growth function from round_up_to_power_2(used*2+hashtable_size/2) to round_up_to_power_2(used*3). Previously, dict is shrinked only when used == 0. Now dict has more chance to be shrinked.
  • bpo-29922: Improved error messages in ‘async with’ when __aenter__() or __aexit__() return non-awaitable object.
  • bpo-33199: Fix ma_version_tag in dict implementation is uninitialized when copying from key-sharing dict.
  • Library:
  • bpo-33281: Fix ctypes.util.find_library regression on macOS.
  • bpo-33383: Fixed crash in the get() method of the dbm.ndbm database object when it is called with a single argument.
  • bpo-33329: Fix multiprocessing regression on newer glibcs
  • bpo-991266: Fix quoting of the Comment attribute of http.cookies.SimpleCookie.
  • bpo-33131: Upgrade bundled version of pip to 10.0.1.
  • bpo-33308: Fixed a crash in the parser module when converting an ST object to a tree of tuples or lists with line_info=False and col_info=True.
  • bpo-33266: lib2to3 now recognizes rf'...' strings.
  • bpo-11594: Ensure line-endings are respected when using lib2to3.
  • bpo-33254: Have importlib.resources.contents() and importlib.abc.ResourceReader.contents() return an iterable instead of an iterator.
  • bpo-33256: Fix display of <module> call in the html produced by cgitb.html(). Patch by Stéphane Blondon.
  • bpo-33185: Fixed regression when running pydoc with the -m switch. (The regression was introduced in 3.7.0b3 by the resolution of bpo-33053)
  • This fix also changed pydoc to add os.getcwd() to sys.path when necessary, rather than adding ".".
  • bpo-33169: Delete entries of None in sys.path_importer_cache when importlib.machinery.invalidate_caches() is called.
  • bpo-33217: Deprecate looking up non-Enum objects in Enum classes and Enum members (will raise TypeError in 3.8+).
  • bpo-33203: random.Random.choice() now raises IndexError for empty sequences consistently even when called from subclasses without a getrandbits() implementation.
  • bpo-33224: Update difflib.mdiff() for PEP 479. Convert an uncaught StopIteration in a generator into a return-statement.
  • bpo-33209: End framing at the end of C implementation of pickle.Pickler.dump().
  • bpo-20104: Improved error handling and fixed a reference leak in os.posix_spawn().
  • bpo-33175: In dataclasses, Field.__set_name__ now looks up the __set_name__ special method on the class, not the instance, of the default value.
  • bpo-33097: Raise RuntimeError when executor.submit is called during interpreter shutdown.
  • bpo-31908: Fix output of cover files for trace module command-line tool. Previously emitted cover files only when --missing option was used. Patch by Michael Selik.
  • Documentation:
  • bpo-33378: Add Korean language switcher for https://docs.python.org/3/
  • bpo-33276: Clarify that the __path__ attribute on modules cannot be just any value.
  • bpo-33201: Modernize documentation for writing C extension types.
  • bpo-33195: Deprecate Py_UNICODE usage in c-api/arg document. Py_UNICODE related APIs are deprecated since Python 3.3, but it is missed in the document.
  • bpo-8243: Add a note about curses.addch and curses.addstr exception behavior when writing outside a window, or pad.
  • bpo-32337: Update documentation related with dict order.
  • Tests:
  • bpo-33358: Fix test_embed.test_pre_initialization_sys_options() when the interpreter is built with --enable-shared.
  • Build:
  • bpo-33394: Enable the verbose build for extension modules, when GNU make is passed macros on the command line.
  • bpo-33393: Update config.guess and config.sub files.
  • bpo-33377: Add new triplets for mips r6 and riscv variants (used in extension suffixes).
  • bpo-32232: By default, modules configured in Modules/Setup are no longer built with -DPy_BUILD_CORE. Instead, modules that specifically need that preprocessor definition include it in their individual entries.
  • bpo-33182: The embedding tests can once again be built with clang 6.0
  • Windows:
  • bpo-33184: Update Windows installer to use OpenSSL 1.1.0h.
  • IDLE:
  • bpo-21474: Update word/identifier definition from ascii to unicode. In text and entry boxes, this affects selection by double-click, movement left/right by control-left/right, and deletion left/right by control- BACKSPACE/DEL.
  • bpo-33204: IDLE: consistently color invalid string prefixes. A ‘u’ string prefix cannot be paired with either ‘r’ or ‘f’. Consistently color as much of the prefix, starting at the right, as is valid. Revise and extend colorizer test.
  • Tools/Demos:
  • bpo-33189: pygettext.py now recognizes only literal strings as docstrings and translatable strings, and rejects bytes literals and f-string expressions.
  • bpo-31920: Fixed handling directories as arguments in the pygettext script. Based on patch by Oleg Krasnikov.
  • bpo-29673: Fix pystackv and pystack gdbinit macros.
  • bpo-31583: Fix 2to3 for using with –add-suffix option but without –output-dir option for relative path to files in current directory.

New in Python 3.7.0 Beta 3 (Mar 30, 2018)

  • PEP 538, Coercing the legacy C locale to a UTF-8 based locale
  • PEP 539, A New C-API for Thread-Local Storage in CPython
  • PEP 540, UTF-8 mode
  • PEP 552, Deterministic pyc
  • PEP 553, Built-in breakpoint()
  • PEP 557, Data Classes
  • PEP 560, Core support for typing module and generic types
  • PEP 562, Module __getattr__ and __dir__
  • PEP 563, Postponed Evaluation of Annotations
  • PEP 564, Time functions with nanosecond resolution
  • PEP 565, Show DeprecationWarning in __main__
  • PEP 567, Context Variables

New in Python 3.7.0 Beta 1 (Feb 28, 2018)

  • Python 3.7.0b1 is the first of four planned beta previews of Python 3.7, the next feature release of Python. This preview marks the end of the feature development phase for 3.7. Beta releases are intended to give you the opportunity to test new features and bug fixes and to prepare your projects to support the new feature release. We strongly encourage you to test your projects with 3.7 during the beta phase and report issues found to bugs.python.org as soon as possible. While the release is feature complete entering the beta phase, it is possible that features may be modified or, in rare cases, deleted up until the start of the release candidate phase. Please keep in mind that this is a preview release and its use is not recommended for production environments.

New in Python 3.7.0 Alpha 2 (Oct 18, 2017)

  • Core and Builtins:
  • bpo-31558: gc.freeze() is a new API that allows for moving all objects currently tracked by the garbage collector to a permanent generation, effectively removing them from future collection events. This can be used to protect those objects from having their PyGC_Head mutated. In effect, this enables great copy-on-write stability at fork().
  • bpo-31642: Restored blocking “from package import module” by setting sys.modules[“package.module”] to None.
  • bpo-31708: Allow use of asynchronous generator expressions in synchronous functions.
  • bpo-31709: Drop support of asynchronous __aiter__.
  • bpo-30404: The -u option now makes the stdout and stderr streams unbuffered rather than line-buffered.
  • bpo-31619: Fixed a ValueError when convert a string with large number of underscores to integer with binary base.
  • bpo-31602: Fix an assertion failure in zipimporter.get_source() in case of a bad zlib.decompress().
  • bpo-31592: Fixed an assertion failure in Python parser in case of a bad unicodedata.normalize().
  • bpo-31588: Raise a TypeError with a helpful error message when class creation fails due to a metaclass with a bad __prepare__() method.
  • bpo-31574: Importlib was instrumented with two dtrace probes to profile import timing.
  • bpo-31566: Fix an assertion failure in _warnings.warn() in case of a bad __name__ global.
  • bpo-31506: Improved the error message logic for object.__new__ and object.__init__.
  • bpo-31505: Fix an assertion failure in json, in case _json.make_encoder() received a bad encoder() argument.
  • bpo-31492: Fix assertion failures in case of failing to import from a module with a bad __name__ attribute, and in case of failing to access an attribute of such a module.
  • bpo-31478: Fix an assertion failure in _random.Random.seed() in case the argument has a bad __abs__() method.
  • bpo-31336: Speed up class creation by 10-20% by reducing the overhead in the necessary special method lookups.
  • bpo-31415: Add -X importtime option to show how long each import takes. It can be used to optimize application’s startup time.
  • bpo-31410: Optimized calling wrapper and classmethod descriptors.
  • bpo-31353: PEP 553 - Add a new built-in called breakpoint() which calls sys.breakpointhook(). By default this imports pdb and calls pdb.set_trace(), but users may override sys.breakpointhook() to call whatever debugger they want. The original value of the hook is saved in sys.__breakpointhook__.
  • bpo-17852: Maintain a list of open buffered files, flush them before exiting the interpreter.
  • bpo-31315: Fix an assertion failure in imp.create_dynamic(), when spec.name is not a string.
  • bpo-31311: Fix a crash in the __setstate__() method of ctypes._CData, in case of a bad __dict__.
  • bpo-31293: Fix crashes in true division and multiplication of a timedelta object by a float with a bad as_integer_ratio() method..
  • bpo-31285: Fix an assertion failure in warnings.warn_explicit, when the return value of the received loader’s get_source() has a bad splitlines() method.
  • bpo-30406: Make async and await proper keywords, as specified in PEP 492.
  • Library:
  • bpo-30058: Fixed buffer overflow in select.kqueue.control().
  • bpo-31672: idpattern in string.Template matched some non-ASCII characters. Now it uses -i regular expression local flag to avoid non- ASCII characters.
  • bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM exceptions.
  • bpo-31728: Prevent crashes in _elementtree due to unsafe cleanup of Element.text and Element.tail.
  • bpo-31671: Now re.compile() converts passed RegexFlag to normal int object before compiling. bm_regex_compile benchmark shows 14% performance improvements.
  • bpo-30397: The types of compiled regular objects and match objects are now exposed as re.Pattern and re.Match. This adds information in pydoc output for the re module.
  • bpo-31675: Fixed memory leaks in Tkinter’s methods splitlist() and split() when pass a string larger than 2 GiB.
  • bpo-31673: Fixed typo in the name of Tkinter’s method adderrorinfo().
  • bpo-31648: Improvements to path predicates in ElementTree:
  • Allow whitespace around predicate parts, i.e. “[a = ‘text’]” instead of requiring the less readable “[a=’text’]”.
  • Add support for text comparison of the current node, like “[.=’text’]”.
  • bpo-30806: Fix the string representation of a netrc object.
  • bpo-31638: Add optional argument compressed to zipapp.create_archive, and add option --compress to the command line interface of zipapp.
  • bpo-25351: Avoid venv activate failures with undefined variables
  • bpo-20519: Avoid ctypes use (if possible) and improve import time for uuid.
  • bpo-28293: The regular expression cache is no longer completely dumped when it is full.
  • bpo-31596: Added pthread_getcpuclockid() to the time module
  • bpo-27494: Make 2to3 accept a trailing comma in generator expressions. For example, set(x for x in [],) is now allowed.
  • bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() iterators.
  • bpo-30346: An iterator produced by itertools.groupby() iterator now becames exhausted after advancing the groupby iterator.
  • bpo-31556: Cancel asyncio.wait_for future faster if timeout <= 0
  • bpo-31540: Allow passing a context object in concurrent.futures.ProcessPoolExecutor constructor. Also, free job ressources in concurrent.futures.ProcessPoolExecutor earlier to improve memory usage when a worker waits for new jobs.
  • bpo-31516: threading.current_thread() should not return a dummy thread at shutdown.
  • bpo-31525: In the sqlite module, require the sqlite3_prepare_v2 API. Thus, the sqlite module now requires sqlite version at least 3.3.9.
  • bpo-26510: argparse subparsers are now required by default. This matches behaviour in Python 2. For optional subparsers, use the new parameter add_subparsers(required=False). Patch by Anthony Sottile.
  • bpo-27541: Reprs of subclasses of some collection and iterator classes (bytearray, array.array, collections.deque, collections.defaultdict, itertools.count, itertools.repeat) now contain actual type name insteads of hardcoded name of the base class.
  • bpo-31351: python -m ensurepip now exits with non-zero exit code if pip bootstrapping has failed.
  • bpo-31389: pdb.set_trace() now takes an optional keyword-only argument header. If given, this is printed to the console just before debugging begins.
  • Documentation:
  • bpo-31537: Fix incorrect usage of get_history_length in readline documentation example code. Patch by Brad Smith.
  • bpo-30085: The operator functions without double underscores are preferred for clarity. The one with underscores are only kept for back- compatibility.
  • Build:
  • bpo-31696: Improve compiler version information in sys.version when Python is built with Clang.
  • bpo-31625: Stop using ranlib on static libraries. Instead, we assume ar supports the ‘s’ flag.
  • bpo-31624: Remove support for BSD/OS.
  • bpo-22140: Prevent double substitution of prefix in python-config.sh.
  • bpo-31569: Correct PCBuild/ case to PCbuild/ in build scripts and documentation.
  • bpo-31536: Avoid wholesale rebuild after make regen-all if nothing changed.
  • IDLE:
  • bpo-31460: Simplify the API of IDLE’s Module Browser.
  • Passing a widget instead of an flist with a root widget opens the option of creating a browser frame that is only part of a window. Passing a full file name instead of pieces assumed to come from a .py file opens the possibility of browsing python files that do not end in .py.
  • bpo-31649: IDLE - Make _htest, _utest parameters keyword only.
  • bpo-31559: Remove test order dependence in idle_test.test_browser.
  • bpo-31459: Rename IDLE’s module browser from Class Browser to Module Browser. The original module-level class and method browser became a module browser, with the addition of module-level functions, years ago. Nested classes and functions were added yesterday. For back- compatibility, the virtual event <<open-class-browser>>, which appears on the Keys tab of the Settings dialog, is not changed.
  • bpo-31500: Default fonts now are scaled on HiDPI displays.
  • bpo-1612262: IDLE module browser now shows nested classes and functions.
  • C API:
  • bpo-28280: Make PyMapping_Keys(), PyMapping_Values() and PyMapping_Items() always return a list (rather than a list or a tuple). Patch by Oren Milman.
  • bpo-31532: Fix memory corruption due to allocator mix in getpath.c between Py_GetPath() and Py_SetPath()
  • bpo-25658: Implement PEP 539 for Thread Specific Stroage (TSS) API: it is a new Thread Local Storage (TLS) API to CPython which would supersede use of the existing TLS API within the CPython interpreter, while deprecating the existing API.

New in Python 3.6.3 (Oct 4, 2017)

  • Library:
  • bpo-31641: Re-allow arbitrary iterables in concurrent.futures.as_completed(). Fixes regression in 3.6.3rc1.
  • Build:
  • bpo-31662: Fix typos in Windows uploadrelease.bat script. Fix Windows Doc build issues in Doc/make.bat.
  • bpo-31423: Fix building the PDF documentation with newer versions of Sphinx.

New in Python 3.7.0 Alpha 1 (Sep 20, 2017)

  • Security:
  • bpo-29781: SSLObject.version() now correctly returns None when handshake over BIO has not been performed yet.
  • bpo-29505: Add fuzz tests for float(str), int(str), unicode(str); for oss- fuzz.
  • bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to get security fixes.
  • bpo-30730: Prevent environment variables injection in subprocess on Windows. Prevent passing other environment variables and command arguments.
  • bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple security vulnerabilities including: CVE-2017-9233 (External entity infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), CVE-2016-0718 (Fix regression bugs from 2.2.0’s fix to CVE-2016-0718) and CVE-2012-0876 (Counter hash flooding with SipHash). Note: the CVE-2016-5300 (Use os- specific entropy sources like getrandom) doesn’t impact Python, since Python already gets entropy from the OS to set the expat secret using XML_SetHashSalt().
  • bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For example, splithost('//127.0.0.1#@evil.com/') now correctly returns the 127.0.0.1 host, instead of treating @evil.com as the host in an authentification (login@host).
  • bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of CVE-2016-0718 and CVE-2016-4472. See https://sourceforge.net/p/expat/bugs/537/ for more information.
  • Core and Builtins:
  • bpo-31490: Fix an assertion failure in ctypes class definition, in case the class has an attribute whose name is specified in _anonymous_ but not in _fields_. Patch by Oren Milman.
  • bpo-31471: Fix an assertion failure in subprocess.Popen() on Windows, in case the env argument has a bad keys() method. Patch by Oren Milman.
  • bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case of an exception with a bad __module__ attribute. Patch by Oren Milman.
  • bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. Patch by Oren Milman.
  • bpo-28411: Change direct usage of PyInterpreterState.modules to PyImport_GetModuleDict(). Also introduce more uniformity in other code that deals with sys.modules. This helps reduce complications when working on sys.modules.
  • bpo-28411: Switch to the abstract API when dealing with PyInterpreterState.modules. This allows later support for all dict subclasses and other Mapping implementations. Also add a PyImport_GetModule() function to reduce a bunch of duplicated code.
  • bpo-31411: Raise a TypeError instead of SystemError in case warnings.onceregistry is not a dictionary. Patch by Oren Milman.
  • bpo-31344: For finer control of tracing behaviour when testing the interpreter, two new frame attributes have been added to control the emission of particular trace events: f_trace_lines (True by default) to turn off per-line trace events; and f_trace_opcodes (False by default) to turn on per-opcode trace events.
  • bpo-31373: Fix several possible instances of undefined behavior due to floating-point demotions.
  • bpo-30465: Location information (lineno and col_offset) in f-strings is now (mostly) correct. This fixes tools like flake8 from showing warnings on the wrong line (typically the first line of the file).
  • bpo-30860: Consolidate CPython’s global runtime state under a single struct. This improves discoverability of the runtime state.
  • bpo-31347: Fix possible undefined behavior in _PyObject_FastCall_Prepend.
  • bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev(). GNU C libray plans to remove the functions from sys/types.h.
  • bpo-31291: Fix an assertion failure in zipimport.zipimporter.get_data on Windows, when the return value of pathname.replace('/','\') isn’t a string. Patch by Oren Milman.
  • bpo-31271: Fix an assertion failure in the write() method of io.TextIOWrapper, when the encoder doesn’t return a bytes object. Patch by Oren Milman.
  • bpo-31243: Fix a crash in some methods of io.TextIOWrapper, when the decoder’s state is invalid. Patch by Oren Milman.
  • bpo-30721: print now shows correct usage hint for using Python 2 redirection syntax. Patch by Sanyam Khurana.
  • bpo-31070: Fix a race condition in importlib _get_module_lock().
  • bpo-30747: Add a non-dummy implementation of _Py_atomic_store and _Py_atomic_load on MSVC.
  • bpo-31095: Fix potential crash during GC caused by tp_dealloc which doesn’t call PyObject_GC_UnTrack().
  • bpo-31071: Avoid masking original TypeError in call with * unpacking when other arguments are passed.
  • bpo-30978: str.format_map() now passes key lookup exceptions through. Previously any exception was replaced with a KeyError exception.
  • bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state.
  • bpo-30876: Relative import from unloaded package now reimports the package instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError.
  • bpo-30703: Improve signal delivery.
  • Avoid using Py_AddPendingCall from signal handler, to avoid calling signal- unsafe functions. The tests I’m adding here fail without the rest of the patch, on Linux and OS X. This means our signal delivery logic had defects (some signals could be lost).
  • bpo-30765: Avoid blocking in pthread_mutex_lock() when PyThread_acquire_lock() is asked not to block.
  • bpo-31161: Make sure the ‘Missing parentheses’ syntax error message is only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters.
  • bpo-30814: Fixed a race condition when import a submodule from a package.
  • bpo-30736: The internal unicodedata database has been upgraded to Unicode 10.0.
  • bpo-30604: Move co_extra_freefuncs from per-thread to per-interpreter to avoid crashes.
  • bpo-30597: print now shows expected input in custom error message when used as a Python 2 statement. Patch by Sanyam Khurana.
  • bpo-30682: Removed a too-strict assertion that failed for certain f-strings, such as eval(“f’n’”) and eval(“f’r’”).
  • bpo-30501: The compiler now produces more optimal code for complex condition expressions in the “if”, “while” and “assert” statement, the “if” expression, and generator expressions and comprehensions.
  • bpo-28180: Implement PEP 538 (legacy C locale coercion). This means that when a suitable coercion target locale is available, both the core interpreter and locale-aware C extensions will assume the use of UTF-8 as the default text encoding, rather than ASCII.
  • bpo-30486: Allows setting cell values for __closure__. Patch by Lisa Roach.
  • bpo-30537: itertools.islice now accepts integer-like objects (having an __index__ method) as start, stop, and slice arguments
  • bpo-25324: Tokens needed for parsing in Python moved to C. COMMENT, NL and ENCODING. This way the tokens and tok_names in the token module don’t get changed when you import the tokenize module.
  • bpo-29104: Fixed parsing backslashes in f-strings.
  • bpo-27945: Fixed various segfaults with dict when input collections are mutated during searching, inserting or comparing. Based on patches by Duane Griffin and Tim Mitchell.
  • bpo-25794: Fixed type.__setattr__() and type.__delattr__() for non- interned attribute names. Based on patch by Eryk Sun.
  • bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the middle of resuming a chain of nested ‘yield from’ or ‘await’ calls, it’s now correctly delivered to the innermost frame.
  • bpo-28974: object.__format__(x, '') is now equivalent to str(x) rather than format(str(self), '').
  • bpo-30024: Circular imports involving absolute imports with binding a submodule to a name are now supported.
  • bpo-12414: sys.getsizeof() on a code object now returns the sizes which includes the code struct and sizes of objects which it references. Patch by Dong-hee Na.
  • bpo-29839: len() now raises ValueError rather than OverflowError if __len__() returned a large negative integer.
  • bpo-11913: README.rst is now included in the list of distutils standard READMEs and therefore included in source distributions.
  • bpo-29914: Fixed default implementations of __reduce__ and __reduce_ex__(). object.__reduce__() no longer takes arguments, object.__reduce_ex__() now requires one argument.
  • bpo-29949: Fix memory usage regression of set and frozenset object.
  • bpo-29935: Fixed error messages in the index() method of tuple, list and deque when pass indices of wrong type.
  • bpo-29816: Shift operation now has less opportunity to raise OverflowError. ValueError always is raised rather than OverflowError for negative counts. Shifting zero with non-negative count always returns zero.
  • bpo-24821: Fixed the slowing down to 25 times in the searching of some unlucky Unicode characters.
  • bpo-29102: Add a unique ID to PyInterpreterState. This makes it easier to identify each subinterpreter.
  • bpo-29894: The deprecation warning is emitted if __complex__ returns an instance of a strict subclass of complex. In a future versions of Python this can be an error.
  • bpo-29859: Show correct error messages when any of the pthread_* calls in thread_pthread.h fails.
  • bpo-29849: Fix a memory leak when an ImportError is raised during from import.
  • bpo-28856: Fix an oversight that %b format for bytes should support objects follow the buffer protocol.
  • bpo-29723: The sys.path[0] initialization change for bpo-29139 caused a regression by revealing an inconsistency in how sys.path is initialized when executing __main__ from a zipfile, directory, or other import location. The interpreter now consistently avoids ever adding the import location’s parent directory to sys.path, and ensures no other sys.path entries are inadvertently modified when inserting the import location named on the command line.
  • bpo-29568: Escaped percent “%%” in the format string for classic string formatting no longer allows any characters between two percents.
  • bpo-29714: Fix a regression that bytes format may fail when containing zero bytes inside.
  • bpo-29695: bool(), float(), list() and tuple() no longer take keyword arguments. The first argument of int() can now be passes only as positional argument.
  • bpo-28893: Set correct __cause__ for errors about invalid awaitables returned from __aiter__ and __anext__.
  • bpo-28876: bool(range) works even if len(range) raises OverflowError.
  • bpo-29683: Fixes to memory allocation in _PyCode_SetExtra. Patch by Brian Coleman.
  • bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It should raise TypeError when kwargs is not a dict. But it might cause segv when args=NULL and kwargs is not a dict.
  • bpo-28598: Support __rmod__ for subclasses of str being called before str.__mod__. Patch by Martijn Pieters.
  • bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by Matthieu Dartiailh.
  • bpo-29602: Fix incorrect handling of signed zeros in complex constructor for complex subclasses and for inputs having a __complex__ method. Patch by Serhiy Storchaka.
  • bpo-29347: Fixed possibly dereferencing undefined pointers when creating weakref objects.
  • bpo-29463: Add docstring field to Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes. docstring is not first stmt in their body anymore. It affects co_firstlineno and co_lnotab of code object for module and class.
  • bpo-29438: Fixed use-after-free problem in key sharing dict.
  • bpo-29546: Set the ‘path’ and ‘name’ attribute on ImportError for from ... import ....
  • bpo-29546: Improve from-import error message with location
  • bpo-29478: If max_line_length=None is specified while using the Compat32 policy, it is no longer ignored. Patch by Mircea Cosbuc.
  • bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0].
  • bpo-29337: Fixed possible BytesWarning when compare the code objects. Warnings could be emitted at compile time.
  • bpo-29327: Fixed a crash when pass the iterable keyword argument to sorted().
  • bpo-29034: Fix memory leak and use-after-free in os module (path_converter).
  • bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception.
  • bpo-29049: Call _PyObject_GC_TRACK() lazily when calling Python function. Calling function is up to 5% faster.
  • bpo-28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII whitespace, not only spaces. Patch by Robert Xiao.
  • bpo-28932: Do not include <sys/random.h> if it does not exist.
  • bpo-25677: Correct the positioning of the syntax error caret for indented blocks. Based on patch by Michael Layzell.
  • bpo-29000: Fixed bytes formatting of octals with zero padding in alternate form.
  • bpo-18896: Python function can now have more than 255 parameters. collections.namedtuple() now supports tuples with more than 255 elements.
  • bpo-28596: The preferred encoding is UTF-8 on Android. Patch written by Chi Hsuan Yen.
  • bpo-22257: Clean up interpreter startup (see PEP 432).
  • bpo-26919: On Android, operating system data is now always encoded/decoded to/from UTF-8, instead of the locale encoding to avoid inconsistencies with os.fsencode() and os.fsdecode() which are already using UTF-8.
  • bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy bug triggerable by a monkey-patched len() function.
  • bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must not convert combined table into split table. Patch written by INADA Naoki.
  • bpo-28739: f-string expressions are no longer accepted as docstrings and by ast.literal_eval() even if they do not include expressions.
  • bpo-28512: Fixed setting the offset attribute of SyntaxError by PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
  • bpo-28918: Fix the cross compilation of xxlimited when Python has been built with Py_DEBUG defined.
  • bpo-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().
  • bpo-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.
  • bpo-28799: Remove the PyEval_GetCallStats() function and deprecate the untested and undocumented sys.callstats() function. Remove the CALL_PROFILE special build: use the sys.setprofile() function, cProfile or profile to profile function calls.
  • bpo-12844: More than 255 arguments can now be passed to a function.
  • bpo-28782: Fix a bug in the implementation yield from when checking if the next instruction is YIELD_FROM. Regression introduced by WORDCODE (bpo-26647).
  • bpo-28774: Fix error position of the unicode error in ASCII and Latin1 encoders when a string returned by the error handler contains multiple non-encodable characters (non-ASCII for the ASCII codec, characters out of the U+0000-U+00FF range for Latin1).
  • bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict. Improve speed of dict literal with constant keys up to 30%.
  • bpo-28532: Show sys.version when -V option is supplied twice.
  • bpo-27100: The with-statement now checks for __enter__ before it checks for __exit__. This gives less confusing error messages when both methods are missing. Patch by Jonathan Ellington.
  • bpo-28746: Fix the set_inheritable() file descriptor method on platforms that do not have the ioctl FIOCLEX and FIONCLEX commands.
  • bpo-26920: Fix not getting the locale’s charset upon initializing the interpreter, on platforms that do not have langinfo.
  • bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X when decode astral characters. Patch by Xiang Zhang.
  • bpo-28665: Improve speed of the STORE_DEREF opcode by 40%.
  • bpo-19398: Extra slash no longer added to sys.path components in case of empty compile- time PYTHONPATH components.
  • bpo-28621: Sped up converting int to float by reusing faster bits counting implementation. Patch by Adrian Wielgosik.
  • bpo-28580: Optimize iterating split table values. Patch by Xiang Zhang.
  • bpo-28583: PyDict_SetDefault didn’t combine split table when needed. Patch by Xiang Zhang.
  • bpo-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.
  • bpo-28509: dict.update() no longer allocate unnecessary large memory.
  • bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug build.
  • bpo-28517: Fixed of-by-one error in the peephole optimizer that caused keeping unreachable code.
  • bpo-28214: Improved exception reporting for problematic __set_name__ attributes.
  • bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception loss in PyTraceBack_Here().
  • bpo-28183: Optimize and cleanup dict iteration.
  • bpo-26081: Added C implementation of asyncio.Future. Original patch by Yury Selivanov.
  • bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters(). Patch by Xiang Zhang.
  • bpo-28376: The type of long range iterator is now registered as Iterator. Patch by Oren Milman.
  • bpo-28376: Creating instances of range_iterator by calling range_iterator type now is disallowed. Calling iter() on range instance is the only way. Patch by Oren Milman.
  • bpo-26906: Resolving special methods of uninitialized type now causes implicit initialization of the type instead of a fail.
  • bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original patch by Niklas Koep.
  • bpo-24098: Fixed possible crash when AST is changed in process of compiling it.
  • bpo-28201: Dict reduces possibility of 2nd conflict in hash table when hashes have same lower bits.
  • bpo-28350: String constants with null character no longer interned.
  • bpo-26617: Fix crash when GC runs during weakref callbacks.
  • bpo-27942: String constants now interned recursively in tuples and frozensets.
  • bpo-28289: ImportError.__init__ now resets not specified attributes.
  • bpo-21578: Fixed misleading error message when ImportError called with invalid keyword args.
  • bpo-28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch by Soumya Sharma.
  • bpo-28086: Single var-positional argument of tuple subtype was passed unscathed to the C-defined function. Now it is converted to exact tuple.
  • bpo-28214: Now __set_name__ is looked up on the class instead of the instance.
  • bpo-27955: Fallback on reading /dev/urandom device when the getrandom() syscall fails with EPERM, for example when blocked by SECCOMP.
  • bpo-28192: Don’t import readline in isolated mode.
  • bpo-27441: Remove some redundant assignments to ob_size in longobject.c. Thanks Oren Milman.
  • bpo-27222: Clean up redundant code in long_rshift function. Thanks Oren Milman.
  • Upgrade internal unicode databases to Unicode version 9.0.0.
  • bpo-28131: Fix a regression in zipimport’s compile_source(). zipimport should use the same optimization level as the interpreter.
  • bpo-28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
  • bpo-28120: Fix dict.pop() for splitted dictionary when trying to remove a “pending key” (Not yet inserted in split-table). Patch by Xiang Zhang.
  • bpo-26182: Raise DeprecationWarning when async and await keywords are used as variable/attribute/class/function name.
  • bpo-26182: Fix a refleak in code that raises DeprecationWarning.
  • bpo-28721: Fix asynchronous generators aclose() and athrow() to handle StopAsyncIteration propagation properly.
  • bpo-26110: Speed-up method calls: add LOAD_METHOD and CALL_METHOD opcodes.
  • Library:
  • bpo-31499: xml.etree: Fix a crash when a parser is part of a reference cycle.
  • bpo-31482: random.seed() now works with bytes in version=1
  • bpo-28556: typing.get_type_hints now finds the right globalns for classes and modules by default (when no globalns was specified by the caller).
  • bpo-28556: Speed improvements to the typing module. Original PRs by Ivan Levkivskyi and Mitar.
  • bpo-31544: The C accelerator module of ElementTree ignored exceptions raised when looking up TreeBuilder target methods in XMLParser().
  • bpo-31234: socket.create_connection() now fixes manually a reference cycle: clear the variable storing the last exception on success.
  • bpo-31457: LoggerAdapter objects can now be nested.
  • bpo-31431: SSLContext.check_hostname now automatically sets SSLContext.verify_mode to ssl.CERT_REQUIRED instead of failing with a ValueError.
  • bpo-31233: socketserver.ThreadingMixIn now keeps a list of non-daemonic threads to wait until all these threads complete in server_close().
  • bpo-28638: Changed the implementation strategy for collections.namedtuple() to substantially reduce the use of exec() in favor of precomputed methods. As a result, the verbose parameter and _source attribute are no longer supported. The benefits include 1) having a smaller memory footprint for applications using multiple named tuples, 2) faster creation of the named tuple class (approx 4x to 6x depending on how it is measured), and 3) minor speed-ups for instance creation using __new__, _make, and _replace. (The primary patch contributor is Jelle Zijlstra with further improvements by INADA Naoki, Serhiy Storchaka, and Raymond Hettinger.)
  • bpo-31400: Improves SSL error handling to avoid losing error numbers.
  • bpo-27629: Make return types of SSLContext.wrap_bio() and SSLContext.wrap_socket() customizable.
  • bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a context cannot be instantiated.
  • bpo-28182: The SSL module now raises SSLCertVerificationError when OpenSSL fails to verify the peer’s certificate. The exception contains more information about the error.
  • bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of data. This fixes support for all bytes-like object. It is also more efficient and avoids costly copies.
  • bpo-14191: A new function argparse.ArgumentParser.parse_intermixed_args provides the ability to parse command lines where there user intermixes options and positional arguments.
  • bpo-31178: Fix string concatenation bug in rare error path in the subprocess module
  • bpo-31350: Micro-optimize asyncio._get_running_loop() to become up to 10% faster.
  • bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of partial characters for UTF-8 input (libexpat bug 115): https://github.com/libexpat/libexpat/issues/115
  • bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3.
  • bpo-1198569: string.Template subclasses can optionally define braceidpattern if they want to specify different placeholder patterns inside and outside the braces. If None (the default) it falls back to idpattern.
  • bpo-31326: concurrent.futures.ProcessPoolExecutor.shutdown() now explicitly closes the call queue. Moreover, shutdown(wait=True) now also join the call queue thread, to prevent leaking a dangling thread.
  • bpo-27144: The map() and as_completed() iterators in concurrent.futures now avoid keeping a reference to yielded objects.
  • bpo-31281: Fix fileinput.FileInput(files, inplace=True) when files contain pathlib.Path objects.
  • bpo-10746: Fix ctypes producing wrong PEP 3118 type codes for integer types.
  • bpo-27584: AF_VSOCK has been added to the socket interface which allows communication between virtual machines and their host.
  • bpo-22536: The subprocess module now sets the filename when FileNotFoundError is raised on POSIX systems due to the executable or cwd not being found.
  • bpo-29741: Update some methods in the _pyio module to also accept integer types. Patch by Oren Milman.
  • bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor now breaks a reference cycle between an exception object and the WorkItem object.
  • bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using sys.exc_info() in code handling exceptions.
  • bpo-23835: configparser: reading defaults in the ConfigParser() constructor is now using read_dict(), making its behavior consistent with the rest of the parser. Non-string keys and values in the defaults dictionary are now being implicitly converted to strings. Patch by James Tocknell.
  • bpo-31238: pydoc: the stop() method of the private ServerThread class now waits until DocServer.serve_until_quit() completes and then explicitly sets its docserver attribute to None to break a reference cycle.
  • bpo-5001: Many asserts in multiprocessing are now more informative, and some error types have been changed to more specific ones.
  • bpo-31109: Convert zipimport to use Argument Clinic.
  • bpo-30102: The ssl and hashlib modules now call OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function detects CPU features and enables optimizations on some CPU architectures such as POWER8. Patch is based on research from Gustavo Serra Scalet.
  • bpo-18966: Non-daemonic threads created by a multiprocessing.Process are now joined on child exit.
  • bpo-31183: dis now works with asynchronous generator and coroutine objects. Patch by George Collins based on diagnosis by Luciano Ramalho.
  • bpo-5001: There are a number of uninformative asserts in the multiprocessing module, as noted in issue 5001. This change fixes two of the most potentially problematic ones, since they are in error-reporting code, in the multiprocessing.managers.convert_to_error function. (It also makes more informative a ValueError message.) The only potentially problematic change is that the AssertionError is now a TypeError; however, this should also help distinguish it from an AssertionError being reported by the function/its caller (such as in issue 31169). - Patch by Allen W. Smith (drallensmith on github).
  • bpo-31185: Fixed miscellaneous errors in asyncio speedup module.
  • bpo-31151: socketserver.ForkingMixIn.server_close() now waits until all child processes completed to prevent leaking zombie processes.
  • bpo-31072: Add an include_file parameter to zipapp.create_archive()
  • bpo-24700: Optimize array.array comparison. It is now from 10x up to 70x faster when comparing arrays holding values of the same integer type.
  • bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu classes. Call the parent destroy() method even if the used attribute doesn’t exist. The LabeledScale.destroy() method now also explicitly clears label and scale attributes to help the garbage collector to destroy all widgets.
  • bpo-31107: Fix copyreg._slotnames() mangled attribute calculation for classes whose name begins with an underscore. Patch by Shane Harvey.
  • bpo-31080: Allow logging.config.fileConfig to accept kwargs and/or args.
  • bpo-30897: pathlib.Path objects now include an is_mount() method (only implemented on POSIX). This is similar to os.path.ismount(p). Patch by Cooper Ry Lees.
  • bpo-31061: Fixed a crash when using asyncio and threads.
  • bpo-30987: Added support for CAN ISO-TP protocol in the socket module.
  • bpo-30522: Added a setStream method to logging.StreamHandler to allow the stream to be set after creation.
  • bpo-30502: Fix handling of long oids in ssl. Based on patch by Christian Heimes.
  • bpo-5288: Support tzinfo objects with sub-minute offsets.
  • bpo-30919: Fix shared memory performance regression in multiprocessing in 3.x.
  • Shared memory used anonymous memory mappings in 2.x, while 3.x mmaps actual files. Try to be careful to do as little disk I/O as possible.
  • bpo-26732: Fix too many fds in processes started with the “forkserver” method.
  • A child process would inherit as many fds as the number of still-running children.
  • bpo-29403: Fix unittest.mock’s autospec to not fail on method-bound builtin functions. Patch by Aaron Gallagher.
  • bpo-30961: Fix decrementing a borrowed reference in tracemalloc.
  • bpo-19896: Fix multiprocessing.sharedctypes to recognize typecodes 'q' and 'Q'.
  • bpo-30946: Remove obsolete code in readline module for platforms where GNU readline is older than 2.1 or where select() is not available.
  • bpo-25684: Change ttk.OptionMenu radiobuttons to be unique across instances of OptionMenu.
  • bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the thread completes, even if the thread was started by the same process which created the queue.
  • bpo-29854: Fix segfault in readline when using readline’s history-size option. Patch by Nir Soffer.
  • bpo-30794: Added multiprocessing.Process.kill method to terminate using the SIGKILL signal on Unix.
  • bpo-30319: socket.close() now ignores ECONNRESET error.
  • bpo-30828: Fix out of bounds write in asyncio.CFuture.remove_done_callback().
  • bpo-30302: Use keywords in the repr of datetime.timedelta.
  • bpo-30807: signal.setitimer() may disable the timer when passed a tiny value.
  • Tiny values (such as 1e-6) are valid non-zero values for setitimer(), which is specified as taking microsecond-resolution intervals. However, on some platform, our conversion routine could convert 1e-6 into a zero interval, therefore disabling the timer instead of (re-)scheduling it.
  • bpo-30441: Fix bug when modifying os.environ while iterating over it
  • bpo-29585: Avoid importing sysconfig from site to improve startup speed. Python startup is about 5% faster on Linux and 30% faster on macOS.
  • bpo-29293: Add missing parameter “n” on multiprocessing.Condition.notify().
  • The doc claims multiprocessing.Condition behaves like threading.Condition, but its notify() method lacked the optional “n” argument (to specify the number of sleepers to wake up) that threading.Condition.notify() accepts.
  • bpo-30532: Fix email header value parser dropping folding white space in certain cases.
  • bpo-30596: Add a close() method to multiprocessing.Process.
  • bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash functions such as md5 are not available in the linked OpenSSL library. As in some special FIPS-140 build environments.
  • bpo-29169: Update zlib to 1.2.11.
  • bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that contains CR or LF. Patch by Dong-hee Na.
  • bpo-30879: os.listdir() and os.scandir() now emit bytes names when called with bytes- like argument.
  • bpo-30746: Prohibited the ‘=’ character in environment variable names in os.putenv() and os.spawn*().
  • bpo-30664: The description of a unittest subtest now preserves the order of keyword arguments of TestCase.subTest().
  • bpo-21071: struct.Struct.format type is now str instead of bytes.
  • bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to have a non repr() based thread name by default when no thread_name_prefix is supplied. They will now identify themselves as “ThreadPoolExecutor- y_n”.
  • bpo-29755: Fixed the lgettext() family of functions in the gettext module. They now always return bytes.
  • bpo-30616: Functional API of enum allows to create empty enums. Patched by Dong-hee Na
  • bpo-30038: Fix race condition between signal delivery and wakeup file descriptor. Patch by Nathaniel Smith.
  • bpo-23894: lib2to3 now recognizes rb'...' and f'...' strings.
  • bpo-24744: pkgutil.walk_packages function now raises ValueError if path is a string. Patch by Sanyam Khurana.
  • bpo-24484: Avoid race condition in multiprocessing cleanup.
  • bpo-30589: Fix multiprocessing.Process.exitcode to return the opposite of the signal number when the process is killed by a signal (instead of 255) when using the “forkserver” method.
  • bpo-28994: The traceback no longer displayed for SystemExit raised in a callback registered by atexit.
  • bpo-30508: Don’t log exceptions if Task/Future “cancel()” method was called.
  • bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases when a package is only shipped with bytecodes. Patch by Alexandru Ardelean.
  • bpo-11822: The dis.dis() function now is able to disassemble nested code objects.
  • bpo-30624: selectors does not take KeyboardInterrupt and SystemExit into account, leaving a fd in a bad state in case of error. Patch by Giampaolo Rodola’.
  • bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader in non- blocking mode if it succeeded to acquire the lock but the acquire took longer than the timeout.
  • bpo-28556: Updates to typing module: Add generic AsyncContextManager, add support for ContextManager on all versions. Original PRs by Jelle Zijlstra and Ivan Levkivskyi
  • bpo-30605: re.compile() no longer raises a BytesWarning when compiling a bytes instance with misplaced inline modifier. Patch by Roy Williams.
  • bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl implementation. Patch by Michaël Sghaïer.
  • bpo-29743: Closing transport during handshake process leaks open socket. Patch by Nikolay Kim
  • bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu Sornay.
  • bpo-30014: modify() method of poll(), epoll() and devpoll() based classes of selectors module is around 10% faster. Patch by Giampaolo Rodola’.
  • bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore EINVAL on stdin.write() if the child process is still running but closed the pipe.
  • bpo-30463: Addded empty __slots__ to abc.ABC. This allows subclassers to deny __dict__ and __weakref__ creation. Patch by Aaron Hall.
  • bpo-30520: Loggers are now pickleable.
  • bpo-30557: faulthandler now correctly filters and displays exception codes on Windows
  • bpo-30526: Add TextIOWrapper.reconfigure() and a TextIOWrapper.write_through attribute.
  • bpo-30245: Fix possible overflow when organize struct.pack_into error message. Patch by Yuan Liu.
  • bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot handle IPv6 addresses.
  • bpo-16500: Allow registering at-fork handlers.
  • bpo-30470: Deprecate invalid ctypes call protection on Windows. Patch by Mariatta Wijaya.
  • bpo-30414: multiprocessing.Queue._feed background running thread do not break from main loop on exception.
  • bpo-30003: Fix handling escape characters in HZ codec. Based on patch by Ma Lin.
  • bpo-30149: inspect.signature() now supports callables with variable- argument parameters wrapped with partialmethod. Patch by Dong-hee Na.
  • bpo-30436: importlib.find_spec() raises ModuleNotFoundError instead of AttributeError if the specified parent module is not a package (i.e. lacks a __path__ attribute).
  • bpo-30301: Fix AttributeError when using SimpleQueue.empty() under spawn and forkserver start methods.
  • bpo-30375: Warnings emitted when compile a regular expression now always point to the line in the user code. Previously they could point into inners of the re module if emitted from inside of groups or conditionals.
  • bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted. This error occurs sometimes on SSL connections.
  • bpo-29196: Removed previously deprecated in Python 2.4 classes Plist, Dict and _InternalDict in the plistlib module. Dict values in the result of functions readPlist() and readPlistFromBytes() are now normal dicts. You no longer can use attribute access to access items of these dictionaries.
  • bpo-9850: The macpath is now deprecated and will be removed in Python 3.8.
  • bpo-30299: Compiling regular expression in debug mode on CPython now displays the compiled bytecode in human readable form.
  • bpo-30048: Fixed Task.cancel() can be ignored when the task is running coroutine and the coroutine returned without any more await.
  • bpo-30266: contextlib.AbstractContextManager now supports anti- registration by setting __enter__ = None or __exit__ = None, following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra.
  • bpo-30340: Enhanced regular expressions optimization. This increased the performance of matching some patterns up to 25 times.
  • bpo-30298: Weaken the condition of deprecation warnings for inline modifiers. Now allowed several subsequential inline modifiers at the start of the pattern (e.g. '(?i)(?s)...'). In verbose mode whitespaces and comments now are allowed before and between inline modifiers (e.g. '(?x) (?i) (?s)...').
  • bpo-30285: Optimized case-insensitive matching and searching of regular expressions.
  • bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma Lin.
  • bpo-29979: rewrite cgi.parse_multipart, reusing the FieldStorage class and making its results consistent with those of FieldStorage for multipart/form-data requests. Patch by Pierre Quentel.
  • bpo-30243: Removed the __init__ methods of _json’s scanner and encoder. Misusing them could cause memory leaks or crashes. Now scanner and encoder objects are completely initialized in the __new__ methods.
  • bpo-30215: Compiled regular expression objects with the re.LOCALE flag no longer depend on the locale at compile time. Only the locale at matching time affects the result of matching.
  • bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process when Ctrl-C is received.
  • bpo-30103: binascii.b2a_uu() and uu.encode() now support using '`' as zero instead of space.
  • bpo-28556: Various updates to typing module: add typing.NoReturn type, use WrapperDescriptorType, minor bug-fixes. Original PRs by Jim Fasarakis- Hilliard and Ivan Levkivskyi.
  • bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux.
  • bpo-30228: The seek() and tell() methods of io.FileIO now set the internal seekable attribute to avoid one syscall on open() (in buffered or text mode).
  • bpo-30190: unittest’s assertAlmostEqual and assertNotAlmostEqual provide a better message in case of failure which includes the difference between left and right arguments. (patch by Giampaolo Rodola’)
  • bpo-30101: Add support for curses.A_ITALIC.
  • bpo-29822: inspect.isabstract() now works during __init_subclass__. Patch by Nate Soares.
  • bpo-29960: Preserve generator state when _random.Random.setstate() raises an exception. Patch by Bryan Olson.
  • bpo-30070: Fixed leaks and crashes in errors handling in the parser module.
  • bpo-22352: Column widths in the output of dis.dis() are now adjusted for large line numbers and instruction offsets.
  • bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when readline() or __next__() respectively return non-sizeable object. Fixed possible other errors caused by not checking results of PyObject_Size(), PySequence_Size(), or PyMapping_Size().
  • bpo-30218: Fix PathLike support for shutil.unpack_archive. Patch by Jelle Zijlstra.
  • bpo-10076: Compiled regular expression and match objects in the re module now support copy.copy() and copy.deepcopy() (they are considered atomic).
  • bpo-30068: _io._IOBase.readlines will check if it’s closed first when hint is present.
  • bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True. Patch by Armin Rigo.
  • bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in contextlib.contextmanager. Patch by Siddharth Velankar.
  • bpo-26187: Test that sqlite3 trace callback is not called multiple times when schema is changing. Indirectly fixed by switching to use sqlite3_prepare_v2() in bpo-9303. Patch by Aviv Palivoda.
  • bpo-30017: Allowed calling the close() method of the zip entry writer object multiple times. Writing to a closed writer now always produces a ValueError.
  • bpo-29998: Pickling and copying ImportError now preserves name and path attributes.
  • bpo-29995: re.escape() now escapes only regex special characters.
  • bpo-29962: Add math.remainder operation, implementing remainder as specified in IEEE 754.
  • bpo-29649: Improve struct.pack_into() exception messages for problems with the buffer size and offset. Patch by Andrew Nester.
  • bpo-29654: Support If-Modified-Since HTTP header (browser cache). Patch by Pierre Quentel.
  • bpo-29931: Fixed comparison check for ipaddress.ip_interface objects. Patch by Sanjay Sundaresan.
  • bpo-29953: Fixed memory leaks in the replace() method of datetime and time objects when pass out of bound fold argument.
  • bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering long runs of empty iterables.
  • bpo-10030: Sped up reading encrypted ZIP files by 2 times.
  • bpo-29204: Element.getiterator() and the html parameter of XMLParser() were deprecated only in the documentation (since Python 3.2 and 3.4 correspondintly). Now using them emits a deprecation warning.
  • bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions and wrong types.
  • bpo-25996: Added support of file descriptors in os.scandir() on Unix. os.fwalk() is sped up by 2 times by using os.scandir().
  • bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an exception at the very first of an iterable may swallow the exception or make the program hang. Patch by Davin Potts and Xiang Zhang.
  • bpo-23890: unittest.TestCase.assertRaises() now manually breaks a reference cycle to not keep objects alive longer than expected.
  • bpo-29901: The zipapp module now supports general path-like objects, not just pathlib.Path.
  • bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when the OS gives priority to errors such as EACCES over EEXIST.
  • bpo-29861: Release references to tasks, their arguments and their results as soon as they are finished in multiprocessing.Pool.
  • bpo-19930: The mode argument of os.makedirs() no longer affects the file permission bits of newly-created intermediate-level directories.
  • bpo-29884: faulthandler: Restore the old sigaltstack during teardown. Patch by Christophe Zeitouny.
  • bpo-25455: Fixed crashes in repr of recursive buffered file-like objects.
  • bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords are not strings. Patch by Michael Seifert.
  • bpo-8256: Fixed possible failing or crashing input() if attributes “encoding” or “errors” of sys.stdin or sys.stdout are not set or are not strings.
  • bpo-28692: Using non-integer value for selecting a plural form in gettext is now deprecated.
  • bpo-26121: Use C library implementation for math functions erf() and erfc().
  • bpo-29619: os.stat() and os.DirEntry.inode() now convert inode (st_ino) using unsigned integers.
  • bpo-28298: Fix a bug that prevented array ‘Q’, ‘L’ and ‘I’ from accepting big intables (objects that have __int__) as elements.
  • bpo-29645: Speed up importing the webbrowser module. webbrowser.register() is now thread-safe.
  • bpo-28231: The zipfile module now accepts path-like objects for external paths.
  • bpo-26915: index() and count() methods of collections.abc.Sequence now check identity before checking equality when do comparisons.
  • bpo-28682: Added support for bytes paths in os.fwalk().
  • bpo-29728: Add new socket.TCP_NOTSENT_LOWAT (Linux 3.12) constant. Patch by Nathaniel J. Smith.
  • bpo-29623: Allow use of path-like object as a single argument in ConfigParser.read(). Patch by David Ellis.
  • bpo-9303: Migrate sqlite3 module to _v2 API. Patch by Aviv Palivoda.
  • bpo-28963: Fix out of bound iteration in asyncio.Future.remove_done_callback implemented in C.
  • bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes before all pipes are closed.
  • bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to accept None argument as their pure Python implementation.
  • bpo-29703: Fix asyncio to support instantiation of new event loops in child processes.
  • bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other exception) to exception(s) raised in the dispatched methods. Patch by Petr Motejlek.
  • bpo-7769: Method register_function() of xmlrpc.server.SimpleXMLRPCDispatcher and its subclasses can now be used as a decorator.
  • bpo-29376: Fix assertion error in threading._DummyThread.is_alive().
  • bpo-28624: Add a test that checks that cwd parameter of Popen() accepts PathLike objects. Patch by Sayan Chowdhury.
  • bpo-28518: Start a transaction implicitly before a DML statement. Patch by Aviv Palivoda.
  • bpo-29742: get_extra_info() raises exception if get called on closed ssl transport. Patch by Nikolay Kim.
  • bpo-16285: urrlib.parse.quote is now based on RFC 3986 and hence includes ‘~’ in the set of characters that is not quoted by default. Patch by Christian Theune and Ratnadeep Debnath.
  • bpo-29532: Altering a kwarg dictionary passed to functools.partial() no longer affects a partial object after creation.
  • bpo-29110: Fix file object leak in aifc.open() when file is given as a filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
  • bpo-22807: Add uuid.SafeUUID and uuid.UUID.is_safe to relay information from the platform about whether generated UUIDs are generated with a multiprocessing safe method.
  • bpo-29576: Improve some deprecations in importlib. Some deprecated methods now emit DeprecationWarnings and have better descriptive messages.
  • bpo-29534: Fixed different behaviour of Decimal.from_float() for _decimal and _pydecimal. Thanks Andrew Nester.
  • bpo-10379: locale.format_string now supports the ‘monetary’ keyword argument, and locale.format is deprecated.
  • bpo-29851: importlib.reload() now raises ModuleNotFoundError if the module lacks a spec.
  • bpo-28556: Various updates to typing module: typing.Counter, typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Lukasz Langa.
  • bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python 3.6.0: check minimum and maximum years.
  • bpo-29416: Prevent infinite loop in pathlib.Path.mkdir
  • bpo-29444: Fixed out-of-bounds buffer access in the group() method of the match object. Based on patch by WGH.
  • bpo-29377: Add WrapperDescriptorType, MethodWrapperType, and MethodDescriptorType built-in types to types module. Original patch by Manuel Krebber.
  • bpo-29218: Unused install_misc command is now removed. It has been documented as unused since 2000. Patch by Eric N. Vander Weele.
  • bpo-29368: The extend() method is now called instead of the append() method when unpickle collections.deque and other list-like objects. This can speed up unpickling to 2 times.
  • bpo-29338: The help of a builtin or extension class now includes the constructor signature if __text_signature__ is provided for the class.
  • bpo-29335: Fix subprocess.Popen.wait() when the child process has exited to a stopped instead of terminated state (ex: when under ptrace).
  • bpo-29290: Fix a regression in argparse that help messages would wrap at non-breaking spaces.
  • bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY.
  • bpo-29197: Removed deprecated function ntpath.splitunc().
  • bpo-29210: Removed support of deprecated argument “exclude” in tarfile.TarFile.add().
  • bpo-29219: Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances.
  • bpo-29192: Removed deprecated features in the http.cookies module.
  • bpo-29193: A format string argument for string.Formatter.format() is now positional- only.
  • bpo-29195: Removed support of deprecated undocumented keyword arguments in methods of regular expression objects.
  • bpo-28969: Fixed race condition in C implementation of functools.lru_cache. KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
  • bpo-20804: The unittest.mock.sentinel attributes now preserve their identity when they are copied or pickled.
  • bpo-29142: In urllib.request, suffixes in no_proxy environment variable with leading dots could match related hostnames again (e.g. .b.c matches a.b.c). Patch by Milan Oberkirch.
  • bpo-28961: Fix unittest.mock._Call helper: don’t ignore the name parameter anymore. Patch written by Jiajun Huang.
  • bpo-15812: inspect.getframeinfo() now correctly shows the first line of a context. Patch by Sam Breese.
  • bpo-28985: Update authorizer constants in sqlite3 module. Patch by Dingyuan Wang.
  • bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows
  • bpo-13051: Fixed recursion errors in large or resized curses.textpad.Textbox. Based on patch by Tycho Andersen.
  • bpo-9770: curses.ascii predicates now work correctly with negative integers.
  • bpo-28427: old keys should not remove new values from WeakValueDictionary when collecting from another thread.
  • bpo-28923: Remove editor artifacts from Tix.py.
  • bpo-28871: Fixed a crash when deallocate deep ElementTree.
  • bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and WeakValueDictionary.pop() when a GC collection happens in another thread.
  • bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence that doesn’t own its elements as limits.
  • bpo-16255: subprocess.Popen uses /system/bin/sh on Android as the shell, instead of /bin/sh.
  • bpo-28779: multiprocessing.set_forkserver_preload() would crash the forkserver process if a preloaded module instantiated some multiprocessing objects such as locks.
  • bpo-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.
  • bpo-28847: dbm.dumb now supports reading read-only files and no longer writes the index file when it is not changed. A deprecation warning is now emitted if the index file is missed and recreated in the ‘r’ and ‘w’ modes (will be an error in future Python releases).
  • bpo-27030: Unknown escapes consisting of '' and an ASCII letter in re.sub() replacement templates regular expressions now are errors.
  • bpo-28835: Fix a regression introduced in warnings.catch_warnings(): call warnings.showwarning() if it was overridden inside the context manager.
  • bpo-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.
  • bpo-28740: Add sys.getandroidapilevel(): return the build time API version of Android as an integer. Function only available on Android.
  • bpo-26273: Add new socket.TCP_CONGESTION (Linux 2.6.13) and socket.TCP_USER_TIMEOUT (Linux 2.6.37) constants. Patch written by Omar Sandoval.
  • bpo-28752: Restored the __reduce__() methods of datetime objects.
  • bpo-28727: Regular expression patterns, _sre.SRE_Pattern objects created by re.compile(), become comparable (only x==y and x!=y operators). This change should fix the bpo-18383: don’t duplicate warning filters when the warnings module is reloaded (thing usually only done in unit tests).
  • bpo-20572: Remove the subprocess.Popen.wait endtime parameter. It was deprecated in 3.4 and undocumented prior to that.
  • bpo-25659: In ctypes, prevent a crash calling the from_buffer() and from_buffer_copy() methods on abstract classes like Array.
  • bpo-28548: In the “http.server” module, parse the protocol version if possible, to avoid using HTTP 0.9 in some error responses.
  • bpo-19717: Makes Path.resolve() succeed on paths that do not exist. Patch by Vajrasky Kok
  • bpo-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.
  • bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the garbage collector is invoked in other thread. Based on patch by Sebastian Cufre.
  • bpo-27517: LZMA compressor and decompressor no longer raise exceptions if given empty data twice. Patch by Benjamin Fogle.
  • bpo-28549: Fixed segfault in curses’s addch() with ncurses6.
  • bpo-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.
  • bpo-23262: The webbrowser module now supports Firefox 36+ and derived browsers. Based on patch by Oleg Broytman.
  • bpo-24241: The webbrowser in an X environment now prefers using the default browser directly. Also, the webbrowser register() function now has a documented ‘preferred’ argument, to specify browsers to be returned by get() with no arguments. Patch by David Steele
  • bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused by representing the scale as float value internally in Tk. tkinter.IntVar now works if float value is set to underlying Tk variable.
  • bpo-28255: calendar.TextCalendar.prweek() no longer prints a space after a weeks’s calendar. calendar.TextCalendar.pryear() no longer prints redundant newline after a year’s calendar. Based on patch by Xiang Zhang.
  • bpo-28255: calendar.TextCalendar.prmonth() no longer prints a space at the start of new line after printing a month’s calendar. Patch by Xiang Zhang.
  • bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces. Based on patch by Kaarle Ritvanen.
  • bpo-28353: os.fwalk() no longer fails on broken links.
  • bpo-28430: Fix iterator of C implemented asyncio.Future doesn’t accept non-None value is passed to it.send(val).
  • bpo-27025: Generated names for Tkinter widgets now start by the “!” prefix for readability.
  • bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a workaround to Tix library bug.
  • bpo-28488: shutil.make_archive() no longer adds entry “./” to ZIP archive.
  • bpo-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.
  • bpo-28469: timeit now uses the sequence 1, 2, 5, 10, 20, 50,… instead of 1, 10, 100,… for autoranging.
  • bpo-28115: Command-line interface of the zipfile module now uses argparse. Added support of long options.
  • bpo-18219: Optimize csv.DictWriter for large number of columns. Patch by Mariatta Wijaya.
  • bpo-28448: Fix C implemented asyncio.Future didn’t work on Windows.
  • bpo-23214: In the “io” module, the argument to BufferedReader and BytesIO’s read1() methods is now optional and can be -1, matching the BufferedIOBase specification.
  • bpo-28480: Fix error building socket module when multithreading is disabled.
  • bpo-28240: timeit: remove -c/--clock and -t/--time command line options which were deprecated since Python 3.3.
  • bpo-28240: timeit now repeats the benchmarks 5 times instead of only 3 to make benchmarks more reliable.
  • bpo-28240: timeit autorange now uses a single loop iteration if the benchmark takes less than 10 seconds, instead of 10 iterations. “python3 -m timeit -s ‘import time’ ‘time.sleep(1)’” now takes 4 seconds instead of 40 seconds.
  • Distutils.sdist now looks for README and setup.py files with case sensitivity. This behavior matches that found in Setuptools 6.0 and later. See setuptools 100 for rationale.
  • bpo-24452: Make webbrowser support Chrome on Mac OS X. Patch by Ned Batchelder.
  • bpo-20766: Fix references leaked by pdb in the handling of SIGINT handlers.
  • bpo-27998: Fixed bytes path support in os.scandir() on Windows. Patch by Eryk Sun.
  • bpo-28317: The disassembler now decodes FORMAT_VALUE argument.
  • bpo-28380: unittest.mock Mock autospec functions now properly support assert_called, assert_not_called, and assert_called_once.
  • bpo-28229: lzma module now supports pathlib.
  • bpo-28321: Fixed writing non-BMP characters with binary format in plistlib.
  • bpo-28225: bz2 module now supports pathlib. Initial patch by Ethan Furman.
  • bpo-28227: gzip now supports pathlib. Patch by Ethan Furman.
  • bpo-28332: Deprecated silent truncations in socket.htons and socket.ntohs. Original patch by Oren Milman.
  • bpo-27358: Optimized merging var-keyword arguments and improved error message when passing a non-mapping as a var-keyword argument.
  • bpo-28257: Improved error message when passing a non-iterable as a var- positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
  • bpo-28322: Fixed possible crashes when unpickle itertools objects from incorrect pickle data. Based on patch by John Leitch.
  • bpo-28228: imghdr now supports pathlib.
  • bpo-28226: compileall now supports pathlib.
  • bpo-28314: Fix function declaration (C flags) for the getiterator() method of xml.etree.ElementTree.Element.
  • bpo-28148: Stop using localtime() and gmtime() in the time module.
  • Introduced platform independent _PyTime_localtime API that is similar to POSIX localtime_r, but available on all platforms. Patch by Ed Schouten.
  • bpo-28253: Fixed calendar functions for extreme months: 0001-01 and 9999-12.
  • Methods itermonthdays() and itermonthdays2() are reimplemented so that they don’t call itermonthdates() which can cause datetime.date under/overflow.
  • bpo-28275: Fixed possible use after free in the decompress() methods of the LZMADecompressor and BZ2Decompressor classes. Original patch by John Leitch.
  • bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation() if pass invalid string-like object as a name. Patch by Xiang Zhang.
  • bpo-18844: random.choices() now has k as a keyword-only argument to improve the readability of common cases and come into line with the signature used in other languages.
  • bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py. Patch by Madison May.
  • bpo-27611: Fixed support of default root window in the tkinter.tix module. Added the master parameter in the DisplayStyle constructor.
  • bpo-27348: In the traceback module, restore the formatting of exception messages like “Exception: None”. This fixes a regression introduced in 3.5a2.
  • bpo-25651: Allow falsy values to be used for msg parameter of subTest().
  • bpo-27778: Fix a memory leak in os.getrandom() when the getrandom() is interrupted by a signal and a signal handler raises a Python exception.
  • bpo-28200: Fix memory leak on Windows in the os module (fix path_converter() function).
  • bpo-25400: RobotFileParser now correctly returns default values for crawl_delay and request_rate. Initial patch by Peter Wirtz.
  • bpo-27932: Prevent memory leak in win32_ver().
  • Fix UnboundLocalError in socket._sendfile_use_sendfile.
  • bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of os.stat(). Patch by Eryk Sun.
  • bpo-22493: Warning message emitted by using inline flags in the middle of regular expression now contains a (truncated) regex pattern. Patch by Tim Graham.
  • bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an empty bytestring is passed.
  • bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam.
  • bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by Gergely Imreh and Markus Holtermann.
  • bpo-28114: Fix a crash in parse_envlist() when env contains byte strings. Patch by Eryk Sun.
  • bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
  • bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by Kevin Conway.
  • bpo-28174: Handle when SO_REUSEPORT isn’t properly supported. Patch by Seth Michael Larson.
  • bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by iceboy.
  • bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki.
  • bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.
  • bpo-27759: Fix selectors incorrectly retain invalid file descriptors. Patch by Mark Williams.
  • bpo-28325: Remove vestigial MacOS 9 macurl2path module and its tests.
  • bpo-28368: Refuse monitoring processes if the child watcher has no loop attached. Patch by Vincent Michel.
  • bpo-28369: Raise RuntimeError when transport’s FD is used with add_reader, add_writer, etc.
  • bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by ????????? ????.
  • bpo-28371: Deprecate passing asyncio.Handles to run_in_executor.
  • bpo-28372: Fix asyncio to support formatting of non-python coroutines.
  • bpo-28399: Remove UNIX socket from FS before binding. Patch by ????????? ????.
  • bpo-27972: Prohibit Tasks to await on themselves.
  • bpo-24142: Reading a corrupt config file left configparser in an invalid state. Original patch by Florian Höch.
  • bpo-29581: ABCMeta.__new__ now accepts **kwargs, allowing abstract base classes to use keyword parameters in __init_subclass__. Patch by Nate Soares.
  • bpo-25532: inspect.unwrap() will now only try to unwrap an object sys.getrecursionlimit() times, to protect against objects which create a new object on every attribute access.
  • bpo-30177: path.resolve(strict=False) no longer cuts the path after the first element not present in the filesystem. Patch by Antoine Pietri.
  • Documentation:
  • bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and ZeroMQSocketHandler examples and adapt them to Python 3.
  • bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL documentation.
  • bpo-31128: Allow the pydoc server to bind to arbitrary hostnames.
  • bpo-30803: Clarify doc on truth value testing. Original patch by Peter Thomassen.
  • bpo-30176: Add missing attribute related constants in curses documentation.
  • bpo-30052: the link targets for bytes() and bytearray() are now their respective type definitions, rather than the corresponding builtin function entries. Use bytes and bytearray to reference the latter.
  • In order to ensure this and future cross-reference updates are applied automatically, the daily documentation builds now disable the default output caching features in Sphinx.
  • bpo-26985: Add missing info of code object in inspect documentation.
  • bpo-19824: Improve the documentation for, and links to, template strings by emphasizing their utility for internationalization, and by clarifying some usage constraints. (See also: bpo-20314, bpo-12518)
  • bpo-28929: Link the documentation to its source file on GitHub.
  • bpo-25008: Document smtpd.py as effectively deprecated and add a pointer to aiosmtpd, a third-party asyncio-based replacement.
  • bpo-26355: Add canonical header link on each page to corresponding major version of the documentation. Patch by Matthias Bussonnier.
  • bpo-29349: Fix Python 2 syntax in code for building the documentation.
  • bpo-23722: The data model reference and the porting section in the 3.6 What’s New guide now cover the additional __classcell__ handling needed for custom metaclasses to fully support PEP 487 and zero-argument super().
  • bpo-28513: Documented command-line interface of zipfile.
  • Tests:
  • bpo-29639: test.support.HOST is now “localhost”, a new HOSTv4 constant has been added for your 127.0.0.1 needs, similar to the existing HOSTv6 constant.
  • bpo-31320: Silence traceback in test_ssl
  • bpo-31346: Prefer PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER protocols for SSLContext.
  • bpo-25674: Remove sha256.tbs-internet.com ssl test
  • bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest version behaves like OpenSSL 1.0.2 and no longer aborts handshake.
  • bpo-30822: regrtest: Exclude tzdata from regrtest –all. When running the test suite using –use=all / -u all, exclude tzdata since it makes test_datetime too slow (15-20 min on some buildbots) which then times out on some buildbots. Fix also regrtest command line parser to allow passing -u extralargefile to run test_zipfile64.
  • bpo-30695: Add the set_nomemory(start, stop) and remove_mem_hooks() functions to the _testcapi module.
  • bpo-30357: test_thread: setUp() now uses support.threading_setup() and support.threading_cleanup() to wait until threads complete to avoid random side effects on following tests. Initial patch written by Grzegorz Grzywacz.
  • bpo-30197: Enhanced functions swap_attr() and swap_item() in the test.support module. They now work when delete replaced attribute or item inside the with statement. The old value of the attribute or item (or None if it doesn’t exist) now will be assigned to the target of the “as” clause, if there is one.
  • bpo-24932: Use proper command line parsing in _testembed
  • bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line arguments.
  • bpo-28683: Fix the tests that bind

New in Python 3.6.3 RC 1 (Sep 20, 2017)

  • Security:
  • bpo-29781: SSLObject.version() now correctly returns None when handshake over BIO has not been performed yet.
  • bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to get security fixes.
  • Core and Builtins:
  • bpo-31471: Fix an assertion failure in subprocess.Popen() on Windows, in case the env argument has a bad keys() method. Patch by Oren Milman.
  • bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case of an exception with a bad __module__ attribute. Patch by Oren Milman.
  • bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. Patch by Oren Milman.
  • bpo-31411: Raise a TypeError instead of SystemError in case warnings.onceregistry is not a dictionary. Patch by Oren Milman.
  • bpo-31373: Fix several possible instances of undefined behavior due to floating-point demotions.
  • bpo-30465: Location information (lineno and col_offset) in f-strings is now (mostly) correct. This fixes tools like flake8 from showing warnings on the wrong line (typically the first line of the file).
  • bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev(). GNU C libray plans to remove the functions from sys/types.h.
  • bpo-31291: Fix an assertion failure in zipimport.zipimporter.get_data on Windows, when the return value of pathname.replace('/','\') isn’t a string. Patch by Oren Milman.
  • bpo-31271: Fix an assertion failure in the write() method of io.TextIOWrapper, when the encoder doesn’t return a bytes object. Patch by Oren Milman.
  • bpo-31243: Fix a crash in some methods of io.TextIOWrapper, when the decoder’s state is invalid. Patch by Oren Milman.
  • bpo-30721: print now shows correct usage hint for using Python 2 redirection syntax. Patch by Sanyam Khurana.
  • bpo-31070: Fix a race condition in importlib _get_module_lock().
  • bpo-31095: Fix potential crash during GC caused by tp_dealloc which doesn’t call PyObject_GC_UnTrack().
  • bpo-31071: Avoid masking original TypeError in call with * unpacking when other arguments are passed.
  • bpo-30978: str.format_map() now passes key lookup exceptions through. Previously any exception was replaced with a KeyError exception.
  • bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state.
  • bpo-30876: Relative import from unloaded package now reimports the package instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError.
  • bpo-30703: Improve signal delivery.
  • Avoid using Py_AddPendingCall from signal handler, to avoid calling signal- unsafe functions. The tests I’m adding here fail without the rest of the patch, on Linux and OS X. This means our signal delivery logic had defects (some signals could be lost).
  • bpo-30765: Avoid blocking in pthread_mutex_lock() when PyThread_acquire_lock() is asked not to block.
  • bpo-31161: Make sure the ‘Missing parentheses’ syntax error message is only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters.
  • bpo-30814: Fixed a race condition when import a submodule from a package.
  • bpo-30597: print now shows expected input in custom error message when used as a Python 2 statement. Patch by Sanyam Khurana.
  • Library:
  • bpo-31499: xml.etree: Fix a crash when a parser is part of a reference cycle.
  • bpo-28556: typing.get_type_hints now finds the right globalns for classes and modules by default (when no globalns was specified by the caller).
  • bpo-28556: Speed improvements to the typing module. Original PRs by Ivan Levkivskyi and Mitar.
  • bpo-31544: The C accelerator module of ElementTree ignored exceptions raised when looking up TreeBuilder target methods in XMLParser().
  • bpo-31234: socket.create_connection() now fixes manually a reference cycle: clear the variable storing the last exception on success.
  • bpo-31457: LoggerAdapter objects can now be nested.
  • bpo-31400: Improves SSL error handling to avoid losing error numbers.
  • bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a context cannot be instantiated.
  • bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of data. This fixes support for all bytes-like object. It is also more efficient and avoids costly copies.
  • bpo-31178: Fix string concatenation bug in rare error path in the subprocess module
  • bpo-31350: Micro-optimize asyncio._get_running_loop() to become up to 10% faster.
  • bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of partial characters for UTF-8 input (libexpat bug 115): https://github.com/libexpat/libexpat/issues/115
  • bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3.
  • bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to have a non repr() based thread name by default when no thread_name_prefix is supplied. They will now identify themselves as “ThreadPoolExecutor- y_n”.
  • bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash functions such as md5 are not available in the linked OpenSSL library. As in some special FIPS-140 build environments.
  • bpo-27144: The map() and as_completed() iterators in concurrent.futures now avoid keeping a reference to yielded objects.
  • bpo-10746: Fix ctypes producing wrong PEP 3118 type codes for integer types.
  • bpo-22536: The subprocess module now sets the filename when FileNotFoundError is raised on POSIX systems due to the executable or cwd not being found.
  • bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor now breaks a reference cycle between an exception object and the WorkItem object.
  • bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using sys.exc_info() in code handling exceptions.
  • bpo-30102: The ssl and hashlib modules now call OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function detects CPU features and enables optimizations on some CPU architectures such as POWER8. Patch is based on research from Gustavo Serra Scalet.
  • bpo-31185: Fixed miscellaneous errors in asyncio speedup module.
  • bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu classes. Call the parent destroy() method even if the used attribute doesn’t exist. The LabeledScale.destroy() method now also explicitly clears label and scale attributes to help the garbage collector to destroy all widgets.
  • bpo-31107: Fix copyreg._slotnames() mangled attribute calculation for classes whose name begins with an underscore. Patch by Shane Harvey.
  • bpo-31061: Fixed a crash when using asyncio and threads.
  • bpo-30502: Fix handling of long oids in ssl. Based on patch by Christian Heimes.
  • bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that contains CR or LF. Patch by Dong-hee Na.
  • bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader in non- blocking mode if it succeeded to aquire the lock but the acquire took longer than the timeout.
  • bpo-29403: Fix unittest.mock’s autospec to not fail on method-bound builtin functions. Patch by Aaron Gallagher.
  • bpo-30961: Fix decrementing a borrowed reference in tracemalloc.
  • bpo-25684: Change ttk.OptionMenu radiobuttons to be unique across instances of OptionMenu.
  • bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the thread completes, even if the thread was started by the same process which created the queue.
  • bpo-29854: Fix segfault in readline when using readline’s history-size option. Patch by Nir Soffer.
  • bpo-30319: socket.close() now ignores ECONNRESET error.
  • bpo-30828: Fix out of bounds write in asyncio.CFuture.remove_done_callback().
  • bpo-30807: signal.setitimer() may disable the timer when passed a tiny value.
  • Tiny values (such as 1e-6) are valid non-zero values for setitimer(), which is specified as taking microsecond-resolution intervals. However, on some platform, our conversion routine could convert 1e-6 into a zero interval, therefore disabling the timer instead of (re-)scheduling it.
  • bpo-30441: Fix bug when modifying os.environ while iterating over it
  • bpo-30532: Fix email header value parser dropping folding white space in certain cases.
  • bpo-30879: os.listdir() and os.scandir() now emit bytes names when called with bytes- like argument.
  • bpo-30746: Prohibited the ‘=’ character in environment variable names in os.putenv() and os.spawn*().
  • bpo-29755: Fixed the lgettext() family of functions in the gettext module. They now always return bytes.
  • Documentation:
  • bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and ZeroMQSocketHandler examples and adapt them to Python 3.
  • bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL documentation.
  • bpo-30803: Clarify doc on truth value testing. Original patch by Peter Thomassen.
  • Tests:
  • bpo-31320: Silence traceback in test_ssl
  • bpo-25674: Remove sha256.tbs-internet.com ssl test
  • bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest version behaves like OpenSSL 1.0.2 and no longer aborts handshake.
  • bpo-30822: regrtest: Exclude tzdata from regrtest –all. When running the test suite using –use=all / -u all, exclude tzdata since it makes test_datetime too slow (15-20 min on some buildbots) which then times out on some buildbots. Fix also regrtest command line parser to allow passing -u extralargefile to run test_zipfile64.
  • Build:
  • bpo-30854: Fix compile error when compiling –without-threads. Patch by Masayuki Yamamoto.
  • Windows:
  • bpo-30389: Adds detection of Visual Studio 2017 to distutils on Windows.
  • bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017)
  • bpo-30581: os.cpu_count() now returns the correct number of processors on Windows when the number of logical processors is greater than 64.
  • bpo-30731: Add a missing xmlns to python.manifest so that it matches the schema.
  • IDLE:
  • bpo-31493: IDLE code context – fix code update and font update timers.
  • Canceling timers prevents a warning message when test_idle completes.
  • bpo-31488: IDLE - Update non-key options in former extension classes. When applying configdialog changes, call .reload for each feature class. Change ParenMatch so updated options affect existing instances attached to existing editor windows.
  • bpo-31477: IDLE - Improve rstrip entry in doc. Strip trailing whitespace strips more than blank spaces. Multiline string literals are not skipped.
  • bpo-31480: IDLE - make tests pass with zzdummy extension disabled by default.
  • bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live
  • interaction and experimentatin with tkinter applications much easier.
  • bpo-31414: IDLE – fix tk entry box tests by deleting first. Adding to an int entry is not the same as deleting and inserting because int(”) will fail.
  • bpo-31051: Rearrange IDLE condigdialog GenPage into Window, Editor, and Help sections.
  • bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor.
  • Move some data and functions from the class to module level. Patch by Cheryl Sabella.
  • bpo-31287: IDLE - Do not modify tkinter.message in test_configdialog.
  • bpo-27099: Convert IDLE’s built-in ‘extensions’ to regular features.
  • About 10 IDLE features were implemented as supposedly optional extensions. Their different behavior could be confusing or worse for users and not good for maintenance. Hence the conversion.
  • The main difference for users is that user configurable key bindings for builtin features are now handled uniformly. Now, editing a binding in a keyset only affects its value in the keyset. All bindings are defined together in the system-specific default keysets in config- extensions.def. All custom keysets are saved as a whole in config- extension.cfg. All take effect as soon as one clicks Apply or Ok.
  • The affected events are ‘<<force-open-completions>>’, ‘<<expand-word>>’, ‘<<force-open-calltip>>’, ‘<<flash-paren>>’, ‘<<format-paragraph>>’, ‘<<run- module>>’, ‘<<check-module>>’, and ‘<<zoom-height>>’. Any (global) customizations made before 3.6.3 will not affect their keyset- specific customization after 3.6.3. and vice versa.
  • Inital patch by Charles Wohlganger.
  • bpo-31206: IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by Cheryl Sabella.
  • bpo-31001: Add tests for configdialog highlight tab. Patch by Cheryl Sabella.
  • bpo-31205: IDLE: Factor KeysPage(Frame) class from ConfigDialog. The slightly modified tests continue to pass. Patch by Cheryl Sabella.
  • bpo-31130: IDLE – stop leaks in test_configdialog. Initial patch by Victor Stinner.
  • bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella.
  • bpo-19903: IDLE: Calltips use inspect.signature instead of inspect.getfullargspec. This improves calltips for builtins converted to use Argument Clinic. Patch by Louie Lu.
  • bpo-31083: IDLE - Add an outline of a TabPage class in configdialog. Update existing classes to match outline. Initial patch by Cheryl Sabella.
  • bpo-31050: Factor GenPage(Frame) class from ConfigDialog. The slightly modified tests continue to pass. Patch by Cheryl Sabella.
  • bpo-31004: IDLE - Factor FontPage(Frame) class from ConfigDialog.
  • Slightly modified tests continue to pass. Fix General tests. Patch mostly by Cheryl Sabella.
  • bpo-30781: IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan Reedy and Cheryl Sabella.
  • bpo-31060: IDLE - Finish rearranging methods of ConfigDialog Grouping methods pertaining to each tab and the buttons will aid writing tests and improving the tabs and will enable splitting the groups into classes.
  • bpo-30853: IDLE – Factor a VarTrace class out of ConfigDialog.
  • Instance tracers manages pairs consisting of a tk variable and a callback function. When tracing is turned on, setting the variable calls the function. Test coverage for the new class is 100%.
  • bpo-31003: IDLE: Add more tests for General tab.
  • bpo-30993: IDLE - Improve configdialog font page and tests.
  • In configdialog: Document causal pathways in create_font_tab docstring. Simplify some attribute names. Move set_samples calls to var_changed_font (idea from Cheryl Sabella). Move related functions to positions after the create widgets function.
  • In test_configdialog: Fix test_font_set so not order dependent. Fix renamed test_indent_scale so it tests the widget. Adjust tests for movement of set_samples call. Add tests for load functions. Put all font tests in one class and tab indent tests in another. Except for two lines, these tests completely cover the related functions.
  • bpo-30981: IDLE – Add more configdialog font page tests.
  • bpo-28523: IDLE: replace ‘colour’ with ‘color’ in configdialog.
  • bpo-30917: Add tests for idlelib.config.IdleConf. Increase coverage from 46% to 96%. Patch by Louie Lu.
  • bpo-30934: Document coverage details for idlelib tests.
  • Add section to idlelib/idle-test/README.txt.
  • Include check that branches are taken both ways.
  • Exclude IDLE-specific code that does not run during unit tests.
  • bpo-30913: IDLE: Document ConfigDialog tk Vars, methods, and widgets in docstrings This will facilitate improving the dialog and splitting up the class. Original patch by Cheryl Sabella.
  • bpo-30899: IDLE: Add tests for ConfigParser subclasses in config. Patch by Louie Lu.
  • bpo-30881: IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella.
  • bpo-30851: IDLE: Remove unused variables in configdialog. One is a duplicate, one is set but cannot be altered by users. Patch by Cheryl Sabella.
  • bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as well as mouse. Initial patch by Louie Lu.
  • bpo-8231: IDLE: call config.IdleConf.GetUserCfgDir only once.
  • bpo-30779: IDLE: Factor ConfigChanges class from configdialog, put in config; test. * In config, put dump test code in a function; run it and unittest in ‘if __name__ == ‘__main__’. * Add class config.ConfigChanges based on changes_class_v4.py on bpo issue. * Add class test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise configdialog to use ConfigChanges; see tracker msg297804. * Revise test_configdialog to match configdialog changes. * Remove configdialog functions unused or moved to ConfigChanges. Cheryl Sabella contributed parts of the patch.
  • bpo-30777: IDLE: configdialog - Add docstrings and fix comments. Patch by Cheryl Sabella.
  • bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more tests. Patch by Cheryl Sabella.
  • bpo-30723: IDLE: Make several improvements to parenmatch. Add ‘parens’ style to highlight both opener and closer. Make ‘default’ style, which is not default, a synonym for ‘opener’. Make time-delay work the same with all styles. Add help for config dialog extensions tab, including help for parenmatch. Add new tests. Original patch by Charles Wohlganger.
  • bpo-30674: IDLE: add docstrings to grep module. Patch by Cheryl Sabella
  • bpo-21519: IDLE’s basic custom key entry dialog now detects duplicates properly. Original patch by Saimadhav Heblikar.
  • bpo-29910: IDLE no longer deletes a character after commenting out a region by a key shortcut. Add return 'break' for this and other potential conflicts between IDLE and default key bindings.
  • bpo-30728: Review and change idlelib.configdialog names. Lowercase method and attribute names. Replace ‘colour’ with ‘color’, expand overly cryptic names, delete unneeded underscores. Replace import * with specific imports. Patches by Cheryl Sabella.
  • bpo-6739: IDLE: Verify user-entered key sequences by trying to bind them with tk. Add tests for all 3 validation functions. Original patch by G Polo. Tests added by Cheryl Sabella.
  • Tools/Demos:
  • bpo-30983: gdb integration commands (py-bt, etc.) work on optimized shared builds now, too. PEP 523 introduced _PyEval_EvalFrameDefault which inlines PyEval_EvalFrameEx on non-debug shared builds. This broke the ability to use py-bt, py-up, and a few other Python-specific gdb integrations. The problem is fixed by only looking for _PyEval_EvalFrameDefault frames in python-gdb.py. Original patch by Bruno “Polaco” Penteado.

New in Python 3.6.2 (Jul 17, 2017)

  • No changes since 3.6.2 RC2

New in Python 3.6.2 RC2 (Jul 17, 2017)

  • Library:
  • [Security] bpo-30730: Prevent environment variables injection in subprocess on Windows. Prevent passing other environment variables and command arguments.
  • [Security] bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple security vulnerabilities including: CVE-2017-9233 (External entity infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix), CVE-2016-0718 (Fix regression bugs from 2.2.0’s fix to CVE-2016-0718) and CVE-2012-0876 (Counter hash flooding with SipHash). Note: the CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn’t impact Python, since Python already gets entropy from the OS to set the expat secret using XML_SetHashSalt().
  • [Security] bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For example, splithost('//127.0.0.1#@evil.com/') now correctly returns the 127.0.0.1 host, instead of treating @evil.com as the host in an authentification (login@host).

New in Python 3.6.2 RC1 (Jul 17, 2017)

  • Core and Builtins:
  • bpo-30682: Removed a too-strict assertion that failed for certain f-strings, such as eval(“f’n’”) and eval(“f’r’”).
  • bpo-30604: Move co_extra_freefuncs to not be per-thread to avoid crashes
  • bpo-29104: Fixed parsing backslashes in f-strings.
  • bpo-27945: Fixed various segfaults with dict when input collections are mutated during searching, inserting or comparing. Based on patches by Duane Griffin and Tim Mitchell.
  • bpo-25794: Fixed type.__setattr__() and type.__delattr__() for non-interned attribute names. Based on patch by Eryk Sun.
  • bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the middle of resuming a chain of nested ‘yield from’ or ‘await’ calls, it’s now correctly delivered to the innermost frame.
  • bpo-12414: sys.getsizeof() on a code object now returns the sizes which includes the code struct and sizes of objects which it references. Patch by Dong-hee Na.
  • bpo-29949: Fix memory usage regression of set and frozenset object.
  • bpo-29935: Fixed error messages in the index() method of tuple, list and deque when pass indices of wrong type.
  • bpo-29859: Show correct error messages when any of the pthread_* calls in thread_pthread.h fails.
  • bpo-28876: bool(range) works even if len(range) raises OverflowError.
  • bpo-29600: Fix wrapping coroutine return values in StopIteration.
  • bpo-28856: Fix an oversight that %b format for bytes should support objects follow the buffer protocol.
  • bpo-29714: Fix a regression that bytes format may fail when containing zero bytes inside.
  • bpo-29478: If max_line_length=None is specified while using the Compat32 policy, it is no longer ignored. Patch by Mircea Cosbuc.
  • Library:
  • bpo-30616: Functional API of enum allows to create empty enums. Patched by Dong-hee Na
  • bpo-30038: Fix race condition between signal delivery and wakeup file descriptor. Patch by Nathaniel Smith.
  • bpo-23894: lib2to3 now recognizes rb'...' and f'...' strings.
  • bpo-23890: unittest.TestCase.assertRaises() now manually breaks a reference cycle to not keep objects alive longer than expected.
  • bpo-30149: inspect.signature() now supports callables with variable-argument parameters wrapped with partialmethod. Patch by Dong-hee Na.
  • bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases when a package is only shipped with bytecodes. Patch by Alexandru Ardelean.
  • bpo-29931: Fixed comparison check for ipaddress.ip_interface objects. Patch by Sanjay Sundaresan.
  • bpo-30605: re.compile() no longer raises a BytesWarning when compiling a bytes instance with misplaced inline modifier. Patch by Roy Williams.
  • [Security] bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of CVE-2016-0718 and CVE-2016-4472. See https://sourceforge.net/p/expat/bugs/537/ for more information.
  • bpo-24484: Avoid race condition in multiprocessing cleanup (#2159)
  • bpo-28994: The traceback no longer displayed for SystemExit raised in a callback registered by atexit.
  • bpo-30508: Don’t log exceptions if Task/Future “cancel()” method was called.
  • bpo-28556: Updates to typing module: Add generic AsyncContextManager, add support for ContextManager on all versions. Original PRs by Jelle Zijlstra and Ivan Levkivskyi
  • bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl implementation. Patch by Michaël Sghaïer.
  • bpo-29743: Closing transport during handshake process leaks open socket. Patch by Nikolay Kim
  • bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu Sornay.
  • bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore EINVAL on stdin.write() if the child process is still running but closed the pipe.
  • bpo-29822: inspect.isabstract() now works during __init_subclass__. Patch by Nate Soares.
  • bpo-29581: ABCMeta.__new__ now accepts **kwargs, allowing abstract base classes to use keyword parameters in __init_subclass__. Patch by Nate Soares.
  • bpo-30557: faulthandler now correctly filters and displays exception codes on Windows
  • bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot handle IPv6 addresses.
  • bpo-29960: Preserve generator state when _random.Random.setstate() raises an exception. Patch by Bryan Olson.
  • bpo-30414: multiprocessing.Queue._feed background running thread do not break from main loop on exception.
  • bpo-30003: Fix handling escape characters in HZ codec. Based on patch by Ma Lin.
  • bpo-30301: Fix AttributeError when using SimpleQueue.empty() under spawn and forkserver start methods.
  • bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted. This error occurs sometimes on SSL connections.
  • bpo-30375: Warnings emitted when compile a regular expression now always point to the line in the user code. Previously they could point into inners of the re module if emitted from inside of groups or conditionals.
  • bpo-30048: Fixed Task.cancel() can be ignored when the task is running coroutine and the coroutine returned without any more await.
  • bpo-30266: contextlib.AbstractContextManager now supports anti-registration by setting __enter__ = None or __exit__ = None, following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra.
  • bpo-30298: Weaken the condition of deprecation warnings for inline modifiers. Now allowed several subsequential inline modifiers at the start of the pattern (e.g. '(?i)(?s)...'). In verbose mode whitespaces and comments now are allowed before and between inline modifiers (e.g. '(?x) (?i) (?s)...').
  • bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma Lin.
  • Revert bpo-26293 for zipfile breakage. See also bpo-29094.
  • bpo-30243: Removed the __init__ methods of _json’s scanner and encoder. Misusing them could cause memory leaks or crashes. Now scanner and encoder objects are completely initialized in the __new__ methods.
  • bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process when Ctrl-C is received.
  • bpo-28556: Various updates to typing module: add typing.NoReturn type, use WrapperDescriptorType, minor bug-fixes. Original PRs by Jim Fasarakis-Hilliard and Ivan Levkivskyi.
  • bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux.
  • bpo-30070: Fixed leaks and crashes in errors handling in the parser module.
  • bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when readline() or __next__() respectively return non-sizeable object. Fixed possible other errors caused by not checking results of PyObject_Size(), PySequence_Size(), or PyMapping_Size().
  • bpo-30017: Allowed calling the close() method of the zip entry writer object multiple times. Writing to a closed writer now always produces a ValueError.
  • bpo-30068: _io._IOBase.readlines will check if it’s closed first when hint is present.
  • bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True. Patch by Armin Rigo.
  • bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in contextlib.contextmanager. Patch by Siddharth Velankar.
  • bpo-29998: Pickling and copying ImportError now preserves name and path attributes.
  • bpo-29953: Fixed memory leaks in the replace() method of datetime and time objects when pass out of bound fold argument.
  • bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering long runs of empty iterables.
  • bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions and wrong types.
  • bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an exception at the very first of an iterable may swallow the exception or make the program hang. Patch by Davin Potts and Xiang Zhang.
  • bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when the OS gives priority to errors such as EACCES over EEXIST.
  • bpo-29861: Release references to tasks, their arguments and their results as soon as they are finished in multiprocessing.Pool.
  • bpo-29884: faulthandler: Restore the old sigaltstack during teardown. Patch by Christophe Zeitouny.
  • bpo-25455: Fixed crashes in repr of recursive buffered file-like objects.
  • bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords are not strings. Patch by Michael Seifert.
  • bpo-29742: get_extra_info() raises exception if get called on closed ssl transport. Patch by Nikolay Kim.
  • bpo-8256: Fixed possible failing or crashing input() if attributes “encoding” or “errors” of sys.stdin or sys.stdout are not set or are not strings.
  • bpo-28298: Fix a bug that prevented array ‘Q’, ‘L’ and ‘I’ from accepting big intables (objects that have __int__) as elements. Patch by Oren Milman.
  • bpo-28231: The zipfile module now accepts path-like objects for external paths.
  • bpo-26915: index() and count() methods of collections.abc.Sequence now check identity before checking equality when do comparisons.
  • bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other exception) to exception(s) raised in the dispatched methods. Patch by Petr Motejlek.
  • bpo-30177: path.resolve(strict=False) no longer cuts the path after the first element not present in the filesystem. Patch by Antoine Pietri.
  • IDLE:
  • bpo-15786: Fix several problems with IDLE’s autocompletion box. The following should now work: clicking on selection box items; using the scrollbar; selecting an item by hitting Return. Hangs on MacOSX should no longer happen. Patch by Louie Lu.
  • bpo-25514: Add doc subsubsection about IDLE failure to start. Popup no-connection message directs users to this section.
  • bpo-30642: Fix reference leaks in IDLE tests. Patches by Louie Lu and Terry Jan Reedy.
  • bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by Cheryl Sabella and Terry Jan Reedy.
  • bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to 100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy.
  • bpo-30303: Add _utest option to textview; add new tests. Increase coverage to 100%. Patches by Louie Lu and Terry Jan Reedy.
  • C API:
  • bpo-27867: Function PySlice_GetIndicesEx() no longer replaced with a macro if Py_LIMITED_API is not set.
  • Build:
  • bpo-29941: Add --with-assertions configure flag to explicitly enable C assert() checks. Defaults to off. --with-pydebug implies --with-assertions.
  • bpo-28787: Fix out-of-tree builds of Python when configured with --with--dtrace.
  • bpo-29243: Prevent unnecessary rebuilding of Python during make test, make install and some other make targets when configured with --enable-optimizations.
  • bpo-23404: Don’t regenerate generated files based on file modification time anymore: the action is now explicit. Replace make touch with make regen-all.
  • bpo-29643: Fix --enable-optimization didn’t work.
  • Documentation:
  • bpo-30176: Add missing attribute related constants in curses documentation.
  • bpo-30052: the link targets for bytes() and bytearray() are now their respective type definitions, rather than the corresponding builtin function entries. Use bytes and bytearray to reference the latter.
  • In order to ensure this and future cross-reference updates are applied automatically, the daily documentation builds now disable the default output caching features in Sphinx.
  • bpo-26985: Add missing info of code object in inspect documentation.
  • Tools/Demos:
  • bpo-29367: python-gdb.py now supports also method-wrapper (wrapperobject) objects.
  • Tests:
  • bpo-30357: test_thread: setUp() now uses support.threading_setup() and support.threading_cleanup() to wait until threads complete to avoid random side effects on following tests. Initial patch written by Grzegorz Grzywacz.
  • bpo-30197: Enhanced functions swap_attr() and swap_item() in the test.support module. They now work when delete replaced attribute or item inside the with statement. The old value of the attribute or item (or None if it doesn’t exist) now will be assigned to the target of the “as” clause, if there is one.
  • Windows:
  • bpo-30687: Locate msbuild.exe on Windows when building rather than vcvarsall.bat
  • bpo-30450: The build process on Windows no longer depends on Subversion, instead pulling external code from GitHub via a Python script. If Python 3.6 is not found on the system (via py -3.6), NuGet is used to download a copy of 32-bit Python.

New in Python 3.6.1 (Mar 22, 2017)

  • Python 3.6.1 is the first maintenance release of Python 3.6, which was initially released in 2016-12 to great interest. Three months later, we are providing the first set of bugfixes and documentation updates to 3.6.

New in Python 3.6.0 (Dec 23, 2016)

  • HIGHLIGHTS:
  • New syntax features:
  • PEP 498, formatted string literals.
  • PEP 515, underscores in numeric literals.
  • PEP 526, syntax for variable annotations.
  • PEP 525, asynchronous generators.
  • PEP 530: asynchronous comprehensions.
  • New library modules:
  • secrets: PEP 506 – Adding A Secrets Module To The Standard Library.
  • CPython implementation improvements:
  • The dict type has been reimplemented to use a more compact representation similar to the PyPy dict implementation. This resulted in dictionaries using 20% to 25% less memory when compared to Python 3.5.
  • Customization of class creation has been simplified with the new protocol.
  • The class attribute definition order is now preserved.
  • The order of elements in **kwargs now corresponds to the order in which keyword arguments were passed to the function.
  • DTrace and SystemTap probing support has been added.
  • The new PYTHONMALLOC environment variable can now be used to debug the interpreter memory allocation and access errors.
  • Significant improvements in the standard library:
  • The asyncio module has received new features, significant usability and performance improvements, and a fair amount of bug fixes. Starting with Python 3.6 the asyncio module is no longer provisional and its API is considered stable.
  • A new file system path protocol has been implemented to support path-like objects. All standard library functions operating on paths have been updated to work with the new protocol.
  • The datetime module has gained support for Local Time Disambiguation.
  • The typing module received a number of improvements and is no longer provisional.
  • The tracemalloc module has been significantly reworked and is now used to provide better output for ResourceWarning as well as provide better diagnostics for memory allocation errors. See the PYTHONMALLOC section for more information.
  • Security improvements:
  • The new secrets module has been added to simplify the generation of cryptographically strong pseudo-random numbers suitable for managing secrets such as account authentication, tokens, and similar.
  • On Linux, os.urandom() now blocks until the system urandom entropy pool is initialized to increase the security. See the PEP 524 for the rationale.
  • The hashlib and ssl modules now support OpenSSL 1.1.0.
  • The default settings and feature set of the ssl module have been improved.
  • The hashlib module received support for the BLAKE2, SHA-3 and SHAKE hash algorithms and the scrypt() key derivation function.
  • Windows improvements::
  • PEP 528 and PEP 529, Windows filesystem and console encoding changed to UTF-8.
  • The py.exe launcher, when used interactively, no longer prefers Python 2 over Python 3 when the user doesn’t specify a version (via command line arguments or a config file). Handling of shebang lines remains unchanged - “python” refers to Python 2 in that case.
  • python.exe and pythonw.exe have been marked as long-path aware, which means that the 260 character path limit may no longer apply. See removing the MAX_PATH limitation for details.
  • A ._pth file can be added to force isolated mode and fully specify all search paths to avoid registry and environment lookup. See the documentation for more information.
  • A python36.zip file now works as a landmark to infer PYTHONHOME. See the documentation for more information.
  • Further details on this release are available at:
  • https://docs.python.org/3.6/whatsnew/3.6.html#new-features.

New in Python 3.6.0 Beta 1 (Sep 13, 2016)

  • PEP 468, Preserving the order of **kwargs in a function
  • PEP 487, Simpler customisation of class creation
  • PEP 495, Local Time Disambiguation
  • PEP 498, Literal String Formatting
  • PEP 506, Adding A Secrets Module To The Standard Library
  • PEP 509, Add a private version to dict
  • PEP 515, Underscores in Numeric Literals
  • PEP 519, Adding a file system path protocol
  • PEP 520, Preserving Class Attribute Definition Order
  • PEP 523, Adding a frame evaluation API to CPython
  • PEP 524, Make os.urandom() blocking on Linux (during system startup)
  • PEP 525, Asynchronous Generators (provisional)
  • PEP 526, Syntax for Variable Annotations (provisional)
  • PEP 528, Change Windows console encoding to UTF-8 (provisional)
  • PEP 529, Change Windows filesystem encoding to UTF-8 (provisional)
  • PEP 530, Asynchronous Comprehensions

New in Python 3.6.0 Alpha 4 (Aug 17, 2016)

  • Core and Builtins:
  • Issue #16764: Support keyword arguments to zlib.decompress(). Patch by Xiang Zhang.
  • 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 #26823: Large sections of repeated lines in tracebacks are now abbreviated as “[Previous line repeated {count} more times]” by the builtin traceback rendering. Patch by Emanuel Barry.
  • Issue #27574: Decreased an overhead of parsing keyword arguments in functions implemented with using Argument Clinic.
  • Issue #22557: Now importing already imported modules is up to 2.5 times faster.
  • Issue #17596: Include to help with Min GW building.
  • Issue #17599: On Windows, rename the privately defined REPARSE_DATA_BUFFER structure to avoid conflicting with the definition from Min GW.
  • Issue #27507: Add integer overflow check in bytearray.extend(). Patch by Xiang Zhang.
  • Issue #27581: Don’t rely on wrapping for overflow check in PySequence_Tuple(). Patch by Xiang Zhang.
  • Issue #1621: Avoid signed integer overflow in list and tuple operations. Patch by Xiang Zhang.
  • Issue #27419: Standard __import__() no longer look up “__import__” in globals or builtins for importing submodules or “from import”. Fixed a crash if raise a warning about unabling to resolve package from __spec__ or __package__.
  • Issue #27083: Respect the PYTHONCASEOK environment variable under Windows.
  • Issue #27514: Make having too many statically nested blocks a SyntaxError instead of SystemError.
  • Issue #27366: Implemented PEP 487 (Simpler customization of class creation). Upon subclassing, the __init_subclass__ classmethod is called on the base class. Descriptors are initialized with __set_name__ after class creation.
  • Library:
  • Issue #27736: Prevent segfault after interpreter re-initialization due to ref count problem introduced in code for Issue #27038 in 3.6.0a3. Patch by Xiang Zhang.
  • Issue #25628: The verbose and rename parameters for collections.namedtuple are now keyword-only.
  • Issue #12345: Add mathemathical constant tau to math and cmath. See also PEP 628.
  • Issue #26823: traceback.StackSummary.format now abbreviates large sections of repeated lines as “[Previous line repeated {count} more times]” (this change then further affects other traceback display operations in the module). Patch by Emanuel Barry.
  • Issue #27664: Add to concurrent.futures.thread.ThreadPoolExecutor() the ability to specify a thread name prefix.
  • Issue #27181: Add geometric_mean and harmonic_mean to statistics module.
  • Issue #27573: code.interact now prints an message when exiting.
  • Issue #6422: Add autorange method to timeit.Timer objects.
  • Issue #27773: Correct some memory management errors server_hostname in _ssl.wrap_socket().
  • Issue #26750: unittest.mock.create_autospec() now works properly for subclasses of property() and other data descriptors. Removes the never publicly used, never documented unittest.mock.DescriptorTypes tuple.
  • Issue #26754: Undocumented support of general bytes-like objects as path in compile() and similar functions is now deprecated.
  • Issue #26800: Undocumented support of general bytes-like objects as paths in os functions is now deprecated.
  • Issue #27661: Added tzinfo keyword argument to datetime.combine.
  • In the curses module, raise an error if window.getstr() or window.instr() is passed a negative value.
  • Issue #27783: Fix possible usage of uninitialized memory in operator.methodcaller.
  • Issue #27774: Fix possible Py_DECREF on unowned object in _sre.
  • Issue #27760: Fix possible integer overflow in binascii.b2a_qp.
  • Issue #27758: Fix possible integer overflow in the _csv module for large record lengths.
  • Issue #27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which indicates that the script is in CGI mode.
  • Issue #7063: Remove dead code from the “array” module’s slice handling. Patch by Chuck.
  • Issue #27656: Do not assume sched.h defines any SCHED_* constants.
  • Issue #27130: In the “zlib” module, fix handling of large buffers (typically 4 GiB) when compressing and decompressing. Previously, inputs were limited to 4 GiB, and compression and decompression operations did not properly handle results of 4 GiB.
  • Issue #24773: Implemented PEP 495 (Local Time Disambiguation).
  • Expose the EPOLLEXCLUSIVE constant (when it is defined) in the select module.
  • Issue #27567: Expose the EPOLLRDHUP and POLLRDHUP constants in the select module.
  • Issue #1621: Avoid signed int negation overflow in the “audioop” module.
  • Issue #27533: Release GIL in nt._isdir
  • Issue #17711: Fixed unpickling by the persistent ID with protocol 0. Original patch by Alexandre Vassalotti.
  • Issue #27522: Avoid an unintentional reference cycle in email.feedparser.
  • Issue #27512: Fix a segfault when os.fspath() called a an __fspath__() method that raised an exception. Patch by Xiang Zhang.
  • Issue #26988: Add AutoEnum.
  • Tests:
  • Issue #25805: Skip a test in test_pkgutil as needed that doesn’t work when __name__ == __main__. Patch by SilentGhost.
  • Issue #27472: Add test.support.unix_shell as the path to the default shell.
  • Issue #27369: In test_pyexpat, avoid testing an error message detail that changed in Expat 2.2.0.
  • Build:
  • Issue #25825: Correct the references to Modules/python.exp, which is required on AIX. The references were accidentally changed in 3.5.0a1.
  • Issue #27453: CPP invocation in configure must use CPPFLAGS. Patch by Chi Hsuan Yen.
  • Issue #27641: The configure script now inserts comments into the makefile to prevent the pgen and _freeze_importlib executables from being cross- compiled.
  • Issue #26662: Set PYTHON_FOR_GEN in configure as the Python program to be used for file generation during the build.
  • Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update FreedBSD version checks for the original ctype UTF-8 workaround.

New in Python 3.6.0 Alpha 3 (Jul 12, 2016)

  • Many new features for Python 3.6 are still being planned and written. Among the new major new features and changes so far:
  • PEP 498, Formatted string literals

New in Python 3.5.2 (Jun 27, 2016)

  • Core and Builtins:
  • Issue #26930: Update Windows builds to use OpenSSL 1.0.2h.
  • Tests:
  • Issue #26867: Ubuntu’s openssl OP_NO_SSLv3 is forced on by default; fix test.
  • IDLE:
  • Issue #27365: Allow non-ascii in idlelib/NEWS.txt - minimal part for 3.5.2.
  • Python 3.5.2 release candidate 1
  • Release date: 2016-06-12
  • Core and Builtins:
  • Issue #27066: Fixed SystemError if a custom opener (for open()) returns a negative number without setting an exception.
  • Issue #20041: Fixed TypeError when frame.f_trace is set to None. Patch by Xavier de Gaye.
  • 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 #23640: int.from_bytes() no longer bypasses constructors for subclasses.
  • Issue #26811: gc.get_objects() no longer contains a broken tuple with NULL pointer.
  • Issue #20120: Use RawConfigParser for .pypirc parsing, removing support for interpolation unintentionally added with move to Python 3. Behavior no longer does any interpolation in .pypirc files, matching behavior in Python 2.7 and Setuptools 19.0.
  • Issue #26659: Make the builtin slice type support cycle collection.
  • Issue #26718: super.__init__ no longer leaks memory if called multiple times. NOTE: A direct call of super.__init__ is not endorsed!
  • Issue #25339: PYTHONIOENCODING now has priority over locale in setting the error handler for stdin and stdout.
  • Issue #26494: Fixed crash on iterating exhausting iterators. Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
  • Issue #26581: If coding cookie is specified multiple times on a line in Python source code file, only the first one is taken to account.
  • 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 #22836: Ensure exception reports from PyErr_Display() and PyErr_WriteUnraisable() are sensible even when formatting them produces secondary errors. This affects the reports produced by sys.__excepthook__() and when __del__() raises an exception.
  • Issue #26302: Correct behavior to reject comma as a legal character for cookie names.
  • Issue #4806: Avoid masking the original TypeError exception when using star (*) unpacking in function calls. Based on patch by Hagen Fürstenau and Daniel Urban.
  • Issue #27138: Fix the doc comment for FileFinder.find_spec().
  • Issue #26154: Add a new private _PyThreadState_UncheckedGet() function to get the current Python thread state, but don’t issue a fatal error if it is NULL. This new function must be used instead of accessing directly the _PyThreadState_Current variable. The variable is no more exposed since Python 3.5.1 to hide the exact implementation of atomic C types, to avoid compiler issues.
  • 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 #25961: Disallowed null characters in the type name.
  • Issue #25973: Fix segfault when an invalid nonlocal statement binds a name starting with two underscores.
  • Issue #22995: Instances of extension types with a state that aren’t subclasses of list or dict and haven’t implemented any pickle-related methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or __getstate__), can no longer be pickled. Including memoryview.
  • Issue #20440: Massive replacing unsafe attribute setting code with special macro Py_SETREF.
  • Issue #25766: Special method __bytes__() now works in str subclasses.
  • 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 #27147: Mention PEP 420 in the importlib docs.
  • Issue #24097: Fixed crash in object.__reduce__() if slot name is freed inside __getattr__.
  • Issue #24731: Fixed crash on converting objects with special methods __bytes__, __trunc__, and __float__ returning instances of subclasses of bytes, int, and float to subclasses of bytes, int, and float correspondingly.
  • Issue #26478: Fix semantic bugs when using binary operators with dictionary views and tuples.
  • Issue #26171: Fix possible integer overflow and heap corruption in zipimporter.get_data().
  • Issue #25660: Fix TAB key behaviour in REPL with readline.
  • Issue #25887: Raise a RuntimeError when a coroutine object is awaited more than once.
  • Issue #27243: Update the __aiter__ protocol: instead of returning an awaitable that resolves to an asynchronous iterator, the asynchronous iterator should be returned directly. Doing the former will trigger a PendingDeprecationWarning.
  • Library:
  • Issue #26556: Update expat to 2.1.1, fixes CVE-2015-1283.
  • Fix TLS stripping vulnerability in smptlib, CVE-2016-0772. Reported by Team
  • Oststrom:
  • Issue #21386: Implement missing IPv4Address.is_global property. It was documented since 07a5610bae9d. Initial patch by Roger Luethi.
  • Issue #20900: distutils register command now decodes HTTP responses correctly.
  • Initial patch by ingrid.
  • A new version of typing.py provides several new classes and features: @overload outside stubs, Reversible, DefaultDict, Text, ContextManager, Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some of the new features are not yet implemented in mypy or other static analyzers). Also classes for PEP 492 (Awaitable, AsyncIterable, AsyncIterator) have been added (in fact they made it into 3.5.1 but were never mentioned).
  • Issue #25738: Stop http.server.BaseHTTPRequestHandler.send_error() from sending a message body for 205 Reset Content. Also, don’t send Content header fields in responses that don’t have a body. Patch by Susumu Koshiba.
  • Issue #21313: Fix the “platform” module to tolerate when sys.version contains truncated build information.
  • Issue #26839: On Linux, os.urandom() now calls getrandom() with GRND_NONBLOCK to fall back on reading /dev/urandom if the urandom entropy pool is not initialized yet. Patch written by Colm Buckley.
  • Issue #27164: In the zlib module, allow decompressing raw Deflate streams with a predefined zdict. Based on patch by Xiang Zhang.
  • Issue #24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely write data to the client. Previously it could do partial writes and truncate data. Also, wsgiref.handler.ServerHandler can now handle stdout doing partial writes, but this is deprecated.
  • Issue #26809: Add __all__ to string. Patch by Emanuel Barry.
  • Issue #26373: subprocess.Popen.communicate now correctly ignores BrokenPipeError when the child process dies before .communicate() is called in more/all circumstances.
  • Issue #21776: distutils.upload now correctly handles HTTPError. Initial patch by Claudiu Popa.
  • Issue #27114: Fix SSLContext._load_windows_store_certs fails with PermissionError
  • Issue #18383: Avoid creating duplicate filters when using filterwarnings and simplefilter. Based on patch by Alex Shkop.
  • Issue #27057: Fix os.set_inheritable() on Android, ioctl() is blocked by SELinux and fails with EACCESS. The function now falls back to fcntl(). Patch written by Michal Bednarski.
  • 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 Ján Janech.
  • Issue #17214: The “urllib.request” module now percent-encodes non-ASCII bytes found in redirect target URLs. Some servers send Location header fields with non-ASCII bytes, but “http.client” requires the request target to be ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on patch by Christian Heimes.
  • Issue #26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch contributed by Chi Hsuan Yen.
  • Issue #22274: In the subprocess module, allow stderr to be redirected to stdout even when stdout is not redirected. Patch by Akira Li.
  • Issue #26807: mock_open ‘files’ no longer error on readline at end of file. Patch from Yolanda Robla.
  • Issue #25745: Fixed leaking a userptr in curses panel destructor.
  • 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 #23815: Fixed crashes related to directly created instances of types in _tkinter and curses.panel modules.
  • Issue #17765: weakref.ref() no longer silently ignores keyword arguments. Patch by Georg Brandl.
  • Issue #26873: xmlrpc now raises ResponseError on unsupported type tags instead of silently return incorrect result.
  • Issue #26711: Fixed the comparison of plistlib.Data with other types.
  • Issue #24114: Fix an uninitialized variable in ctypes.util.
  • 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 #26864: In urllib.request, change the proxy bypass host checking against no_proxy to be case-insensitive, and to not match unrelated host names that happen to have a bypassed hostname as a suffix. Patch by Xiang Zhang.
  • Issue #26634: recursive_repr() now sets __qualname__ of wrapper. Patch by Xiang Zhang.
  • Issue #26804: urllib.request will prefer lower_case proxy environment variables over UPPER_CASE or Mixed_Case ones. Patch contributed by Hans-Peter Jansen.
  • Issue #26837: assertSequenceEqual() now correctly outputs non-stringified differing items (like bytes in the -b mode). This affects assertListEqual() and assertTupleEqual().
  • Issue #26041: Remove “will be removed in Python 3.7” from deprecation messages of platform.dist() and platform.linux_distribution(). Patch by Kumaripaba Miyurusara Athukorala.
  • Issue #26822: itemgetter, attrgetter and methodcaller objects no longer silently ignore keyword arguments.
  • Issue #26733: Disassembling a class now disassembles class and static methods. Patch by Xiang Zhang.
  • Issue #26801: Fix error handling in shutil.get_terminal_size(), catch AttributeError instead of NameError. Patch written by Emanuel Barry.
  • Issue #24838: tarfile’s ustar and gnu formats now correctly calculate name and link field limits for multibyte character encodings like utf-8.
  • Issue #26657: Fix directory traversal vulnerability with http.server on Windows. This fixes a regression that was introduced in 3.3.4rc1 and 3.4.0rc1. Based on patch by Philipp Hagemeister.
  • Issue #26717: Stop encoding Latin-1-ized WSGI paths with UTF-8. Patch by Anthony Sottile.
  • Issue #26735: Fix 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 #16329: Add .webm to mimetypes.types_map. Patch by Giampaolo Rodola’.
  • Issue #13952: Add .csv to mimetypes.types_map. Patch by Geoff Wilson.
  • Issue #26709: Fixed Y2038 problem in loading binary PLists.
  • 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 #22854: Change BufferedReader.writable() and BufferedWriter.readable() to always return False.
  • Issue #25195: Fix a regression in mock.MagicMock. _Call is a subclass of tuple (changeset 3603bae63c13 only works for classes) so we need to implement __ne__ ourselves. Patch by Andrew Plummer.
  • Issue #26644: Raise ValueError rather than SystemError when a negative length is passed to SSLSocket.recv() or read().
  • Issue #23804: Fix SSL recv(0) and read(0) methods to return zero bytes instead of up to 1024.
  • Issue #26616: Fixed a bug in datetime.astimezone() method.
  • Issue #21925: warnings.formatwarning() now catches exceptions on linecache.getline(...) to be able to log ResourceWarning emitted late during the Python shutdown process.
  • Issue #24266: Ctrl+C during Readline history search now cancels the search mode when compiled with Readline 7.
  • Issue #26560: Avoid potential ValueError in BaseHandler.start_response. Initial patch by Peter Inglesby.
  • Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store is empty. Patch by Baji.
  • Issue #26569: Fix pyclbr.readmodule() and pyclbr.readmodule_ex() to support importing packages.
  • Issue #26499: Account for remaining Content-Length in HTTPResponse.readline() and read1(). Based on patch by Silent Ghost. Also document that HTTPResponse now supports these methods.
  • Issue #25320: Handle sockets in directories unittest discovery is scanning. Patch from Victor van den Elzen.
  • Issue #16181: cookiejar.http2time() now returns None if year is higher than datetime.MAXYEAR.
  • Issue #26513: Fixes platform module detection of Windows Server
  • Issue #23718: Fixed parsing time in week 0 before Jan 1. Original patch by Tamás Bence Gedai.
  • Issue #20589: Invoking Path.owner() and Path.group() on Windows now raise NotImplementedError instead of ImportError.
  • Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets.
  • Issue #15068: Got rid of excessive buffering in the fileinput module. The bufsize parameter is no longer used.
  • Issue #2202: Fix UnboundLocalError in AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu Dupuy.
  • 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 #26385: Remove the file if the internal open() call in NamedTemporaryFile() fails. Patch by Silent Ghost.
  • 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 #25913: Leading

New in Python 3.6.0 Alpha 2 (Jun 14, 2016)

  • Core and Builtins:
  • Issue #27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes. Patch by Demur Rumed.
  • Issue #27190: Raise NotSupportedError if sqlite3 is older than 3.3.1. Patch by Dave Sawyer.
  • Issue #27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode. Calling function with generalized unpacking (PEP 448) and conflicting keyword names could cause undefined behavior.
  • Issue #27140: Added BUILD_CONST_KEY_MAP opcode.
  • Issue #27186: Add support for os.PathLike objects to open() (part of PEP 519).
  • Issue #27066: Fixed SystemError if a custom opener (for open()) returns a negative number without setting an exception.
  • Issue #26983: float() now always return an instance of exact float. The deprecation warning is emitted if __float__ returns an instance of a strict subclass of float. In a future versions of Python this can be an error.
  • Issue #27097: Python interpreter is now about 7% faster due to optimized instruction decoding. Based on patch by Demur Rumed.
  • Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode. Patch by Demur Rumed.
  • Issue #23275: Allow assigning to an empty target list in round brackets: () = iterable.
  • Issue #27243: Update the __aiter__ protocol: instead of returning an awaitable that resolves to an asynchronous iterator, the asynchronous iterator should be returned directly. Doing the former will trigger a PendingDeprecationWarning.
  • Library:
  • Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants exposed on the API which are not implemented on GNU/Hurd. They would not work at runtime anyway.
  • Issue #25455: Fixed crashes in repr of recursive ElementTree.Element and functools.partial objects.
  • Issue #27294: Improved repr for Tkinter event objects.
  • Issue #20508: Improve exception message of IPv{4,6}Network.__getitem__. Patch by Gareth Rees.
  • Issue #26556: Update expat to 2.1.1, fixes CVE-2015-1283.
  • Fix TLS stripping vulnerability in smptlib, CVE-2016-0772. Reported by Team Oststrom
  • Issue #21386: Implement missing IPv4Address.is_global property. It was documented since 07a5610bae9d. Initial patch by Roger Luethi.
  • Issue #27029: Removed deprecated support of universal newlines mode from ZipFile.open().
  • Issue #27030: Unknown escapes consisting of '\' and an ASCII letter in regular expressions now are errors. The re.LOCALE flag now can be used only with bytes patterns.
  • Issue #27186: Add os.PathLike support to DirEntry (part of PEP 519). Initial patch by Jelle Zijlstra.
  • Issue #20900: distutils register command now decodes HTTP responses correctly. Initial patch by ingrid.
  • Issue #27186: Add os.PathLike support to pathlib, removing its provisional status (part of PEP 519). Initial patch by Dusty Phillips.
  • Issue #27186: Add support for os.PathLike objects to os.fsencode() and os.fsdecode() (part of PEP 519).
  • Issue #27186: Introduce os.PathLike and os.fspath() (part of PEP 519).
  • A new version of typing.py provides several new classes and features: @overload outside stubs, Reversible, DefaultDict, Text, ContextManager, Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some of the new features are not yet implemented in mypy or other static analyzers). Also classes for PEP 492 (Awaitable, AsyncIterable, AsyncIterator) have been added (in fact they made it into 3.5.1 but were never mentioned).
  • Issue #25738: Stop http.server.BaseHTTPRequestHandler.send_error() from sending a message body for 205 Reset Content. Also, don’t send Content header fields in responses that don’t have a body. Patch by Susumu Koshiba.
  • Issue #21313: Fix the “platform” module to tolerate when sys.version contains truncated build information.
  • Issue #26839: On Linux, os.urandom() now calls getrandom() with GRND_NONBLOCK to fall back on reading /dev/urandom if the urandom entropy pool is not initialized yet. Patch written by Colm Buckley.
  • 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 Kołodziej.
  • Issue #27164: In the zlib module, allow decompressing raw Deflate streams with a predefined zdict. Based on patch by Xiang Zhang.
  • Issue #24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely write data to the client. Previously it could do partial writes and truncate data. Also, wsgiref.handler.ServerHandler can now handle stdout doing partial writes, but this is deprecated.
  • Issue #21272: Use _sysconfigdata.py to initialize distutils.sysconfig.
  • Issue #19611: inspect now reports the implicit .0 parameters generated by the compiler for comprehension and generator expression scopes as if they were positional-only parameters called implicit0. Patch by Jelle Zijlstra.
  • Issue #26809: Add __all__ to string. Patch by Emanuel Barry.
  • Issue #26373: subprocess.Popen.communicate now correctly ignores BrokenPipeError when the child process dies before .communicate() is called in more/all circumstances.
  • 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.
  • Issue #27167: Clarify the subprocess.CalledProcessError error message text when the child process died due to a signal.
  • Issue #25931: Don’t define socketserver.Forking* names on platforms such as Windows that do not support os.fork().
  • Issue #21776: distutils.upload now correctly handles HTTPError. Initial patch by Claudiu Popa.
  • Issue #26526: Replace custom parse tree validation in the parser module with a simple DFA validator.
  • Issue #27114: Fix SSLContext._load_windows_store_certs fails with PermissionError
  • Issue #18383: Avoid creating duplicate filters when using filterwarnings and simplefilter. Based on patch by Alex Shkop.
  • Issue #23026: winreg.QueryValueEx() now return an integer for REG_QWORD type.
  • Issue #26741: subprocess.Popen destructor now emits a ResourceWarning warning if the child process is still running.
  • Issue #27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to deserialize a lot of small objects.
  • Issue #21271: New keyword only parameters in reset_mock call.
  • Issue #25548: Showing memory address of class objects in repl.
  • 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 #24750: Switch all scrollbars in IDLE to ttk versions. Where needed, minimal tests are added to cover changes.
  • Issue #24759: IDLE requires tk 8.5 and availability ttk widgets. Delete now unneeded tk version tests and code for older versions. Add test for IDLE syntax colorizoer.
  • Issue #27239: idlelib.macosx.isXyzTk functions initialize as needed.
  • Issue #27262: move Aqua unbinding code, which enable context menus, to maxosx.
  • Issue #24759: Make clear in idlelib.idle_test.__init__ that the directory is a private implementation of test.test_idle and tool for maintainers.
  • Issue #27196: Stop ‘ThemeChanged’ warnings when running IDLE tests. These persisted after other warnings were suppressed in #20567. Apply Serhiy Storchaka’s update_idletasks solution to four test files. Record this additional advice in idle_test/README.txt
  • Issue #20567: Revise idle_test/README.txt with advice about avoiding tk warning messages from tests. Apply advice to several IDLE tests.
  • Issue #24225: Update idlelib/README.txt with new file names and event handlers.
  • Issue #27156: Remove obsolete code not used by IDLE. Replacements: 1. help.txt, replaced by help.html, is out-of-date and should not be used. Its dedicated viewer has be replaced by the html viewer in help.py. 2. ‘import idlever; I = idlever.IDLE_VERSION’ is the same as ‘import sys; I = version[:version.index(' ')]’ 3. After ‘ob = stackviewer.VariablesTreeItem(*args)’, ‘ob.keys() == list(ob.object.keys)’. 4. In macosc, runningAsOSXAPP == isAquaTk; idCarbonAquaTk == isCarbonTk
  • 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.
  • Issue #26673: When tk reports font size as 0, change to size 10. Such fonts on Linux prevented the configuration dialog from opening.
  • Issue #21939: Add test for IDLE’s percolator. Original patch by Saimadhav Heblikar.
  • Issue #21676: Add test for IDLE’s replace dialog. Original patch by Saimadhav Heblikar.
  • Issue #18410: Add test for IDLE’s search dialog. Original patch by Westley Martínez.
  • Issue #21703: Add test for undo delegator. Patch mostly by Saimadhav Heblikar .
  • Issue #27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks.
  • Issue #23977: Add more asserts to test_delegator.
  • 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.
  • Issue #25285: Tools/buildbot/test.bat script now uses -j1 by default to run each test file in fresh child process.
  • Windows:
  • Issue #27064: The py.exe launcher now defaults to Python 3. The Windows launcher py.exe no longer prefers an installed Python 2 version over Python 3 by default when used interactively.
  • 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:
  • Issue #17500, and https://github.com/python/pythondotorg/issues/945: Remove unused and outdated icons.
  • C API:
  • Issue #27186: Add the PyOS_FSPath() function (part of PEP 519).
  • Issue #26282: PyArg_ParseTupleAndKeywords() now supports positional-only parameters.
  • Tools/Demos:
  • Issue #26282: Argument Clinic now supports positional-only and keyword parameters in the same function.

New in Python 3.5.1 (Dec 22, 2015)

  • Core and Builtins:
  • Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache
  • Windows:
  • Issue #25715: Python 3.5.1 installer shows wrong upgrade path and incorrect logic for launcher detection

New in Python 3.5.0 (Sep 14, 2015)

  • Build:
  • Issue #25071: Windows installer should not require TargetDir parameter when installing quietly

New in Python 3.5.0 RC 4 (Sep 14, 2015)

  • Library:
  • Issue #25029: Fixes MemoryError in test_strptime
  • Build:
  • Issue #25027: Reverts partial-static build options and adds vcruntime140.dll to Windows installation

New in Python 3.5.0 Alpha 4 (Apr 20, 2015)

  • Core and Builtins:
  • 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 #22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES. Patch courtesy of Joe Jevnik.
  • Issue #23731: Implement PEP 488: removal of .pyo files.
  • 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 #23309: Avoid a deadlock at shutdown if a daemon thread is aborted while it is holding a lock to a buffered I/O object, and the main thread tries to use the same I/O object (typically stdout or stderr). A fatal error is emitted instead.
  • Issue #22977: Fixed formatting Windows error messages on Wine. Patch by Martin Panter.
  • Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on non-integer input.
  • Library:
  • Issue #16914: new debuglevel 2 in smtplib adds timestamps to debug output.
  • Issue #7159: urllib.request now supports sending auth credentials automatically after the first 401. This enhancement is a superset of the enhancement from issue #19494 and supersedes that change.
  • Issue #23703: Fix a regression in urljoin() introduced in 901e4e52b20a. Patch by Demian Brecht.
  • Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari
  • Issue 19933: Provide default argument for ndigits in round. Patch by Vajrasky Kok.
  • Issue #23193: Add a numeric_owner parameter to tarfile.TarFile.extract and tarfile.TarFile.extractall. Patch by Michael Vogt and Eric Smith.
  • Issue #23342: Add a subprocess.run() function than returns a CalledProcess instance for a more consistent API than the existing call* functions.
  • 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 #23811: Add missing newline to the PyCompileError error message. Patch by Alex Shkop.
  • Issue #21116: Avoid blowing memory when allocating a multiprocessing shared array that’s larger than 50% of the available RAM. Patch by Médéric Boquien.
  • Issue #22982: Improve BOM handling when seeking to multiple positions of a writable text file.
  • Issue #23464: Removed deprecated asyncio JoinableQueue.
  • 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 #21859: Added Python implementation of io.FileIO.
  • 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 #10838: The subprocess now module includes SubprocessError and TimeoutError in its list of exported names for the users wild enough to use from subprocess import *.
  • Issue #23411: Added DefragResult, ParseResult, SplitResult, DefragResultBytes, ParseResultBytes, and SplitResultBytes to urllib.parse.__all__. Patch by Martin Panter.
  • Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if the FTP connection failed to fix a ResourceWarning.
  • Issue #23853: socket.socket.sendall() does no more reset the socket timeout each time data is sent successfuly. The socket timeout is now the maximum total duration to send all data.
  • Issue #22721: An order of multiline pprint output of set or dict containing orderable and non-orderable elements no longer depends on iteration order of set or dict.
  • Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always returns bool. tkinter.BooleanVar now validates input values (accepted bool, int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns bool.
  • Issue #10590: xml.sax.parseString() now supports string argument.
  • Issue #23338: Fixed formatting ctypes error messages on Cygwin. Patch by Makoto Kato.
  • Issue #15582: inspect.getdoc() now follows inheritance chains.
  • 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 #23618: socket.socket.connect() now waits until the connection completes instead of raising InterruptedError if the connection is interrupted by signals, signal handlers don’t raise an exception and the socket is blocking or has a timeout. socket.socket.connect() still raise InterruptedError for non-blocking sockets.
  • Issue #21526: Tkinter now supports new boolean type in Tcl 8.5.
  • Issue #23836: Fix the faulthandler module to handle reentrant calls to its signal handlers.
  • Issue #23838: linecache now clears the cache and returns an empty result on MemoryError.
  • Issue #10395: Added os.path.commonpath(). Implemented in posixpath and ntpath. Based on patch by Rafik Draoui.
  • Issue #23611: Serializing more “lookupable” objects (such as unbound methods or nested classes) now are supported with pickle protocols < 4.
  • Issue #13583: sqlite3.Row now supports slice indexing.
  • 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 #23485: select.select() is now retried automatically with the recomputed timeout when interrupted by a signal, except if the signal handler raises an exception. This change is part of the PEP 475.
  • Issue #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 #23171: csv.Writer.writerow() now supports arbitrary iterables.
  • 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.
  • Issue #23310: Fix MagicMock’s initializer to work with __methods__, just like configure_mock(). Patch by Kasia Jachim.
  • Build:
  • Issue #23817: FreeBSD now uses “1.0” the the SOVERSION as other operating systems, instead of just “1”.
  • Issue #23501: Argument Clinic now generates code into separate files by default.
  • Tests:
  • Issue #23799: Added test.support.start_threads() for running and cleaning up multiple threads.
  • Issue #22390: test.regrtest now emits a warning if temporary files or directories are left after running a test.
  • Tools/Demos:
  • Issue #18128: pygettext now uses standard +NNNN format in the POT-Creation-Date header.
  • Issue #23935: Argument Clinic’s understanding of format units accepting bytes, bytearrays, and buffers is now consistent with both the documentation and the implementation.
  • Issue #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 #23998: PyImport_ReInitLock() now checks for lock allocation error

New in Python 3.5.0 Alpha 3 (Mar 30, 2015)

  • Core and Builtins:
  • Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on non-integer input.
  • Issue #23573: Increased performance of string search operations (str.find, str.index, str.count, the in operator, str.split, str.partition) with arguments of different kinds (UCS1, UCS2, UCS4).
  • Issue #23753: Python doesn’t support anymore platforms without stat() or fstat(), these functions are always required.
  • Issue #23681: The -b option now affects comparisons of bytes with int.
  • Issue #23632: Memoryviews now allow tuple indexing (including for multi-dimensional memoryviews).
  • Issue #23192: Fixed generator lambdas. Patch by Bruno Cauet.
  • Issue #23629: Fix the default __sizeof__ implementation for variable-sized objects.
  • Library:
  • Issue #23171: csv.Writer.writerow() now supports arbitrary iterables.
  • 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.
  • Issue #14260: The groupindex attribute of regular expression pattern object now is non-modifiable mapping.
  • Issue #23792: Ignore KeyboardInterrupt when the pydoc pager is active. This mimics the behavior of the standard unix pagers, and prevents pipepager from shutting down while the pager itself is still running.
  • Issue #23775: pprint() of OrderedDict now outputs the same representation as repr().
  • Issue #23765: Removed IsBadStringPtr calls in ctypes
  • Issue #22364: Improved some re error messages using regex for hints.
  • Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes.
  • Issue #21717: The zipfile.ZipFile.open function now supports ‘x’ (exclusive creation) mode.
  • Issue #21802: The reader in BufferedRWPair now is closed even when closing writer failed in BufferedRWPair.close().
  • Issue #23622: Unknown escapes in regular expressions that consist of '\' and ASCII letter now raise a deprecation warning and will be forbidden in Python 3.6.
  • Issue #23671: string.Template now allows to specify the “self” parameter as keyword argument. string.Formatter now allows to specify the “self” and the “format_string” parameters as keyword arguments.
  • Issue #23502: The pprint module now supports mapping proxies.
  • Issue #17530: pprint now wraps long bytes objects and bytearrays.
  • Issue #22687: Fixed some corner cases in breaking words in tetxtwrap. Got rid of quadratic complexity in breaking long words.
  • 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 #23491: Added a zipapp module to support creating executable zip file archives of Python code. Registered ”.pyz” and ”.pyzw” extensions on Windows for these archives (PEP 441).
  • Issue #23657: Avoid explicit checks for str in zipapp, adding support for pathlib.Path objects as arguments.
  • Issue #23688: Added support of arbitrary bytes-like objects and avoided unnecessary copying of memoryview in gzip.GzipFile.write(). Original patch by Wolfgang Maier.
  • Issue #23252: Added support for writing ZIP files to unseekable streams.
  • Issue #21526: Tkinter now supports new boolean type in Tcl 8.5.
  • Issue #23647: Increase impalib’s MAXLINE to accommodate modern mailbox sizes.
  • Issue #23539: If body is None, http.client.HTTPConnection.request now sets Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors from some web servers.
  • Issue #22351: The nntplib.NNTP constructor no longer leaves the connection and socket open until the garbage collector cleans them up. Patch by Martin Panter.
  • Issue #23704: collections.deque() objects now support methods for index(), insert(), and copy(). This allows deques to be registered as a MutableSequence and it improves their substitutablity for lists.
  • Issue #23715: signal.sigwaitinfo() and signal.sigtimedwait() are now retried when interrupted by a signal not in the sigset parameter, if the signal handler does not raise an exception. signal.sigtimedwait() recomputes the timeout with a monotonic clock when it is retried.
  • Issue #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 #23646: If time.sleep() is interrupted by a signal, the sleep is now retried with the recomputed delay, except if the signal handler raises an exception (PEP 475).
  • Issue #23136: _strptime now uniformly handles all days in week 0, including Dec 30 of previous year. Based on patch by Jim Carroll.
  • Issue #23700: Iterator of NamedTemporaryFile now keeps a reference to NamedTemporaryFile instance. Patch by Bohuslav Kabrda.
  • 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 #2211: Updated the implementation of the http.cookies.Morsel class. Setting attributes key, value and coded_value directly now is deprecated. update() and setdefault() now transform and check keys. Comparing for equality now takes into account attributes key, value and coded_value. copy() now returns a Morsel, not a dict. repr() now contains all attributes. Optimized checking keys and quoting values. Added new tests. Original patch by Demian Brecht.
  • Issue #18983: Allow selection of output units in timeit. Patch by Julian Gindi.
  • Issue #23631: Fix traceback.format_list when a traceback has been mutated.
  • Issue #23568: Add rdivmod support to MagicMock() objects. Patch by Håkan Lövdahl.
  • Issue #2052: Add charset parameter to HtmlDiff.make_file().
  • Issue #23138: Fixed parsing cookies with absent keys or values in cookiejar. Patch by Demian Brecht.
  • Issue #23051: multiprocessing.Pool methods imap() and imap_unordered() now handle exceptions raised by an iterator. Patch by Alon Diamant and Davin Potts.
  • Issue #23581: Add matmul support to MagicMock. Patch by Håkan Lövdahl.
  • Issue #23566: enable(), register(), dump_traceback() and dump_traceback_later() functions of faulthandler now accept file descriptors. Patch by Wei Wu.
  • Issue #22928: Disabled HTTP header injections in http.client. Original patch by Demian Brecht.
  • Issue #23615: Modules bz2, tarfile and tokenize now can be reloaded with imp.reload(). Patch by Thomas Kluyver.
  • Issue #23605: os.walk() now calls os.scandir() instead of os.listdir(). The usage of os.scandir() reduces the number of calls to os.stat(). Initial patch written by Ben Hoyt.
  • Build:
  • Issue #23585: make patchcheck will ensure the interpreter is built.
  • Tests:
  • Issue #22390: test.regrtest now emits a warning if temporary files or directories are left after running a test.
  • Issue #23583: Added tests for standard IO streams in IDLE.
  • Issue #22289: Prevent test_urllib2net failures due to ftp connection timeout.
  • Tools/Demos:
  • Issue #22826: The result of open() in Tools/freeze/bkfile.py is now better compatible with regular files (in particular it now supports the context management protocol).

New in Python 3.5.0 Alpha 2 (Mar 10, 2015)

  • Core and Builtins:
  • Issue #22980: Under Linux, C extensions now include bitness in the file name, to make it easy to test 32-bit and 64-bit builds in the same working tree.
  • Issue #23571: PyObject_Call() and PyCFunction_Call() now raise a SystemError if a function returns a result and raises an exception. The SystemError is chained to the previous exception.
  • 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 #23103: Reduced the memory consumption of IPv4Address and IPv6Address.
  • Issue #21793: BaseHTTPRequestHandler again logs response code as numeric, not as stringified enum. Patch by Demian Brecht.
  • Issue #23476: In the ssl module, enable OpenSSL’s X509_V_FLAG_TRUSTED_FIRST flag on certificate stores when it is available.
  • 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 #23504: Added an __all__ to the types module.
  • Issue #23563: Optimized utility functions in urllib.parse.
  • Issue #7830: Flatten nested functools.partial.
  • Issue #20204: Added the __module__ attribute to _tkinter classes.
  • Issue #19980: Improved help() for non-recognized strings. help(‘’) now shows the help on str. help(‘help’) now shows the help on help().
  • Issue #23521: Corrected pure python implementation of timedelta division.
  • Eliminated OverflowError from timedelta * float for some floats;
  • Corrected rounding in timedlta true division.
  • Issue #21619: Popen objects no longer leave a zombie after exit in the with statement if the pipe was broken.
  • Issue #22936: Make it possible to show local variables in tracebacks for both the traceback module and unittest.
  • Issue #15955: Add an option to limit the output size in bz2.decompress().
  • Issue #6639: Module-level turtle functions no longer raise TclError after closing the window.
  • 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.
  • Issue #5700: io.FileIO() called flush() after closing the file. flush() was not called in close() if closefd=False.
  • 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 #21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty docstrings.
  • Issue #22885: Fixed arbitrary code execution vulnerability in the dbm.dumb module.
  • Issue #23239: ssl.match_hostname() now supports matching of IP addresses.
  • Issue #23146: Fix mishandling of absolute Windows paths with forward slashes in pathlib.
  • 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 #14910: Add allow_abbrev parameter to argparse.ArgumentParser.
  • Issue #21717: tarfile.open() now supports ‘x’ (exclusive creation) mode.
  • Issue #23344: marshal.dumps() is now 20-25% faster on average.
  • Issue #20416: marshal.dumps() with protocols 3 and 4 is now 40-50% faster on average.
  • Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h.
  • Issue #23367: Fix possible overflows in the unicodedata module.
  • Issue #23361: Fix possible overflow in Windows subprocess creation code.
  • logging.handlers.QueueListener now takes a respect_handler_level keyword argument which, if set to True, will pass messages to handlers taking handler levels into account.
  • Issue #19705: turtledemo now has a visual sorting algorithm demo.
  • Build:
  • Issue #23445: pydebug builds now use “gcc -Og” where possible, to make the resulting executable faster.
  • Issue #23593: Update OS X 10.5 installer build to use OpenSSL 1.0.2.
  • C API:
  • Issue #20204: Deprecation warning is now raised for builtin type without the __module__ attribute.
  • Windows:
  • Issue #23465: Implement PEP 486 - Make the Python Launcher aware of virtual environments.
  • Issue #23437: Make user scripts directory versioned on Windows.

New in Python 3.5.0 Alpha 1 (Feb 25, 2015)

  • Core and Builtins:
  • Issue #23285: PEP 475 - EINTR handling.
  • Issue #22735: Fix many edge cases (including crashes) involving custom mro() implementations.
  • Issue #22896: Avoid using PyObject_AsCharBuffer(), PyObject_AsReadBuffer() and PyObject_AsWriteBuffer().
  • 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 #15859: PyUnicode_EncodeFSDefault(), PyUnicode_EncodeMBCS() and PyUnicode_EncodeCodePage() now raise an exception if the object is not an Unicode object. For PyUnicode_EncodeFSDefault(), it was already the case on platforms other than Windows. Patch written by Campbell Barton.
  • Issue #21408: The default __ne__() now returns NotImplemented if __eq__() returned NotImplemented. Original patch by Martin Panter.
  • Issue #23321: Fixed a crash in str.decode() when error handler returned replacment string longer than mailformed input data.
  • Issue #22286: The “backslashreplace” error handlers now works with decoding and translating.
  • Issue #23253: Delay-load ShellExecute[AW] in os.startfile for reduced startup overhead on Windows.
  • 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 #22834: If the current working directory ends up being set to a non-existent directory then import will no longer raise FileNotFoundError.
  • Issue #22869: Move the interpreter startup & shutdown code to a new dedicated pylifecycle.c module
  • Issue #22847: Improve method cache efficiency.
  • Issue #22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff bytes on a 32-bit platform.
  • 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 #17636: Circular imports involving relative imports are now supported.
  • Issue #22604: Fix assertion error in debug mode when dividing a complex number by (nan+0j).
  • Issue #21052: Do not raise ImportWarning when sys.path_hooks or sys.meta_path are set to None.
  • Issue #16518: Use ‘bytes-like object required’ in error messages that previously used the far more cryptic “‘x’ does not support the buffer protocol.
  • Issue #22470: Fixed integer overflow issues in “backslashreplace”, “xmlcharrefreplace”, and “surrogatepass” error handlers.
  • Issue #22540: speed up PyObject_IsInstance and PyObject_IsSubclass in the common case that the second argument has metaclass type.
  • Issue #18711: Add a new PyErr_FormatV function, similar to PyErr_Format but accepting a va_list argument.
  • Issue #22520: Fix overflow checking when generating the repr of a unicode object.
  • Issue #22519: Fix overflow checking in PyBytes_Repr.
  • Issue #22518: Fix integer overflow issues in latin-1 encoding.
  • Issue #16324: _charset parameter of MIMEText now also accepts email.charset.Charset instances. Initial patch by Claude Paroz.
  • Issue #1764286: Fix inspect.getsource() to support decorated functions. Patch by Claudiu Popa.
  • Issue #18554: os.__all__ includes posix functions.
  • Issue #21391: Use os.path.abspath in the shutil module.
  • Issue #11471: avoid generating a JUMP_FORWARD instruction at the end of an if-block if there is no else-clause. Original patch by Eugene Toder.
  • Issue #22215: Now ValueError is raised instead of TypeError when str or bytes argument contains not permitted null character or byte.
  • Issue #22258: Fix the internal function set_inheritable() on Illumos. This platform exposes the function ioctl(FIOCLEX), but calling it fails with errno is ENOTTY: “Inappropriate ioctl for device”. set_inheritable() now falls back to the slower fcntl() (F_GETFD and then F_SETFD).
  • Issue #21389: Displaying the __qualname__ of the underlying function in the repr of a bound method.
  • Issue #22206: Using pthread, PyThread_create_key() now sets errno to ENOMEM and returns -1 (error) on integer overflow.
  • Issue #20184: Argument Clinic based signature introspection added for 30 of the builtin functions.
  • Issue #22116: C functions and methods (of the ‘builtin_function_or_method’ type) can now be weakref’ed. Patch by Wei Wu.
  • Issue #22077: Improve index error messages for bytearrays, bytes, lists, and tuples by adding ‘or slices’. Added ‘, not 0. Patch by Demian Brecht.
  • Issue #15381: Optimized io.BytesIO to make less allocations and copyings.
  • 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 #23099: Closing io.BytesIO with exported buffer is rejected now to prevent corrupting exported buffer.
  • Issue #23326: Removed __ne__ implementations. Since fixing default __ne__ implementation in issue #21408 they are redundant.
  • Issue #23363: Fix possible overflow in itertools.permutations.
  • Issue #23364: Fix possible overflow in itertools.product.
  • Issue #23366: Fixed possible integer overflow in itertools.combinations.
  • Issue #23366: Fixed possible integer overflow in itertools.combinations.
  • Issue #23369: Fixed possible integer overflow in _json.encode_basestring_ascii.
  • Issue #23353: Fix the exception handling of generators in PyEval_EvalFrameEx(). At entry, save or swap the exception state even if PyEval_EvalFrameEx() is called with throwflag=0. At exit, the exception state is now always restored or swapped, not only if why is WHY_YIELD or WHY_RETURN. Patch co-written with Antoine Pitrou.
  • Issue #14099: Restored support of writing ZIP files to tellable but non-seekable streams.
  • Issue #14099: Writing to ZipFile and reading multiple ZipExtFiles is threadsafe now.
  • Issue #19361: JSON decoder now raises JSONDecodeError instead of ValueError.
  • Issue #18518: timeit now rejects statements which can’t be compiled outside a function or a loop (e.g. “return” or “break”).
  • Issue #23094: Fixed readline with frames in Python implementation of pickle.
  • Issue #23268: Fixed bugs in the comparison of ipaddress classes.
  • Issue #21408: Removed incorrect implementations of __ne__() which didn’t returned NotImplemented if __eq__() returned NotImplemented. The default __ne__() now works correctly.
  • Issue #19996: email.feedparser.FeedParser now handles (malformed) headers with no key rather than amusing the body has started.
  • Issue #20188: Support Application-Layer Protocol Negotiation (ALPN) in the ssl module.
  • 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 #23266: Much faster implementation of ipaddress.collapse_addresses() when there are many non-consecutive addresses.
  • Issue #23098: 64-bit dev_t is now supported in the os module.
  • Issue #21817: When an exception is raised in a task submitted to a ProcessPoolExecutor, the remote traceback is now displayed in the parent process. Patch by Claudiu Popa.
  • Issue #15955: Add an option to limit output size when decompressing LZMA data. Patch by Nikolaus Rath and Martin Panter.
  • Issue #23250: In the http.cookies module, capitalize “HttpOnly” and “Secure” as they are written in the standard.
  • Issue #23063: In the disutils’ check command, fix parsing of reST with code or code-block directives.
  • Issue #23209, #23225: selectors.BaseSelector.get_key() now raises a RuntimeError if the selector is closed. And selectors.BaseSelector.close() now clears its internal reference to the selector mapping to break a reference cycle. Initial patch written by Martin Richard.
  • Issue #19777: Provide a home() classmethod on Path objects. Contributed by Victor Salgado and Mayank Tripathi.
  • Issue #23206: Make json.dumps(..., ensure_ascii=False) as fast as the default case of ensure_ascii=True. Patch by Naoki Inada.
  • Issue #23185: Add math.inf and math.nan constants.
  • Issue #23186: Add ssl.SSLObject.shared_ciphers() and ssl.SSLSocket.shared_ciphers() to fetch the client’s list ciphers sent at handshake.
  • Issue #23143: Remove compatibility with OpenSSLs older than 0.9.8.
  • Issue #23132: Improve performance and introspection support of comparison methods created by functool.total_ordering.
  • Issue #19776: Add a expanduser() method on Path objects.
  • Issue #23112: Fix SimpleHTTPServer to correctly carry the query string and fragment when it redirects to add a trailing slash.
  • Issue #21793: Added http.HTTPStatus enums (i.e. HTTPStatus.OK, HTTPStatus.NOT_FOUND). Patch by Demian Brecht.
  • Issue #23093: In the io, module allow more operations to work on detached streams.
  • Issue #23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol version.
  • 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 #23071: Added missing names to codecs.__all__. Patch by Martin Panter.
  • Issue #22783: Pickling now uses the NEWOBJ opcode instead of the NEWOBJ_EX opcode if possible.
  • Issue #15513: Added a __sizeof__ implementation for pickle classes.
  • Issue #19858: pickletools.optimize() now aware of the MEMOIZE opcode, can produce more compact result and no longer produces invalid output if input data contains MEMOIZE opcodes together with PUT or BINPUT opcodes.
  • Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The port value in the host header was set to “None”. Patch by Demian Brecht.
  • Issue #23016: A warning no longer produces an AttributeError when the program is run with pythonw.exe.
  • Issue #21775: shutil.copytree(): fix crash when copying to VFAT. An exception handler assumed that that OSError objects always have a ‘winerror’ attribute. That is not the case, so the exception handler itself raised AttributeError when run on Linux (and, presumably, any other non-Windows OS). Patch by Greg Ward.
  • Issue #1218234: Fix inspect.getsource() to load updated source of reloaded module. Initial patch by Berker Peksag.
  • Issue #21740: Support wrapped callables in doctest. Patch by Claudiu Popa.
  • Issue #23009: Make sure selectors.EpollSelecrtor.select() works when no FD is registered.
  • Issue #22959: In the constructor of http.client.HTTPSConnection, prefer the context’s check_hostname attribute over the check_hostname parameter.
  • Issue #22696: Add function sys.is_finalizing() to know about interpreter shutdown.
  • Issue #16043: Add a default limit for the amount of data xmlrpclib.gzip_decode will return. This resolves CVE-2013-1753.
  • Issue #14099: ZipFile.open() no longer reopen the underlying file. Objects returned by ZipFile.open() can now operate independently of the ZipFile even if the ZipFile was created by passing in a file-like object as the first argument to the constructor.
  • 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 #21032. Fixed socket leak if HTTPConnection.getresponse() fails. Original patch by Martin Panter.
  • 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 #22960: Add a context argument to xmlrpclib.ServerProxy constructor.
  • Issue #22389: Add contextlib.redirect_stderr().
  • Issue #21356: Make ssl.RAND_egd() optional to support LibreSSL. The availability of the function is checked during the compilation. Patch written by Bernard Spil.
  • Issue #22915: SAX parser now supports files opened with file descriptor or bytes path.
  • Issue #22609: Constructors and update methods of mapping classes in the collections module now accept the self keyword argument.
  • Issue #22940: Add readline.append_history_file.
  • Issue #19676: Added the “namereplace” error handler.
  • Issue #22788: Add context parameter to logging.handlers.HTTPHandler.
  • Issue #22921: Allow SSLContext to take the hostname parameter even if OpenSSL doesn’t support SNI.
  • Issue #22894: TestCase.subTest() would cause the test suite to be stopped when in failfast mode, even in the absence of failures.
  • Issue #22796: HTTP cookie parsing is now stricter, in order to protect against potential injection attacks.
  • Issue #22370: Windows detection in pathlib is now more robust.
  • Issue #22841: Reject coroutines in asyncio add_signal_handler(). Patch by Ludovic.Gasc.
  • Issue #19494: Added urllib.request.HTTPBasicPriorAuthHandler. Patch by Matej Cepl.
  • Issue #22578: Added attributes to the re.error class.
  • Issue #22849: Fix possible double free in the io.TextIOWrapper constructor.
  • Issue #12728: Different Unicode characters having the same uppercase but different lowercase are now matched in case-insensitive regular expressions.
  • Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian platforms.
  • Issue #21650: Add an --sort-keys option to json.tool CLI.
  • 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 #22406: Fixed the uu_codec codec incorrectly ported to 3.x. Based on patch by Martin Panter.
  • Issue #17293: uuid.getnode() now determines MAC address on AIX using netstat. Based on patch by Aivars Kalva-ns.
  • Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments.
  • Issue #22417: Verify certificates by default in httplib (PEP 476).
  • Issue #22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2 and above. Patch by Tim Graham.
  • Issue #22776: Brought excluded code into the scope of a try block in SysLogHandler.emit().
  • Issue #22665: Add missing get_terminal_size and SameFileError to shutil.__all__.
  • Issue #6623: Remove deprecated Netrc class in the ftplib module. Patch by Matt Chaput.
  • Issue #17381: Fixed handling of case-insensitive ranges in regular expressions.
  • Issue #22410: Module level functions in the re module now cache compiled locale-dependent regular expressions taking into account the locale.
  • Issue #22759: Query methods on pathlib.Path() (exists(), is_dir(), etc.) now return False when the underlying stat call raises NotADirectoryError.
  • 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 #22217: Implemented reprs of classes in the zipfile module.
  • Issue #22457: Honour load_tests in the start_dir of discovery.
  • Issue #18216: gettext now raises an error when a .mo file has an unsupported major version number. Patch by Aaron Hill.
  • Issue #13918: Provide a locale.delocalize() function which can remove locale-specific number formatting from a string representing a number, without then converting it to a specific type. Patch by Cédric Krier.
  • Issue #22676: Make the pickling of global objects which don’t have a __module__ attribute less slow.
  • Issue #18853: Fixed ResourceWarning in shlex.__nain__.
  • Issue #9351: Defaults set with set_defaults on an argparse subparser are no longer ignored when also set on the parent parser.
  • 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 #19746: Make it possible to examine the errors from unittest discovery without executing the test suite. The new errors attribute on TestLoader exposes these non-fatal errors encountered during discovery.
  • Issue #21991: Make email.headerregistry’s header ‘params’ attributes be read-only (MappingProxyType). Previously the dictionary was modifiable but a new one was created on each access of the attribute.
  • Issue #22638: SSLv3 is now disabled throughout the standard library. It can still be enabled by instantiating a SSLContext manually.
  • Issue #22641: In asyncio, the default SSL context for client connections is now created using ssl.create_default_context(), for stronger security.
  • Issue #17401: Include closefd in io.FileIO repr.
  • Issue #21338: Add silent mode for compileall. quiet parameters of compile_{dir, file, path} functions now have a multilevel value. Also, -q option of the CLI now have a multilevel value. Patch by Thomas Kluyver.
  • Issue #20152: Convert the array and cmath modules to Argument Clinic.
  • Issue #18643: Add socket.socketpair() on Windows.
  • Issue #22435: Fix a file descriptor leak when SocketServer bind fails.
  • Issue #13096: Fixed segfault in CTypes POINTER handling of large values.
  • Issue #11694: Raise ConversionError in xdrlib as documented. Patch by Filip Gruszczyn'ski and Claudiu Popa.
  • Issue #19380: Optimized parsing of regular expressions.
  • Issue #1519638: Now unmatched groups are replaced with empty strings in re.sub() and re.subn().
  • Issue #18615: sndhdr.what/whathdr now return a namedtuple.
  • Issue #22462: Fix pyexpat’s creation of a dummy frame to make it appear in exception tracebacks.
  • Issue #21965: Add support for in-memory SSL to the ssl module. Patch by Geert Jansen.
  • Issue #21173: Fix len() on a WeakKeyDictionary when .clear() was called with an iterator alive.
  • Issue #11866: Eliminated race condition in the computation of names for new threads.
  • Issue #21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules is mutated while iterating. Patch by Olivier Grisel.
  • Issue #11271: concurrent.futures.Executor.map() now takes a chunksize argument to allow batching of tasks in child processes and improve performance of ProcessPoolExecutor. Patch by Dan O’Reilly.
  • Issue #21883: os.path.join() and os.path.relpath() now raise a TypeError with more helpful error message for unsupported or mismatched types of arguments.
  • Issue #22219: The zipfile module CLI now adds entries for directories (including empty directories) in ZIP file.
  • Issue #22449: In the ssl.SSLContext.load_default_certs, consult the enviromental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows.
  • 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 #20218: Added convenience methods read_text/write_text and read_bytes/ write_bytes to pathlib.Path objects.
  • Issue #22437: Number of capturing groups in regular expression is no longer limited by 100.
  • Issue #17442: InteractiveInterpreter now displays the full chained traceback in its showtraceback method, to match the built in interactive interpreter.
  • 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 #9850: Fixed macpath.join() for empty first component. Patch by Oleg Oshmyan.
  • Issue #5309: distutils’ build and build_ext commands now accept a -j option to enable parallel building of extension modules.
  • Issue #22448: Improve canceled timer handles cleanup to prevent unbound memory usage. Patch by Joshua Moore-Oliva.
  • Issue #22427: TemporaryDirectory no longer attempts to clean up twice when used in the with statement in generator.
  • Issue #22362: Forbidden ambiguous octal escapes out of range 0-0o377 in regular expressions.
  • Issue #20912: Now directories added to ZIP file have correct Unix and MS-DOS directory attributes.
  • Issue #21866: ZipFile.close() no longer writes ZIP64 central directory records if allowZip64 is false.
  • Issue #22278: Fix urljoin problem with relative urls, a regression observed after changes to issue22118 were submitted.
  • Issue #22415: Fixed debugging output of the GROUPREF_EXISTS opcode in the re module. Removed trailing spaces in debugging output.
  • Issue #22423: Unhandled exception in thread no longer causes unhandled AttributeError when sys.stderr is None.
  • Issue #21332: Ensure that bufsize=1 in subprocess.Popen() selects line buffering, rather than block buffering. Patch by Akira Li.
  • Issue #21091: Fix API bug: email.message.EmailMessage.is_attachment is now a method.
  • Issue #21079: Fix email.message.EmailMessage.is_attachment to return the correct result when the header has parameters as well as a value.
  • Issue #22247: Add NNTPError to nntplib.__all__.
  • Issue #22366: urllib.request.urlopen will accept a context object (SSLContext) as an argument which will then used be for HTTPS connection. Patch by Alex Gaynor.
  • Issue #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.
  • Lax cookie parsing in http.cookies could be a security issue when combined with non-standard cookie handling in some Web browsers. Reported by Sergey Bobrov.
  • Issue #20537: logging methods now accept an exception instance as well as a Boolean value or exception tuple. Thanks to Yury Selivanov for the patch.
  • Issue #22384: An exception in Tkinter callback no longer crashes the program when it is run with pythonw.exe.
  • Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.
  • Issue #21147: sqlite3 now raises an exception if the request contains a null character instead of truncate it. Based on patch by Victor Stinner.
  • Issue #13968: The glob module now supports recursive search in subdirectories using the “**” pattern.
  • 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 #12410: imaplib.IMAP4 now supports the context management protocol. Original patch by Tarek Ziadé.
  • Issue #21270: We now override tuple methods in mock.call objects so that they can be used as normal call attributes.
  • Issue #16662: load_tests() is now unconditionally run when it is present in a package’s __init__.py. TestLoader.loadTestsFromModule() still accepts use_load_tests, but it is deprecated and ignored. A new keyword-only attribute pattern is added and documented. Patch given by Robert Collins, tweaked by Barry Warsaw.
  • 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 #22051: turtledemo no longer reloads examples to re-run them. Initialization of variables and gui setup should be done in main(), which is called each time a demo is run, but not on import.
  • 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 #18132: Turtledemo buttons no longer disappear when the window is shrunk. Original patches by Jan Kanis and Lita Cho.
  • Issue #22043: time.monotonic() is now always available. threading.Lock.acquire(), threading.RLock.acquire() and socket operations now use a monotonic clock, instead of the system clock, when a timeout is used.
  • Issue #21527: Add a default number of workers to ThreadPoolExecutor equal to 5 times the number of CPUs. Patch by Claudiu Popa.
  • 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 #22098: ctypes’ BigEndianStructure and LittleEndianStructure now define an empty __slots__ so that subclasses don’t always get an instance dict. Patch by Claudiu Popa.
  • Issue #22185: Fix an occasional RuntimeError in threading.Condition.wait() caused by mutation of the waiters queue without holding the lock. Patch by Doug Zongker.
  • Issue #22287: On UNIX, _PyTime_gettimeofday() now uses clock_gettime(CLOCK_REALTIME) if available. As a side effect, Python now depends on the librt library on Solaris and on Linux (only with glibc older than 2.17).
  • Issue #22182: Use e.args to unpack exceptions correctly in distutils.file_util.move_file. Patch by Claudiu Popa.
  • The webbrowser module now uses subprocess’s start_new_session=True rather than a potentially risky preexec_fn=os.setsid call.
  • Issue #22042: signal.set_wakeup_fd(fd) now raises an exception if the file descriptor is in blocking mode.
  • Issue #16808: inspect.stack() now returns a named tuple instead of a tuple. Patch by Daniel Shahaf.
  • Issue #22236: Fixed Tkinter images copying operations in NoDefaultRoot mode.
  • Issue #2527: Add a globals argument to timeit functions, in order to override the globals namespace in which the timed code is executed. Patch by Ben Roberts.
  • 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 #21549: Added the “members” parameter to TarFile.list().
  • Issue #19628: Allow compileall recursion depth to be specified with a -r option.
  • Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows.
  • Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter.
  • Issue #22165: SimpleHTTPRequestHandler now supports undecodable file names.
  • Issue #15381: Optimized line reading in io.BytesIO.
  • Issue #8797: Raise HTTPError on failed Basic Authentication immediately. Initial patch by Sam Bull.
  • Issue #20729: Restored the use of lazy iterkeys()/itervalues()/iteritems() in the mailbox module.
  • Issue #21448: Changed FeedParser feed() to avoid O(N**2) behavior when parsing long line. Original patch by Raymond Hettinger.
  • 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 #21725: Added support for RFC 6531 (SMTPUTF8) in smtpd.
  • 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 #21121: Don’t force 3rd party C extensions to be built with -Werror=declaration-after-statement.
  • 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 #20170: Convert posixmodule to use Argument Clinic.
  • Issue #21539: Add a exists_ok argument to Pathlib.mkdir() to mimic mkdir -p and os.makedirs() functionality. When true, ignore FileExistsErrors. Patch by Berker Peksag.
  • 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.
  • Add an __all__ to html.entities.
  • Issue #15114: the strict mode and argument of HTMLParser, HTMLParser.error, and the HTMLParserError exception have been removed.
  • Issue #22085: Dropped support of Tk 8.3 in Tkinter.
  • Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk. In particular this allows to initialize images from binary data.
  • Issue #22003: When initialized from a bytes object, io.BytesIO() now defers making a copy until it is mutated, improving performance and memory use on some use cases. Patch by David Wilson.
  • Issue #22018: On Windows, signal.set_wakeup_fd() now also supports sockets. A side effect is that Python depends to the WinSock library.
  • Issue #22054: Add os.get_blocking() and os.set_blocking() functions to get and set the blocking mode of a file descriptor (False if the O_NONBLOCK flag is set, True otherwise). These functions are not available on Windows.
  • Issue #17172: Make turtledemo start as active on OS X even when run with subprocess. Patch by Lita Cho.
  • Issue #21704: Fix build error for _multiprocessing when semaphores are not available. Patch by Arfrever Frehtes Taifersar Arahesis.
  • Issue #20173: Convert sha1, sha256, sha512 and md5 to ArgumentClinic. Patch by Vajrasky Kok.
  • Fix repr(_socket.socket) on Windows 64-bit: don’t fail with OverflowError on closed socket. repr(socket.socket) already works fine.
  • Issue #22033: Reprs of most Python implemened classes now contain actual class name instead of hardcoded one.
  • Issue #21947: The dis module can now disassemble generator-iterator objects based on their gi_code attribute. Patch by Clement Rouault.
  • Issue #16133: The asynchat.async_chat.handle_read() method now ignores BlockingIOError exceptions.
  • Issue #22044: Fixed premature DECREF in call_tzinfo_method. Patch by Tom Flanagan.
  • 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 #6167: Scrollbar.activate() now returns the name of active element if the argument is not specified. Scrollbar.set() now always accepts only 2 arguments.
  • Issue #15275: Clean up and speed up the ntpath module.
  • Issue #21888: plistlib’s load() and loads() now work if the fmt parameter is specified.
  • Issue #22032: __qualname__ instead of __name__ is now always used to format fully qualified class names of Python implemented classes.
  • Issue #22031: Reprs now always use hexadecimal format with the “0x” prefix when contain an id in form ” at 0x...”.
  • Issue #22018: signal.set_wakeup_fd() now raises an OSError instead of a ValueError on fstat() failure.
  • Issue #21044: tarfile.open() now handles fileobj with an integer ‘name’ attribute. Based on patch by Antoine Pietri.
  • Issue #21966: Respect -q command-line option when code module is ran.
  • Issue #19076: Don’t pass the redundant ‘file’ argument to self.error().
  • Issue #16382: Improve exception message of warnings.warn() for bad category. Initial patch by Phil Elson.
  • Issue #21932: os.read() now uses a Py_ssize_t() type instead of int for the size to support reading more than 2 GB at once. On Windows, the size is truncted to INT_MAX. As any call to os.read(), the OS may read less bytes than the number of requested bytes.
  • Issue #21942: Fixed source file viewing in pydoc’s server mode on Windows.
  • Issue #11259: asynchat.async_chat().set_terminator() now raises a ValueError if the number of received bytes is negative.
  • Issue #12523: asynchat.async_chat.push() now raises a TypeError if it doesn’t get a bytes string
  • Issue #21707: Add missing kwonlyargcount argument to ModuleFinder.replace_paths_in_code().
  • Issue #20639: calling Path.with_suffix(‘’) allows removing the suffix again. Patch by July Tikhonov.
  • Issue #21714: Disallow the construction of invalid paths using Path.with_name(). Original patch by Antony Lee.
  • Issue #15014: Added ‘auth’ method to smtplib to make implementing auth mechanisms simpler, and used it internally in the login method.
  • 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 #5800: headers parameter of wsgiref.headers.Headers is now optional. Initial patch by Pablo Torres Navarrete and SilentGhost.
  • Issue #21781: ssl.RAND_add() now supports strings longer than 2 GB.
  • Issue #21679: Prevent extraneous fstat() calls during open(). Patch by Bohuslav Kabrda.
  • Issue #21863: cProfile now displays the module name of C extension functions, in addition to their own name.
  • Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper object is destroyed. The destructor now closes the file if needed. The close() method can now be called twice: the second call does nothing.
  • Issue #21858: Better handling of Python exceptions in the sqlite3 module.
  • Issue #21476: Make sure the email.parser.BytesParser TextIOWrapper is discarded after parsing, so the input file isn’t unexpectedly closed.
  • Issue #20295: imghdr now recognizes OpenEXR format images.
  • Issue #21729: Used the “with” statement in the dbm.dumb module to ensure files closing. Patch by Claudiu Popa.
  • Issue #21491: socketserver: Fix a race condition in child processes reaping.
  • Issue #21719: Added the st_file_attributes field to os.stat_result on Windows.
  • Issue #21832: Require named tuple inputs to be exact strings.
  • 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 #17552: new socket.sendfile() method allowing to send a file over a socket by using high-performance os.sendfile() on UNIX. Patch by Giampaolo Rodola’.
  • Issue #18039: dbm.dump.open() now always creates a new database when the flag has the value ‘n’. Patch by Claudiu Popa.
  • Issue #21326: Add a new is_closed() method to asyncio.BaseEventLoop. run_forever() and run_until_complete() methods of asyncio.BaseEventLoop now raise an exception if the event loop was closed.
  • Issue #21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths before checking for a CGI script at that path.
  • Issue #21310: Fixed possible resource leak in failed open().
  • Issue #21256: Printout of keyword args should be in deterministic order in a mock function call. This will help to write better doctests.
  • Issue #21677: Fixed chaining nonnormalized exceptions in io close() methods.
  • Issue #11709: Fix the pydoc.help function to not fail when sys.stdin is not a valid file.
  • Issue #21515: tempfile.TemporaryFile now uses os.O_TMPFILE flag is available.
  • Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods that use ‘self’ in the example code is generated correctly.
  • Issue #21463: In urllib.request, fix pruning of the FTP cache.
  • 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 #20383: Introduce importlib.util.module_from_spec() as the preferred way to create a new module.
  • 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 #13742: Added “key” and “reverse” parameters to heapq.merge(). (First draft of patch contributed by Simon Sapin.)
  • Issue #21402: tkinter.ttk now works when default root window is not set.
  • Issue #3015: _tkinter.create() now creates tkapp object with wantobject=1 by default.
  • Issue #10203: sqlite3.Row now truly supports sequence protocol. In particulr it supports reverse() and negative indices. Original patch by Claudiu Popa.
  • 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 #21513: Speedup some properties of IP addresses (IPv4Address, IPv6Address) such as .is_private or .is_multicast.
  • 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 #21455: Add a default backlog to socket.listen().
  • Issue #21525: Most Tkinter methods which accepted tuples now accept lists too.
  • Issue #22166: with the assistance of a new internal _codecs._forget_codec helping function, test_codecs now clears the encoding caches to avoid the appearance of a reference leak
  • 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 #20826: Optimize ipaddress.collapse_addresses().
  • Issue #21487: Optimize ipaddress.summarize_address_range() and ipaddress.{IPv4Network,IPv6Network}.subnets().
  • Issue #21486: Optimize parsing of netmasks in ipaddress.IPv4Network and ipaddress.IPv6Network.
  • Issue #13916: Disallowed the surrogatepass error handler for non UTF-* encodings.
  • Issue #20998: Fixed re.fullmatch() of repeated single character pattern with ignore case. Original patch by Matthew Barnett.
  • Issue #21075: fileinput.FileInput now reads bytes from standard stream if binary mode is specified. Patch by Sam Kimbrel.
  • Issue #19775: Add a samefile() method to pathlib Path objects. Initial patch by Vajrasky Kok.
  • Issue #21226: Set up modules properly in PyImport_ExecCodeModuleObject (and friends).
  • Issue #21398: Fix an unicode error in the pydoc pager when the documentation contains characters not encodable to the stdout encoding.
  • Issue #16531: ipaddress.IPv4Network and ipaddress.IPv6Network now accept an (address, netmask) tuple argument, so as to easily construct network objects from existing addresses.
  • Issue #21156: importlib.abc.InspectLoader.source_to_code() is now a staticmethod.
  • Issue #21424: Simplified and optimized heaqp.nlargest() and nmsmallest() to make fewer tuple comparisons.
  • Issue #21396: Fix TextIOWrapper(..., write_through=True) to not force a flush() on the underlying binary stream. Patch by akira.
  • Issue #18314: Unlink now removes junctions on Windows. Patch by Kim Gräsman
  • Issue #21088: Bugfix for curses.window.addch() regression in 3.4.0. In porting to Argument Clinic, the first two arguments were reversed.
  • Issue #21407: _decimal: The module now supports function signatures.
  • Issue #10650: Remove the non-standard ‘watchexp’ parameter from the Decimal.quantize() method in the Python version. It had never been present in the C version.
  • Issue #21469: Reduced the risk of false positives in robotparser by checking to make sure that robots.txt has been read or does not exist prior to returning True in can_fetch().
  • Issue #19414: Have the OrderedDict mark deleted links as unusable. This gives an early failure if the link is deleted during iteration.
  • Issue #21421: Add __slots__ to the MappingViews ABC. Patch by Josh Rosenberg.
  • Issue #21101: Eliminate double hashing in the C speed-up code for collections.Counter().
  • Issue #21321: itertools.islice() now releases the reference to the source iterator when the slice is exhausted. Patch by Anton Afanasyev.
  • Issue #21057: TextIOWrapper now allows the underlying binary stream’s read() or read1() method to return an arbitrary bytes-like object (such as a memoryview). Patch by Nikolaus Rath.
  • Issue #20951: SSLSocket.send() now raises either SSLWantReadError or SSLWantWriteError on a non-blocking socket if the operation would block. Previously, it would return 0. Patch by Nikolaus Rath.
  • Issue #13248: removed previously deprecated asyncore.dispatcher __getattr__ cheap inheritance hack.
  • Issue #9815: assertRaises now tries to clear references to local variables in the exception’s traceback.
  • Issue #19940: ssl.cert_time_to_seconds() now interprets the given time string in the UTC timezone (as specified in RFC 5280), not the local timezone.
  • Issue #13204: Calling sys.flags.__new__ would crash the interpreter, now it raises a TypeError.
  • 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 #21291: subprocess’s Popen.wait() is now thread safe so that multiple threads may be calling wait() or poll() on a Popen instance at the same time without losing the Popen.returncode value.
  • Issue #21127: Path objects can now be instantiated from str subclass instances (such as numpy.str_).
  • Issue #15002: urllib.response object to use _TemporaryFileWrapper (and _TemporaryFileCloser) facility. Provides a better way to handle file descriptor close. Patch contributed by Christian Theune.
  • Issue #12220: mindom now raises a custom ValueError indicating it doesn’t support spaces in URIs instead of letting a ‘split’ ValueError bubble up.
  • Issue #21068: The ssl.PROTOCOL* constants are now enum members.
  • Issue #21276: posixmodule: Don’t define USE_XATTRS on KFreeBSD and the Hurd.
  • Issue #21262: New method assert_not_called for Mock. It raises AssertionError if the mock has been called.
  • Issue #21238: New keyword argument unsafe to Mock. It raises AttributeError incase of an attribute startswith assert or assret.
  • Issue #20896: ssl.get_server_certificate() now uses PROTOCOL_SSLv23, not PROTOCOL_SSLv3, for maximum compatibility.
  • Issue #21239: patch.stopall() didn’t work deterministically when the same name was patched more than once.
  • Issue #21203: Updated fileConfig and dictConfig to remove inconsistencies. Thanks to Jure Koren for the patch.
  • Issue #21222: Passing name keyword argument to mock.create_autospec now works.
  • 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 #17826: setting an iterable side_effect on a mock function created by create_autospec now works. Patch by Kushal Das.
  • Issue #7776: Fix Host: header and reconnection when using http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath.
  • Issue #20968: unittest.mock.MagicMock now supports division. Patch by Johannes Baiter.
  • Fix arbitrary memory access in JSONDecoder.raw_decode with a negative second parameter. Bug reported by Guido Vranken.
  • Issue #21169: getpass now handles non-ascii characters that the input stream encoding cannot encode by re-encoding using the replace error handler.
  • Issue #21171: Fixed undocumented filter API of the rot13 codec. Patch by Berker Peksag.
  • Issue #20539: Improved math.factorial error message for large positive inputs and changed exception type (OverflowError -> ValueError) for large negative inputs.
  • Issue #21172: isinstance check relaxed from dict to collections.Mapping.
  • Issue #21155: asyncio.EventLoop.create_unix_server() now raises a ValueError if path and sock are specified at the same time.
  • Issue #21136: Avoid unnecessary normalization of Fractions resulting from power and other operations. Patch by Raymond Hettinger.
  • Issue #17621: Introduce importlib.util.LazyLoader.
  • Issue #21076: signal module constants were turned into enums. Patch by Giampaolo Rodola’.
  • Issue #20636: Improved the repr of Tkinter widgets.
  • Issue #19505: The items, keys, and values views of OrderedDict now support reverse iteration using reversed().
  • Issue #21149: Improved thread-safety in logging cleanup during interpreter shutdown. Thanks to Devin Jeanpierre for the patch.
  • Issue #21058: Fix a leak of file descriptor in tempfile.NamedTemporaryFile(), close the file descriptor if io.open() fails
  • Issue #21200: Return None from pkgutil.get_loader() when __spec__ is missing.
  • Issue #21013: Enhance ssl.create_default_context() when used for server side sockets to provide better security by default.
  • Issue #20145: assertRaisesRegex and assertWarnsRegex now raise a TypeError if the second argument is not a string or compiled regex.
  • Issue #20633: Replace relative import by absolute import.
  • Issue #20980: Stop wrapping exception when using ThreadPool.
  • Issue #21082: In os.makedirs, do not set the process-wide umask. Note this changes behavior of makedirs when exist_ok=True.
  • Issue #20990: Fix issues found by pyflakes for multiprocessing.
  • Issue #21015: SSL contexts will now automatically select an elliptic curve for ECDH key exchange on OpenSSL 1.0.2 and later, and otherwise default to “prime256v1”.
  • Issue #21000: Improve the command-line interface of json.tool.
  • Issue #20995: Enhance default ciphers used by the ssl module to enable better security an prioritize perfect forward secrecy.
  • Issue #20884: Don’t assume that __file__ is defined on importlib.__init__.
  • Issue #21499: Ignore __builtins__ in several test_importlib.test_api tests.
  • Issue #20627: xmlrpc.client.ServerProxy is now a context manager.
  • Issue #19165: The formatter module now raises DeprecationWarning instead of PendingDeprecationWarning.
  • Issue #13936: Remove the ability of datetime.time instances to be considered false in boolean contexts.
  • Issue 18931: selectors module now supports /dev/poll on Solaris. Patch by Giampaolo Rodola’.
  • Issue #19977: When the LC_TYPE locale is the POSIX locale (C locale), sys.stdin and 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 #20875: Prevent possible gzip “‘read’ is not defined” NameError. Patch by Claudiu Popa.
  • Issue #11558: email.message.Message.attach now returns a more useful error message if attach is called on a message for which is_multipart is False.
  • 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 #20778: Fix modulefinder to work with bytecode-only modules.
  • Issue #20791: copy.copy() now doesn’t make a copy when the input is a bytes object. Initial patch by Peter Otten.
  • Issue #19748: On AIX, time.mktime() now raises an OverflowError for year outsize range [1902; 2037].
  • Issue #19573: inspect.signature: Use enum for parameter kind constants.
  • Issue #20726: inspect.signature: Make Signature and Parameter picklable.
  • Issue #17373: Add inspect.Signature.from_callable method.
  • Issue #20378: Improve repr of inspect.Signature and inspect.Parameter.
  • Issue #20816: Fix inspect.getcallargs() to raise correct TypeError for missing keyword-only arguments. Patch by Jeremiah Lowin.
  • Issue #20817: Fix inspect.getcallargs() to fail correctly if more than 3 arguments are missing. Patch by Jeremiah Lowin.
  • Issue #6676: Ensure a meaningful exception is raised when attempting to parse more than one XML document per pyexpat xmlparser instance. (Original patches by Hirokazu Yamamoto and Amaury Forgeot d’Arc, with suggested wording by David Gutteridge)
  • Issue #21117: Fix inspect.signature to better support functools.partial. Due to the specifics of functools.partial implementation, positional-or-keyword arguments passed as keyword arguments become keyword-only.
  • Issue #20334: inspect.Signature and inspect.Parameter are now hashable. Thanks to Antony Lee for bug reports and suggestions.
  • Issue #15916: doctest.DocTestSuite returns an empty unittest.TestSuite instead of raising ValueError if it finds no tests
  • Issue #21209: Fix asyncio.tasks.CoroWrapper to workaround a bug in yield-from implementation in CPythons prior to 3.4.1.
  • asyncio: Add gi_{frame,running,code} properties to CoroWrapper (upstream issue #163).
  • Issue #21311: Avoid exception in _osx_support with non-standard compiler configurations. Patch by John Szakmeister.
  • Issue #11571: Ensure that the turtle window becomes the topmost window when launched on OS X.
  • Issue #21801: Validate that __signature__ is None or an instance of Signature.
  • Issue #21923: Prevent AttributeError in distutils.sysconfig.customize_compiler due to possible uninitialized _config_vars.
  • Issue #21323: Fix http.server to again handle scripts in CGI subdirectories, broken by the fix for security issue #19435. Patch by Zach Byrne.
  • Issue #22733: Fix ffi_prep_args not zero-extending argument values correctly on 64-bit Windows.
  • Issue #23302: Default to TCP_NODELAY=1 upon establishing an HTTPConnection. Removed use of hard-coded MSS as it’s an optimization that’s no longer needed with Nagle disabled.
  • 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 #3068: Add Idle extension configuration dialog to Options menu. Changes are written to HOME/.idlerc/config-extensions.cfg. Original patch by Tal Einat.
  • Issue #16233: A module browser (File : Class Browser, Alt+C) requires a editor window with a filename. When Class Browser is requested otherwise, from a shell, output window, or ‘Untitled’ editor, Idle no longer displays an error box. It now pops up an Open Module box (Alt+M). If a valid name is entered and a module is opened, a corresponding browser is also opened.
  • Issue #4832: Save As to type Python files automatically adds .py to the name you enter (even if your system does not display it). Some systems automatically add .txt when type is Text files.
  • Issue #21986: Code objects are not normally pickled by the pickle module. To match this, they are no longer pickled when running under Idle.
  • Issue #17390: Adjust Editor window title; remove ‘Python’, move version to end.
  • Issue #14105: Idle debugger breakpoints no longer disappear when inseting or deleting lines.
  • Issue #17172: Turtledemo can now be run from Idle. Currently, the entry is on the Help menu, but it may move to Run. Patch by Ramchandra Apt and Lita Cho.
  • Issue #21765: Add support for non-ascii identifiers to HyperParser.
  • Issue #21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav Heblikar.
  • Issue #18592: Add unittest for SearchDialogBase. Patch by Phil Webster.
  • Issue #21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar.
  • Issue #21686: add unittest for HyperParser. Original patch by Saimadhav Heblikar.
  • Issue #12387: Add missing upper(lower)case versions of default Windows key bindings for Idle so Caps Lock does not disable them. Patch by Roger Serwy.
  • Issue #21695: Closing a Find-in-files output window while the search is still in progress no longer closes Idle.
  • Issue #18910: Add unittest for textView. Patch by Phil Webster.
  • Issue #18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar.
  • Issue #18409: Add unittest for AutoComplete. Patch by Phil Webster.
  • Issue #21477: htest.py - Improve framework, complete set of tests. Patches by Saimadhav Heblikar
  • Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin consolidating and improving human-validated tests of Idle. Change other files as needed to work with htest. Running the module as __main__ runs all tests.
  • Issue #21139: Change default paragraph width to 72, the PEP 8 recommendation.
  • Issue #21284: Paragraph reformat test passes after user changes reformat width.
  • Issue #17654: Ensure IDLE menus are customized properly on OS X for non-framework builds and for all variants of Tk.
  • Issue #23180: Rename IDLE “Windows” menu item to “Window”.
  • Build:
  • Issue #15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the configure script.
  • 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 #22591: Drop support of MS-DOS, especially of the DJGPP compiler (MS-DOS port of GCC).
  • Issue #16537: Check whether self.extensions is empty in setup.py. Patch by Jonathan Hosmer.
  • Issue #22359: Remove incorrect uses of recursive make. Patch by Jonas Wagner.
  • 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 #21037: Add a build option to enable AddressSanitizer support.
  • 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 #17861: Tools/scripts/generate_opcode_h.py automatically regenerates Include/opcode.h from Lib/opcode.py if the later gets any change.
  • Issue #20644: OS X installer build support for documentation build changes in 3.4.1: assume externally supplied sphinx-build is available in /usr/bin.
  • Issue #20022: Eliminate use of deprecated bundlebuilder in OS X builds.
  • Issue #15968: Incorporated Tcl, Tk, and Tix builds into the Windows build solution.
  • Issue #17095: Fix Modules/Setup shared support.
  • Issue #21811: Anticipated fixes to support OS X versions > 10.9.
  • Issue #21166: Prevent possible segfaults and other random failures of python –generate-posix-vars in pybuilddir.txt build target.
  • Issue #18096: Fix library order returned by python-config.
  • 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.
  • Issue #21236: Build _msi.pyd with cabinet.lib instead of fci.lib
  • Issue #17128: Use private version of OpenSSL for OS X 10.5+ installer.
  • C API:
  • Issue #14203: Remove obsolete support for view==NULL in PyBuffer_FillInfo(), bytearray_getbuffer(), bytesiobuf_getbuffer() and array_buffer_getbuf(). All functions now raise BufferError in that case.
  • Issue #22445: PyBuffer_IsContiguous() now implements precise contiguity tests, compatible with NumPy’s NPY_RELAXED_STRIDES_CHECKING compilation flag. Previously the function reported false negatives for corner cases.
  • Issue #22079: PyType_Ready() now checks that statically allocated type has no dynamically allocated bases.
  • Issue #22453: Removed non-documented macro PyObject_REPR().
  • Issue #18395: Rename _Py_char2wchar() to Py_DecodeLocale(), rename _Py_wchar2char() to Py_EncodeLocale(), and document these functions.
  • Issue #21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(), PyObject_Calloc(), _PyObject_GC_Calloc(). bytes(int) is now using calloc() instead of malloc() for large objects which is faster and use less memory.
  • Issue #20942: PyImport_ImportFrozenModuleObject() no longer sets __file__ to match what importlib does; this affects _frozen_importlib as well as any module loaded using imp.init_frozen().
  • 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 #22394: Doc/Makefile now supports make venv PYTHON=../python to create a venv for generating the documentation, e.g., make html PYTHON=venv/bin/python3.
  • Issue #21514: The documentation of the json module now refers to new JSON RFC 7159 instead of obsoleted RFC 4627.
  • 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.
  • Issue #6916: undocument deprecated asynchat.fifo class.
  • Issue #17386: Expanded functionality of the Doc/make.bat script to make it much more comparable to Doc/Makefile.
  • Issue #21312: Update the thread_foobar.h template file to include newer threading APIs. Patch by Jack McCracken.
  • Issue #21043: Remove the recommendation for specific CA organizations and to mention the ability to load the OS certificates.
  • Issue #20765: Add missing documentation for PurePath.with_name() and PurePath.with_suffix().
  • Issue #19407: New package installation and distribution guides based on the Python Packaging Authority tools. Existing guides have been retained as legacy links from the distutils docs, as they still contain some required reference material for tool developers that isn’t recorded anywhere else.
  • Issue #19697: Document cases where __main__.__spec__ is None.
  • Tests:
  • Issue #18982: Add tests for CLI of the calendar module.
  • Issue #19548: Added some additional checks to test_codecs to ensure that statements in the updated documentation remain accurate. Patch by Martin Panter.
  • Issue #22838: All test_re tests now work with unittest test discovery.
  • Issue #22173: Update lib2to3 tests to use unittest test discovery.
  • Issue #16000: Convert test_curses to use unittest.
  • Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not present. Patch by Remi Pointel.
  • Issue #20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier de Gaye.
  • Issue #22060: test_ctypes has been somewhat cleaned up and simplified; it now uses unittest test discovery to find its tests.
  • Issue #22104: regrtest.py no longer holds a reference to the suite of tests loaded from test modules that don’t define test_main().
  • Issue #22111: Assorted cleanups in test_imaplib. Patch by Milan Oberkirch.
  • Issue #22002: Added load_package_tests function to test.support and used it to implement/augment test discovery in test_asyncio, test_email, test_importlib, test_json, and test_tools.
  • Issue #21976: Fix test_ssl to accept LibreSSL version strings. Thanks to William Orr.
  • Issue #21918: Converted test_tools from a module to a package containing separate test files for each tested script.
  • Issue #9554: Use modern unittest features in test_argparse. Initial patch by Denver Coneybeare and Radu Voicilas.
  • Issue #20155: Changed HTTP method names in failing tests in test_httpservers so that packet filtering software (specifically Windows Base Filtering Engine) does not interfere with the transaction semantics expected by the tests.
  • Issue #19493: Refactored the ctypes test package to skip tests explicitly rather than silently.
  • Issue #18492: All resources are now allowed when tests are not run by regrtest.py.
  • Issue #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 #21605: Added tests for Tkinter images.
  • Issue #21493: Added test for ntpath.expanduser(). Original patch by Claudiu Popa.
  • Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
  • Issue #21522: Added Tkinter tests for Listbox.itemconfigure(), PanedWindow.paneconfigure(), and Menu.entryconfigure().
  • 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 #21275: Fix a socket test on KFreeBSD.
  • Issue #21223: Pass test_site/test_startup_imports when some of the extensions are built as builtins.
  • Issue #20635: Added tests for Tk geometry managers.
  • Add test case for freeze.
  • Issue #20743: Fix a reference leak in test_tcl.
  • Issue #21097: Move test_namespace_pkgs into test_importlib.
  • Issue #21503: Use test_both() consistently in test_importlib.
  • Issue #20939: Avoid various network test failures due to new redirect of http://www.python.org/ to https://www.python.org: use http://www.example.com instead.
  • Issue #20668: asyncio tests no longer rely on tests.txt file. (Patch by Vajrasky Kok)
  • Issue #21093: Prevent failures of ctypes test_macholib on OS X if a copy of libz exists in $HOME/lib or /usr/local/lib.
  • Issue #22770: Prevent some Tk segfaults on OS X when running gui tests.
  • Issue #23211: Workaround test_logging failure on some OS X 10.6 systems.
  • 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 #20076: The makelocalealias.py script no longer ignores UTF-8 mapping.
  • Issue #20079: The makelocalealias.py script now can parse the SUPPORTED file from glibc sources and supports command line options for source paths.
  • Issue #22201: Command-line interface of the zipfile module now correctly extracts ZIP files with directory entries. Patch by Ryan Wilson.
  • Issue #22120: For functions using an unsigned integer return converter, Argument Clinic now generates a cast to that type for the comparison to -1 in the generated code. (This supresses a compilation warning.)
  • Issue #18974: Tools/scripts/diff.py now uses argparse instead of optparse.
  • Issue #21906: Make Tools/scripts/md5sum.py work in Python 3. Patch by Zachary Ware.
  • Issue #21629: Fix Argument Clinic’s “–converters” feature.
  • Add support for yield from to 2to3.
  • 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.
  • Issue #11824: Consider ABI tags in freeze. Patch by Meador Inge.
  • Issue #20535: PYTHONWARNING no longer affects the run_tests.py script.
  • Windows:
  • Issue #23260: Update Windows installer
  • 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

New in Python 3.4.3 (Feb 25, 2015)

  • Library:
  • Issue #6639: Module-level turtle functions no longer raise TclError after closing the window
  • Issues #814253, #9179: Warnings now are raised when group references and conditional group references are used 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 #5700: io.FileIO() called flush() after closing the file. flush() was not called in close() if closefd=False
  • 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 #21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty docstrings
  • Issue #22885: Fixed arbitrary code execution vulnerability in the dbm.dumb module. Original patch by Claudiu Popa
  • Issue #23146: Fix mishandling of absolute Windows paths with forward slashes in pathlib
  • Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h
  • Issue #23361: Fix possible overflow in Windows subprocess creation code
  • Build:
  • Issue #23445: pydebug builds now use “gcc -Og” where possible, to make the resulting executable faster

New in Python 3.4.1 (May 19, 2014)

  • Core and Builtins:
  • Issue #21418: Fix a crash in the builtin function super() when called without argument and without current frame (ex: embedded Python).
  • Issue #21425: Fix flushing of standard streams in the interactive interpreter.
  • Issue #21435: In rare cases, when running finalizers on objects in cyclic trash a bad pointer dereference could occur due to a subtle flaw in internal iteration logic.
  • Library:
  • Issue #10744: Fix PEP 3118 format strings on ctypes objects with a nontrivial shape.
  • Issue #20998: Fixed re.fullmatch() of repeated single character pattern with ignore case. Original patch by Matthew Barnett.
  • Issue #21075: fileinput.FileInput now reads bytes from standard stream if binary mode is specified. Patch by Sam Kimbrel.
  • Issue #21396: Fix TextIOWrapper(..., write_through=True) to not force a flush() on the underlying binary stream. Patch by akira.
  • Issue #21470: Do a better job seeding the random number generator by using enough bytes to span the full state space of the Mersenne Twister.
  • Issue #21398: Fix an unicode error in the pydoc pager when the documentation contains characters not encodable to the stdout encoding.
  • Tests:
  • Issue #17756: Fix test_code test when run from the installed location.
  • Issue #17752: Fix distutils tests when run from the installed location.
  • IDLE:
  • Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin consolidating and improving human-validated tests of Idle. Change other files as needed to work with htest. Running the module as __main__ runs all tests.

New in Python 3.4.0 (Mar 28, 2014)

  • Includes changes from the previous Alpha and Beta versions

New in Python 3.4.0 Beta 2 (Mar 28, 2014)

  • PEP 3156, a new "asyncio" module, a new framework for asynchronous I/O

New in Python 3.4.0 Beta 1 (Mar 28, 2014)

  • Major new features and changes in the 3.4 release series include:
  • PEP 428, a "pathlib" module providing object-oriented filesystem paths
  • PEP 436, a build enhancement that will help generate introspection information for builtins
  • PEP 450, a new "statistics" module
  • PEP 451, standardizing module metadata for Python's module import system
  • PEP 453, a bundled installer for the pip package manager
  • PEP 454, a new "tracemalloc" module for tracing Python memory allocations
  • PEP 456, a new hash algorithm for Python strings and binary data
  • PEP 3154, a new and improved protocol for pickled objects
  • Includes changes from the previous Alpha version

New in Python 3.4.0 Alpha 2 (Mar 28, 2014)

  • Python 3.4 includes a range of improvements of the 3.x series, including hundreds of small improvements and bug fixes. Major new features and changes in the 3.4 release series so far include:
  • PEP 435, a standardized "enum" module
  • PEP 442, improved semantics for object finalization
  • PEP 443, adding single-dispatch generic functions to the standard library
  • PEP 445, a new C API for implementing custom memory allocators
  • PEP 446, changing file descriptors to not be inherited by default in subprocesses

New in Python 3.3.5 RC 2 (Mar 28, 2014)

  • Core and Builtins:
  • Issue #20731: Properly position in source code files even if they are opened in text mode. Patch by Serhiy Storchaka.
  • Issue #19619: str.encode, bytes.decode and bytearray.decode now use an internal API to throw LookupError for known non-text encodings, rather than attempting the encoding or decoding operation and then throwing a TypeError for an unexpected output type. (The latter mechanism remains in place for third party non-text encodings)
  • Library:
  • Issue #20778: Fix modulefinder to work with bytecode-only modules.
  • Issue #20791: copy.copy() now doesn’t make a copy when the input is a bytes object. Initial patch by Peter Otten.
  • Issue #20621: Fixes a zipimport bug introduced in 3.3.4 that could cause spurious crashes or SystemErrors when importing modules or packages from a zip file. The change causing the problem was reverted.
  • Issue #20404: io.TextIOWrapper (and hence the open() builtin) now uses the internal codec marking system added for issue #19619 to throw LookupError for known non-text encodings at stream construction time. The existing output type checks remain in place to deal with unmarked third party codecs.
  • Tests:
  • Issue #20743: Fix a reference leak in test_tcl.
  • Tools/Demos:
  • Issue #20535: PYTHONWARNING no longer affects the run_tests.py script. Patch by Arfrever Frehtes Taifersar Arahesis.

New in Python 3.3.5 RC 1 (Mar 28, 2014)

  • Core and Builtins:
  • Issue #20588: Make Python-ast.c C89 compliant.
  • Issue #20437: Fixed 21 potential bugs when deleting objects references.
  • Issue #20538: UTF-7 incremental decoder produced inconsistant string when input was truncated in BASE64 section.
  • Library:
  • Issue #20635: Fixed grid_columnconfigure() and grid_rowconfigure() methods of Tkinter widgets to work in wantobjects=True mode.
  • Issue #19612: On Windows, subprocess.Popen.communicate() now ignores OSError(22, ‘Invalid argument’) when writing input data into stdin, whereas the process already exited.
  • Issue #6815: os.path.expandvars() now supports non-ASCII environment variables names and values.
  • Issue #17671: Fixed a crash when use non-initialized io.BufferedRWPair. Based on patch by Stephen Tu.
  • Issue #8478: Untokenizer.compat processes first token from iterator input. Patch based on lines from Georg Brandl, Eric Snow, and Gareth Rees.
  • Issue #20594: Avoid name clash with the libc function posix_close.
  • Issue #19856: shutil.move() failed to move a directory to other directory on Windows if source name ends with os.altsep.
  • Issue #14983: email.generator now always adds a line end after each MIME boundary marker, instead of doing so only when there is an epilogue. This fixes an RFC compliance bug and solves an issue with signed MIME parts.
  • Issue #20540: Fix a performance regression (vs. Python 3.2) when layering a multiprocessing Connection over a TCP socket. For small payloads, Nagle’s algorithm would introduce idle delays before the entire transmission of a message.
  • Issue #16983: the new email header parsing code will now decode encoded words that are (incorrectly) surrounded by quotes, and register a defect.
  • Issue #19772: email.generator no longer mutates the message object when doing a down-transform from 8bit to 7bit CTEs.
  • Issue #18805: the netmask/hostmask parsing in ipaddress now more reliably filters out illegal values and correctly allows any valid prefix length.
  • Issue #17369: get_filename was raising an exception if the filename parameter’s RFC2231 encoding was broken in certain ways. This was a regression relative to python2.
  • Issue #20013: Some imap servers disconnect if the current mailbox is deleted, and imaplib did not handle that case gracefully. Now it handles the ‘bye’ correctly.
  • Issue #19920: TarFile.list() no longer fails when outputs a listing containing non-encodable characters. Based on patch by Vajrasky Kok.
  • Issue #20515: Fix NULL pointer dereference introduced by issue #20368.
  • Issue #19186: Restore namespacing of expat symbols inside the pyexpat module.
  • Issue #20426: When passing the re.DEBUG flag, re.compile() displays the debug output every time it is called, regardless of the compilation cache.
  • Issue #20368: The null character now correctly passed from Tcl to Python. Improved error handling in variables-related commands.
  • Issue #20435: Fix _pyio.StringIO.getvalue() to take into account newline translation settings.
  • Issue #20288: fix handling of invalid numeric charrefs in HTMLParser.
  • Issue #20424: Python implementation of io.StringIO now supports lone surrogates.
  • Issue #19456: ntpath.join() now joins relative paths correctly when a drive is present.
  • Issue #19077: tempfile.TemporaryDirectory cleanup is now most likely successful when called during nulling out of modules during shutdown. Misleading exception no longer raised when resource warning is emitted during shutdown.
  • Issue #20367: Fix behavior of concurrent.futures.as_completed() for duplicate arguments. Patch by Glenn Langford.
  • Issue #8260: The read(), readline() and readlines() methods of codecs.StreamReader returned incomplete data when were called after readline() or read(size). Based on patch by Amaury Forgeot d’Arc.
  • IDLE:
  • Issue #20406: Use Python application icons for Idle window title bars. Patch mostly by Serhiy Storchaka.
  • Update the python.gif icon for the Idle classbrowser and pathbowser from the old green snake to the new new blue and yellow snakes.
  • Issue #17721: Remove non-functional configuration dialog help button until we make it actually gives some help when clicked. Patch by Guilherme Simões.
  • Tests:
  • Issue #20510: Rewrote test_exit in test_sys to match existing comments, use modern unittest features, and use helpers from test.script_helper instead of using subprocess directly. Patch by Gareth Rees.
  • Issue #20532: Tests which use _testcapi are now marked as CPython only.
  • Issue #19920: Added tests for TarFile.list(). Based on patch by Vajrasky Kok.
  • Issue #19990: Added tests for the imghdr module. Based on patch by Claudiu Popa.
  • Issue #20474: Fix test_socket “unexpected success” failures on OS X 10.7+.
  • Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust.
  • Documentation:
  • Issue #20488: Importlib is no longer an implementation of import, it’s the implementation.
  • Build:
  • Issue #20221: Removed conflicting (or circular) hypot definition when compiled with VS 2010 or above. Initial patch by Tabrez Mohammed.
  • Issue #20609: Restored the ability to build 64-bit Windows binaries on 32-bit Windows, which was broken by the change in issue #19788.

New in Python 3.3.3 RC 2 (Mar 28, 2014)

  • Library:
  • Issue #19227: Any re-seeding of the OpenSSL RNG on fork has been removed; this should be handled by OpenSSL itself or by the application.
  • Issue #19435: Fix directory traversal attack on CGIHttpRequestHandler.
  • Tests:
  • Issue #18964: Fix test_tcl when run with Tcl/Tk versions < 8.5.
  • Build:
  • Issue #15663: Revert OS X installer built-in Tcl/Tk support for 3.3.3. Some third-party projects, such as Matplotlib and PIL/Pillow, depended on being able to build with Tcl and Tk frameworks in /Library/Frameworks.

New in Python 3.4.0 RC 2 (Feb 24, 2014)

  • PEP 428, a "pathlib" module providing object-oriented filesystem paths
  • PEP 435, a standardized "enum" module
  • PEP 436, a build enhancement that will help generate introspection information for builtins
  • PEP 442, improved semantics for object finalization
  • PEP 443, adding single-dispatch generic functions to the standard library
  • PEP 445, a new C API for implementing custom memory allocators
  • PEP 446, changing file descriptors to not be inherited by default in subprocesses
  • PEP 450, a new "statistics" module
  • PEP 451, standardizing module metadata for Python's module import system
  • PEP 453, a bundled installer for the pip package manager
  • PEP 454, a new "tracemalloc" module for tracing Python memory allocations
  • PEP 456, a new hash algorithm for Python strings and binary data
  • PEP 3154, a new and improved protocol for pickled objects
  • PEP 3156, a new "asyncio" module, a new framework for asynchronous I/O

New in Python 3.3.4 RC 1 (Feb 11, 2014)

  • Core and Builtins:
  • Issue #17825: Cursor “^” is correctly positioned for SyntaxError and IndentationError.
  • Issue #2382: SyntaxError cursor “^” is now written at correct position in most cases when multibyte characters are in line (before “^”). This still not works correctly with wide East Asian characters.
  • Issue #18960: The first line of Python script could be executed twice when the source encoding was specified on the second line. Now the source encoding declaration on the second line isn’t effective if the first line contains anything except a comment. ‘python -x’ works now again with files with the source encoding declarations, and can be used to make Python batch files on Windows.
  • Issue #17432: Drop UCS2 from names of Unicode functions in python3.def.
  • Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if “%c” argument is not in range [0; 255].
  • Issue #14432: Generator now clears the borrowed reference to the thread state. Fix a crash when a generator is created in a C thread that is destroyed while the generator is still used. The issue was that a generator contains a frame, and the frame kept a reference to the Python state of the destroyed C thread. The crash occurs when a trace function is setup.
  • Issue #19932: Fix typo in import.h, missing whitespaces in function prototypes.
  • Issue #19729: In str.format(), fix recursive expansion in format spec.
  • Issue #19638: Fix possible crash / undefined behaviour from huge (more than 2 billion characters) input strings in _Py_dg_strtod.
  • Library:
  • Issue #16042: CVE-2013-1752: smtplib: Limit amount of data read by limiting the call to readline(). Original patch by Christian Heimes.
  • Issue #20317: ExitStack.__exit__ could create a self-referential loop if an exception raised by a cleanup operation already had its context set correctly (for example, by the @contextmanager decorator). The infinite loop this caused is now avoided by checking if the expected context is already set before trying to fix it.
  • Issue #20374: Fix build with GNU readline >= 6.3.
  • Issue #20262: Warnings are raised now when duplicate names are added in the ZIP file or too long ZIP file comment is truncated.
  • Issue #18574: Added missing newline in 100-Continue reply from http.server.BaseHTTPRequestHandler. Patch by Nikolaus Rath.
  • Issue #20270: urllib.urlparse now supports empty ports.
  • Issue #20243: TarFile no longer raise ReadError when opened in write mode.
  • Issue #20238: TarFile opened with external fileobj and “w:gz” mode didn’t write complete output on close.
  • Issue #20245: The open functions in the tarfile module now correctly handle empty mode.
  • Issue #20242: Fixed basicConfig() format strings for the alternative formatting styles. Thanks to kespindler for the bug report and patch.
  • Issue #20246: Fix buffer overflow in socket.recvfrom_into.
  • Issues #20206 and #5803: Fix edge case in email.quoprimime.encode where it truncated lines ending in a character needing encoding but no newline by using a more efficient algorithm that doesn’t have the bug.
  • Issue #19082: Working xmlrpc.server and xmlrpc.client examples. Both in modules and in documentation. Initial patch contributed by Vajrasky Kok.
  • Issue #20138: The wsgiref.application_uri() and wsgiref.request_uri() functions now conform to PEP 3333 when handle non-ASCII URLs.
  • Issue #19097: Raise the correct Exception when cgi.FieldStorage is given an invalid fileobj.
  • Issue #20217: Fix build in SCHED_SPORADIC is defined.
  • Issue #13107: argparse and optparse no longer raises an exception when output a help on environment with too small COLUMNS. Based on patch by Elazar Gershuni.
  • Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly asked for.
  • Issue #18960: The tokenize module now ignore the source encoding declaration on the second line if the first line contains anything except a comment.
  • Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU consumption.
  • Issue #20113: os.readv() and os.writev() now raise an OSError exception on error instead of returning -1.
  • Issue #20072: Fixed multiple errors in tkinter with wantobjects is False.
  • Issue #20108: Avoid parameter name clash in inspect.getcallargs().
  • Issue #12692: Backport the fix for ResourceWarning in test_urllib2net. This also helps in closing the socket when Connection Close header is not sent.
  • Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl module, rather than silently let them emit clear text data.
  • Issue #18116: getpass was always getting an error when testing /dev/tty, and thus was always falling back to stdin, and would then raise an exception if stdin could not be used (such as /dev/null). It also leaked an open file. All of these issues are now fixed.
  • Issue #20027: Fixed locale aliases for devanagari locales.
  • Issue #20067: Tkinter variables now work when wantobjects is false.
  • Issue #19020: Tkinter now uses splitlist() instead of split() in configure methods.
  • Fix TypeError on “setup.py upload –show-response”.
  • Issue #12226: HTTPS is now used by default when connecting to PyPI.
  • Issue #20045: Fix “setup.py register –list-classifiers”.
  • Issue #18879: When a method is looked up on a temporary file, avoid closing the file before the method is possibly called.
  • Issue #20034: Updated alias mapping to most recent locale.alias file from X.org distribution using makelocalealias.py.
  • Issue #5815: Fixed support for locales with modifiers. Fixed support for locale encodings with hyphens.
  • Issue #20026: Fix the sqlite module to handle correctly invalid isolation level (wrong type).
  • Issue #18829: csv.Dialect() now checks type for delimiter, escapechar and quotechar fields. Original patch by Vajrasky Kok.
  • Issue #19855: uuid.getnode() on Unix now looks on the PATH for the executables used to find the mac address, with /sbin and /usr/sbin as fallbacks.
  • Issue #20007: HTTPResponse.read(0) no more prematurely closes connection. Original patch by Simon Sapin.
  • Issue #19912: Fixed numerous bugs in ntpath.splitunc().
  • Issue #19911: ntpath.splitdrive() now correctly processes the ‘İ’ character (U+0130, LATIN CAPITAL LETTER I WITH DOT ABOVE).
  • Issue #19532: python -m compileall with no filename/directory arguments now respects the -f and -q flags instead of ignoring them.
  • Issue #19623: Fixed writing to unseekable files in the aifc module.
  • Issue #17919: select.poll.register() again works with poll.POLLNVAL on AIX. Fixed integer overflow in the eventmask parameter.
  • Issue #19063: if a Charset’s body_encoding was set to None, the email package would generate a message claiming the Content-Transfer-Encoding was 7bit, and produce garbage output for the content. This now works. A couple of other set_payload mishandlings of non-ASCII are also fixed.
  • Issue #17200: telnetlib’s read_until and expect timeout was broken by the fix to Issue #14635 in Python 3.3.0 to be interpreted as milliseconds instead of seconds when the platform supports select.poll (ie: everywhere). It is now treated as seconds once again.
  • Issue #17429: platform.linux_distribution() now decodes files from the UTF-8 encoding with the surrogateescape error handler, instead of decoding from the locale encoding in strict mode. It fixes the function on Fedora 19 which is probably the first major distribution release with a non-ASCII name. Patch written by Toshio Kuratomi.
  • Issue #19929: Call os.read with 32768 within subprocess.Popen.communicate rather than 4096 for efficiency. A microbenchmark shows Linux and OS X both using ~50% less cpu time this way.
  • Issue #19506: Use a memoryview to avoid a data copy when piping data to stdin within subprocess.Popen.communicate. 5-10% less cpu usage.
  • Issue #19839: Fix regression in bz2 module’s handling of non-bzip2 data at EOF, and analogous bug in lzma module.
  • Issue #19138: doctest’s IGNORE_EXCEPTION_DETAIL now allows a match when no exception detail exists (no colon following the exception’s name, or a colon does follow but no text follows the colon).
  • Issue #19834: Support unpickling of exceptions pickled by Python 2.
  • Issue #15798: Fixed subprocess.Popen() to no longer fail if file descriptor 0, 1 or 2 is closed.
  • Issue #19088: Fixed incorrect caching of the copyreg module in object.__reduce__() and object.__reduce_ex__().
  • Fixed _pickle.Unpickler to not fail when loading empty strings as persistent IDs.
  • Issue #11480: Fixed copy.copy to work with classes with custom metaclasses. Patch by Daniel Urban.
  • Issue #6477: Added support for pickling the types of built-in singletons (i.e., Ellipsis, NotImplemented, None).
  • Issue #11508: Fixed uuid.getnode() and uuid.uuid1() on environment with virtual interface. Original patch by Kent Frazier.
  • Issue #11489: JSON decoder now accepts lone surrogates.
  • Issue #19545: Avoid chained exceptions while passing stray % to time.strptime(). Initial patch by Claudiu Popa.
  • Issue #19633: Fixed writing not compressed 16- and 32-bit wave files on big-endian platforms.
  • Issue #19449: in csv’s writerow, handle non-string keys when generating the error message that certain keys are not in the ‘fieldnames’ list.
  • Fix test.support.bind_port() to not cause an error when Python was compiled on a system with SO_REUSEPORT defined in the headers but run on a system with an OS kernel that does not support that reasonably new socket option.
  • Fix compilation error under gcc of the ctypes module bundled libffi for arm.
  • Issue #19523: Closed FileHandler leak which occurred when delay was set.
  • Issue #13674: Prevented time.strftime from crashing on Windows when given a year before 1900 and a format of %y.
  • Issue #19544 and Issue #6286: Restore use of urllib over http allowing use of http_proxy for Distutils upload command, a feature accidentally lost in the rollback of distutils2.
  • Issue #19544 and Issue #7457: Restore the read_pkg_file method to distutils.dist.DistributionMetadata accidentally removed in the undo of distutils2.
  • Issue #1575020: Fixed support of 24-bit wave files on big-endian platforms.
  • Issue #19480: HTMLParser now accepts all valid start-tag names as defined by the HTML5 standard.
  • Issue #6157: Fixed tkinter.Text.debug(). Original patch by Guilherme Polo.
  • Issue #6160: The bbox() method of tkinter.Spinbox now returns a tuple of integers instead of a string. Based on patch by Guilherme Polo.
  • Issue #10197: Rework subprocess.get[status]output to use subprocess functionality and thus to work on Windows. Patch by Nick Coghlan.
  • Issue #19286: Directories in package_data are no longer added to the filelist, preventing failure outlined in the ticket.
  • IDLE:
  • Issue #17390: Add Python version to Idle editor window title bar. Original patches by Edmond Burnett and Kent Johnson.
  • Issue #18960: IDLE now ignores the source encoding declaration on the second line if the first line contains anything except a comment.
  • Issue #20058: sys.stdin.readline() in IDLE now always returns only one line.
  • Issue #19481: print() of string subclass instance in IDLE no longer hangs.
  • Issue #18270: Prevent possible IDLE AttributeError on OS X when no initial shell window is present.
  • Tests:
  • Issue #19804: The test_find_mac test in test_uuid is now skipped if the ifconfig executable is not available.
  • Issue #19886: Use better estimated memory requirements for bigmem tests.
  • Issue #20055: Fix test_shutil under Windows with symlink privileges held. Patch by Vajrasky Kok.
  • Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had been disabled since 3.0 due to the changes in listcomp handling.
  • Issue #19320: test_tcl no longer fails when wantobjects is false.
  • Issue #19683: Removed empty tests from test_minidom. Patch by Ajitesh Gupta.
  • Issue #19919: Fix flaky SSL test. connect_ex() sometimes returns EWOULDBLOCK on Windows or VMs hosted on Windows.
  • Issue #19912: Added tests for ntpath.splitunc().
  • Issue #19828: Fixed test_site when the whole suite is run with -S.
  • Issue #19928: Implemented a test for repr() of cell objects.
  • Issue #19535: Fixed test_docxmlrpc when python is run with -OO.
  • Issue #19926: Removed unneeded test_main from test_abstract_numbers. Patch by Vajrasky Kok.
  • Issue #19595, #19987: Re-enabled a long-disabled test in test_winsound.
  • Issue #19588: Fixed tests in test_random that were silently skipped most of the time. Patch by Julian Gindi.
  • Issue #19596: Set untestable tests in test_importlib to None to avoid reporting success on empty tests.
  • Issue #19440: Clean up test_capi by removing an unnecessary __future__ import, converting from test_main to unittest.main, and running the _testcapi module tests within a unittest TestCase.
  • Issue #18702, 19572: All skipped tests now reported as skipped.
  • Issue #19085: Added basic tests for all tkinter widget options.
  • Documentation:
  • Issue #20265: Updated some parts of the Using Windows document.
  • Issue #20266: Updated some parts of the Windows FAQ.
  • Issue #20255: Updated the about and bugs pages.
  • Issue #20253: Fixed a typo in the ipaddress docs that advertised an illegal attribute name. Found by INADA Naoki.
  • Issue #19963: Document that importlib.import_module() no longer requires importing parent packages separately.
  • Issue #18840: Introduce the json module in the tutorial, and de-emphasize the pickle module.
  • Issue #19845: Updated the Compiling Python on Windows section.
  • Issue #19795: Improved markup of True/False constants.
  • Issue #18326: Clarify that list.sort’s arguments are keyword-only. Also, attempt to reduce confusion in the glossary by not saying there are different “types” of arguments and parameters.
  • Build:
  • Issue #19788: kill_python(_d).exe is now run as a PreBuildEvent on the pythoncore sub-project. This should prevent build errors due a previous build’s python(_d).exe still running.
  • Add workaround for VS 2010 nmake clean issue. VS 2010 doesn’t set up PATH for nmake.exe correctly.
  • Tools/Demos:
  • Issue #19936: Added executable bits or shebang lines to Python scripts which requires them. Disable executable bits and shebang lines in test and benchmark files in order to prevent using a random system python, and in source files of modules which don’t provide command line interface. Fixed shebang line to use python3 executable in the unittestgui script.
  • Issue #18960: 2to3 and the findnocoding.py script now ignore the source encoding declaration on the second line if the first line contains anything except a comment.

New in Python 3.3.2 (May 16, 2013)

  • Core and Builtins:
  • Issue #17237: Fix crash in the ASCII decoder on m68k.
  • Issue #17408: Avoid using an obsolete instance of the copyreg module when the interpreter is shutdown and then started again.
  • Issue #17863: In the interactive console, don’t loop forever if the encoding can’t be fetched from stdin.
  • Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
  • Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3, such as was shipped with Centos 5 and Mac OS X 10.4.
  • Issue #17413: sys.settrace callbacks were being passed a string instead of an exception instance for the ‘value’ element of the arg tuple if the exception originated from C code; now an exception instance is always provided.
  • Issue #17782: Fix undefined behaviour on platforms where struct timespec‘s “tv_nsec” member is not a C long.
  • Issue #17715: Fix segmentation fault from raising an exception in a __trunc__ method.
  • Issue #16447: Fixed potential segmentation fault when setting __name__ on a class.
  • Issue #17669: Fix crash involving finalization of generators using yield from.
  • Issue #17619: Make input() check for Ctrl-C correctly on Windows.
  • Issue #17610: Don’t rely on non-standard behavior of the C qsort() function.
  • Issue #17357: Add missing verbosity output when using -v/-vv.
  • Library:
  • Issue #17606: Fixed support of encoded byte strings in the XMLGenerator
  • .characters() and ignorableWhitespace() methods. Original patch by Sebastian
  • Ortiz Vasquez.
  • Issue #17732: Ignore distutils.cfg options pertaining to install paths if a virtual environment is active.
  • Issue #1159051: Back out a fix for handling corrupted gzip files that broke backwards compatibility.
  • Issue #17915: Fix interoperability of xml.sax with file objects returned by codecs.open().
  • Issue #16601: Restarting iteration over tarfile no more continues from where it left off. Patch by Michael Birtwell.
  • Issue #17289: The readline module now plays nicer with external modules or applications changing the rl_completer_word_break_characters global variable. Initial patch by Bradley Froehle.
  • Issue #12181: select module: Fix struct kevent definition on OpenBSD 64-bit platforms. Patch by Federico Schwindt.
  • Issue #14173: Avoid crashing when reading a signal handler during interpreter shutdown.
  • Issue #16316: mimetypes now recognizes the .xz and .txz (.tar.xz) extensions.
  • Issue #15902: Fix imp.load_module() accepting None as a file when loading an extension module.
  • Issue #17802: Fix an UnboundLocalError in html.parser. Initial tests by Thomas Barlow.
  • Issue #15535: Fix namedtuple pickles which were picking up the OrderedDict instead of just the underlying tuple.
  • Issue #17192: Restore the patch for Issue #11729 which was ommitted in 3.3.1 when updating the bundled version of libffi used by ctypes. Update many libffi files that were missed in 3.3.1’s update to libffi-3.0.13.
  • Issue #17358: Modules loaded by imp.load_source() and load_compiled() (and by extention load_module()) now have a better chance of working when reloaded.
  • Issue #17353: Plistlib emitted empty data tags with deeply nested datastructures
  • Issue #11714: Use ‘with’ statements to assure a Semaphore releases a condition variable. Original patch by Thomas Rachel.
  • Issue #17795: Reverted backwards-incompatible change in SysLogHandler with Unix domain sockets.
  • Issue #17555: Fix ForkAwareThreadLock so that size of after fork registry does not grow exponentially with generation of process.
  • Issue #17707: multiprocessing.Queue’s get() method does not block for short timeouts.
  • Isuse #17720: Fix the Python implementation of pickle.Unpickler to correctly process the APPENDS opcode when it is used on non-list objects.
  • Issue #17012: shutil.which() no longer fallbacks to the PATH environment variable if empty path argument is specified. Patch by Serhiy Storchaka.
  • Issue #17710: Fix pickle raising a SystemError on bogus input.
  • Issue #17341: Include the invalid name in the error messages from re about invalid group names.
  • Issue #17702: os.environ now raises KeyError with the original environment variable name (str on UNIX), instead of using the encoded name (bytes on UNIX).
  • Issue #16163: Make the importlib based version of pkgutil.iter_importers work for submodules. Initial patch by Berker Peksag.
  • Issue #16804: Fix a bug in the ‘site’ module that caused running ‘python -S -m site’ to incorrectly throw an exception.
  • Issue #17016: Get rid of possible pointer wraparounds and integer overflows in the re module. Patch by Nickolai Zeldovich.
  • Issue #16658: add missing return to HTTPConnection.send() Patch by Jeff Knupp.
  • Issue #14971: unittest test discovery no longer gets confused when a function has a different __name__ than its name in the TestCase class dictionary.
  • Issue #17678: Fix DeprecationWarning in the http/cookiejar.py by changing the usage of get_origin_req_host() to origin_req_host.
  • Issue #17666: Fix reading gzip files with an extra field.
  • Issue #17502: Process DEFAULT values in mock side_effect that returns iterator. Patch by Michael Foord.
  • Issue #17572: Avoid chained exceptions while passing bad directives to time.strptime(). Initial patch by Claudiu Popa.
  • Issue #17435: threading.Timer’s __init__ method no longer uses mutable default values for the args and kwargs parameters.
  • Issue #17526: fix an IndexError raised while passing code without filename to inspect.findsource(). Initial patch by Tyler Doyle.
  • Issue #16550: Update the opcode descriptions of pickletools to use unsigned integers where appropriate. Initial patch by Serhiy Storchaka.
  • IDLE:
  • Issue #17838: Allow sys.stdin to be reassigned.
  • Issue #13495: Avoid loading the color delegator twice in IDLE.
  • Issue #17798: Allow IDLE to edit new files when specified on command line.
  • Issue #14735: Update IDLE docs to omit “Control-z on Windows”.
  • Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit().
  • Issue #17657: Show full Tk version in IDLE’s about dialog. Patch by Todd Rovito.
  • Issue #17613: Prevent traceback when removing syntax colorizer in IDLE.
  • Issue #1207589: Backwards-compatibility patch for right-click menu in IDLE.
  • Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
  • Issue #17625: In IDLE, close the replace dialog after it is used.
  • Issue #14254: IDLE now handles readline correctly across shell restarts.
  • Issue #17614: IDLE no longer raises exception when quickly closing a file.
  • Issue #6698: IDLE now opens just an editor window when configured to do so.
  • Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer raises an exception.
  • Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo.
  • Tests:
  • Issue #17833: Fix test_gdb failures seen on machines where debug symbols for glibc are available (seen on PPC64 Linux).
  • Issue #7855: Add tests for ctypes/winreg for issues found in IronPython. Initial patch by Dino Viehland.
  • Issue #17712: Fix test_gdb failures on Ubuntu 13.04.
  • Issue #17835: Fix test_io when the default OS pipe buffer size is larger than one million bytes.
  • Issue #17065: Use process-unique key for winreg tests to avoid failures if test is run multiple times in parallel (eg: on a buildbot host).
  • Issue #12820: add tests for the xml.dom.minicompat module. Patch by John Chandler and Phil Connell.
  • Issue #17790: test_set now works with unittest test discovery. Patch by Zachary Ware.
  • Issue #17789: test_random now works with unittest test discovery. Patch by Zachary Ware.
  • Issue #17779: test_osx_env now works with unittest test discovery. Patch by Zachary Ware.
  • Issue #17766: test_iterlen now works with unittest test discovery. Patch by Zachary Ware.
  • Issue #17690: test_time now works with unittest test discovery. Patch by Zachary Ware.
  • Issue #17692: test_sqlite now works with unittest test discovery. Patch by Zachary Ware.
  • Issue #17843: Removed bz2 test data file that was triggering false-positive virus warnings with certain antivirus software.
  • Documentation:
  • Issue #15940: Specify effect of locale on time functions.
  • Issue #6696: add documentation for the Profile objects, and improve profile/cProfile docs. Patch by Tom Pinckney.
  • Issue #17915: Fix interoperability of xml.sax with file objects returned by codecs.open().
  • Build:
  • Issue #17547: In configure, explicitly pass -Wformat for the benefit for GCC 4.8.
  • Issue #17962: Build with OpenSSL 1.0.1e on Windows.

New in Python 3.3.1 (Apr 8, 2013)

  • Build:
  • Issue #17550: Fix the –enable-profiling configure switch.
  • Library:
  • Issue #17625: In IDLE, close the replace dialog after it is used.

New in Python 3.3.0 (Oct 1, 2012)

  • PEP 380, syntax for delegating to a subgenerator (yield from)
  • PEP 393, flexible string representation (doing away with the distinction between "wide" and "narrow" Unicode builds)
  • A C implementation of the "decimal" module, with up to 120x speedup for decimal-heavy applications
  • The import system (__import__) is based on importlib by default
  • The new "lzma" module with LZMA/XZ support
  • PEP 397, a Python launcher for Windows
  • PEP 405, virtual environment support in core
  • PEP 420, namespace package support
  • PEP 3151, reworking the OS and IO exception hierarchy
  • PEP 3155, qualified name for classes and functions
  • PEP 409, suppressing exception context
  • PEP 414, explicit Unicode literals to help with porting
  • PEP 418, extended platform-independent clocks in the "time" module
  • PEP 412, a new key-sharing dictionary implementation that significantly saves memory for object-oriented code
  • PEP 362, the function-signature object
  • The new "faulthandler" module that helps diagnosing crashes
  • The new "unittest.mock" module
  • The new "ipaddress" module
  • The "sys.implementation" attribute
  • A policy framework for the email package, with a provisional (see PEP 411) policy that adds much improved unicode support for email header parsing
  • A "collections.ChainMap" class for linking mappings to a single unit
  • Wrappers for many more POSIX functions in the "os" and "signal" modules, as well as other useful functions such as "sendfile()"
  • Hash randomization, introduced in earlier bugfix releases, is now switched on by default

New in Python 3.3.0 Beta 1 (Aug 1, 2012)

  • Features:
  • All native single character format specifiers in struct module syntax (optionally prefixed with ‘@’) are now supported.
  • With some restrictions, the cast() method allows changing of format and shape of C-contiguous arrays.
  • Multi-dimensional list representations are supported for any array type.
  • Multi-dimensional comparisons are supported for any array type.
  • All array types are hashable if the exporting object is hashable and the view is read-only. (Contributed by Antoine Pitrou in issue 13411)
  • Arbitrary slicing of any 1-D arrays type is supported. For example, it is now possible to reverse a memoryview in O(1) by using a negative step.
  • API changes:
  • The maximum number of dimensions is officially limited to 64.
  • The representation of empty shape, strides and suboffsets is now an empty tuple instead of None.
  • Accessing a memoryview element with format ‘B’ (unsigned bytes) now returns an integer (in accordance with the struct module syntax). For returning a bytes object the view must be cast to ‘c’ first.
  • For further changes see Build and C API Changes and Porting C code.
  • Functionality:
  • Python now always supports the full range of Unicode codepoints, including non-BMP ones (i.e. from U+0000 to U+10FFFF). The distinction between narrow and wide builds no longer exists and Python now behaves like a wide build, even under Windows.
  • With the death of narrow builds, the problems specific to narrow builds have also been fixed, for example:
  • len() now always returns 1 for non-BMP characters, so len('\U0010FFFF') == 1;
  • surrogate pairs are not recombined in string literals, so '\uDBFF\uDFFF' != '\U0010FFFF';
  • indexing or slicing non-BMP characters returns the expected value, so '\U0010FFFF'[0] now returns '\U0010FFFF' and not '\uDBFF';
  • all other functions in the standard library now correctly handle non-BMP codepoints.
  • The value of sys.maxunicode is now always 1114111 (0x10FFFF in hexadecimal). The PyUnicode_GetMax() function still returns either 0xFFFF or 0x10FFFF for backward compatibility, and it should not be used with the new Unicode API (see issue 13054).
  • The ./configure flag --with-wide-unicode has been removed.

New in Python 3.2.3 (Apr 12, 2012)

  • numerous improvements to the unittest module
  • PEP 3147, support for .pyc repository directories
  • PEP 3149, support for version tagged dynamic libraries
  • PEP 3148, a new futures library for concurrent programming
  • PEP 384, a stable ABI for extension modules
  • PEP 391, dictionary-based logging configuration
  • an overhauled GIL implementation that reduces contention
  • an extended email package that handles bytes messages
  • a much improved ssl module with support for SSL contexts and certificate hostname matching
  • a sysconfig module to access configuration information
  • additions to the shutil module, among them archive file support
  • many enhancements to configparser, among them mapping protocol support
  • improvements to pdb, the Python debugger
  • countless fixes regarding bytes/string issues; among them full support for a bytes environment (filenames, environment variables)
  • many consistency and behavior fixes for numeric operations

New in Python 3.2.2 (Sep 5, 2011)

  • It mainly fixes a regression in the urllib.request module that prevented opening many HTTP resources correctly with Python 3.2.1.

New in Python 3.2.2 RC 1 (Aug 16, 2011)

  • numerous improvements to the unittest module
  • PEP 3147, support for .pyc repository directories
  • PEP 3149, support for version tagged dynamic libraries
  • PEP 3148, a new futures library for concurrent programming
  • PEP 384, a stable ABI for extension modules
  • PEP 391, dictionary-based logging configuration
  • an overhauled GIL implementation that reduces contention
  • an extended email package that handles bytes messages
  • a much improved ssl module with support for SSL contexts and certificate hostname matching
  • a sysconfig module to access configuration information
  • additions to the shutil module, among them archive file support
  • many enhancements to configparser, among them mapping protocol support
  • improvements to pdb, the Python debugger
  • countless fixes regarding bytes/string issues; among them full support for a bytes environment (filenames, environment variables)
  • many consistency and behavior fixes for numeric operations

New in Python 3.2.1 (Jul 11, 2011)

  • numerous improvements to the unittest module
  • PEP 3147, support for .pyc repository directories
  • PEP 3149, support for version tagged dynamic libraries
  • PEP 3148, a new futures library for concurrent programming
  • PEP 384, a stable ABI for extension modules
  • PEP 391, dictionary-based logging configuration
  • an overhauled GIL implementation that reduces contention
  • an extended email package that handles bytes messages
  • a much improved ssl module with support for SSL contexts and certificate hostname matching
  • a sysconfig module to access configuration information
  • additions to the shutil module, among them archive file support
  • many enhancements to configparser, among them mapping protocol support
  • improvements to pdb, the Python debugger
  • countless fixes regarding bytes/string issues; among them full support for a bytes environment (filenames, environment variables)
  • many consistency and behavior fixes for numeric operations

New in Python 3.2.1 RC 2 (Jul 4, 2011)

  • numerous improvements to the unittest module
  • PEP 3147, support for .pyc repository directories
  • PEP 3149, support for version tagged dynamic libraries
  • PEP 3148, a new futures library for concurrent programming
  • PEP 384, a stable ABI for extension modules
  • PEP 391, dictionary-based logging configuration
  • an overhauled GIL implementation that reduces contention
  • an extended email package that handles bytes messages
  • a much improved ssl module with support for SSL contexts and certificate hostname matching
  • a sysconfig module to access configuration information
  • additions to the shutil module, among them archive file support
  • many enhancements to configparser, among them mapping protocol support
  • improvements to pdb, the Python debugger
  • countless fixes regarding bytes/string issues; among them full support for a bytes environment (filenames, environment variables)
  • many consistency and behavior fixes for numeric operations

New in Python 3.2 RC 1 (Jan 17, 2011)

  • numerous improvements to the unittest module
  • PEP 3147, support for .pyc repository directories
  • PEP 3149, support for version tagged dynamic libraries
  • PEP 3148, a new futures library for concurrent programming
  • PEP 384, a stable ABI for extension modules
  • PEP 391, dictionary-based logging configuration
  • an overhauled GIL implementation that reduces contention
  • an extended email package that handles bytes messages
  • a much improved ssl module with support for SSL contexts and certificate hostname matching
  • a sysconfig module to access configuration information
  • additions to the shutil module, among them archive file support
  • many enhancements to configparser, among them mapping protocol support
  • improvements to pdb, the Python debugger
  • countless fixes regarding bytes/string issues; among them full support for a bytes environment (filenames, environment variables)
  • many consistency and behavior fixes for numeric operations

New in Python 3.1.3 Final (Dec 1, 2010)

  • Core and Builtins
  • Issue #10391: Don't dereference invalid memory in error messages in the ast module.
  • Library
  • Issue #10459: Update CJK character names to Unicode 5.1.
  • Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
  • Issue #6098: Don't claim DOM level 3 conformance in minidom.
  • Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty XML namespace attribute is encountered.
  • Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
  • created in modes 'a' or 'w' and then closed without adding any files. Raise
  • BadZipfile (rather than IOError) when opening small non-ZIP files.
  • Issue #4493: urllib.request adds '/' in front of path components which does not start with '/. Common behavior exhibited by browsers and other clients.
  • Issue #6378: idle.bat now runs with the appropriate Python version rather than the system default.
  • Issue #10407: Fix two NameErrors in distutils.
  • Issue #10198: fix duplicate header written to wave files when writeframes() is called without data.
  • Issue #10467: Fix BytesIO.readinto() after seeking into a position after the
  • end of the file.
  • Issue #1682942: configparser supports alternative option/value delimiters.
  • Build
  • Backport r83399 to allow test_distutils to pass on installed versions.
  • Issue #1303434: Generate ZIP file containing all PDBs (already done for rc1).
  • Stop packaging versioncheck tool (already done for rc1).
  • Accept Oracle Berkeley DB 4.8, 5.0 and 5.1 as backend for the dbm extension.
  • Tests
  • Issue #9424: Replace deprecated assert* methods in the Python test suite.
  • Documentation
  • Issue #10299: List the built-in functions in a table in functions.rst.

New in Python 3.2 Alpha 2 (Sep 6, 2010)

  • numerous improvements to the unittest module
  • PEP 3147, support for .pyc repository directories
  • an overhauled GIL implementation that reduces contention
  • many consistency and behavior fixes for numeric operations
  • countless fixes regarding string/unicode issues; among them full support for a bytes environment (filenames, environment variables)
  • a sysconfig module to access configuration information
  • a pure-Python implementation of the datetime module
  • additions to the shutil module, among them archive file support
  • improvements to pdb, the Python debugger

New in Python 2.7 Beta 2 (May 10, 2010)

  • An ordered dictionary type
  • New unittest features including test skipping and new assert methods.
  • A much faster io module
  • Automatic numbering of fields in the str.format() method
  • Float repr improvements backported from 3.x.
  • Tile support for Tkinter
  • A backport of the memoryview object from 3.x
  • Set literals
  • Set and dictionary comprehensions
  • Dictionary views
  • New syntax for nested with statements
  • The sysconfig module

New in Python 3.1.2 (Mar 22, 2010)

  • Core and Builtins:
  • Issue #7173: Generator finalization could invalidate sys.exc_info().
  • Library:
  • Issue #2698: The --compiler ignored was ignored for distutils' build_ext.
  • Issue #4961: Inconsistent/wrong result of askyesno function in tkMessageBox with Tcl/Tk-8.5.
  • Issue #7356: ctypes.util: Make parsing of ldconfig output independent of the locale.

New in Python 2.6.5 RC2 (Mar 11, 2010)

  • Python 2.6.5 is a maintenance release for Python 2.6.4, fixing dozens of issues in the core, builtin modules, libraries, and documentation. This is not a final release; it is the second release candidate for 2.6.5. Python 2.6.5 final is currently scheduled for March 19, 2010.
  • Python 2.6 is now in bugfix-only mode; no new features are being added.

New in Python 2.7 Alpha 3 (Feb 8, 2010)

  • An ordered dictionary type
  • New unittest features including test skipping and new assert methods.
  • A much faster io module
  • Automatic numbering of fields in the str.format() method
  • Float repr improvements backported from 3.x.
  • Tile support for Tkinter
  • A backport of the memoryview object from 3.x
  • Set literals
  • Dictionary views
  • New syntax for nested with statements
  • The sysconfig module

New in Python 2.7 Alpha 2 (Jan 11, 2010)

  • An ordered dictionary type
  • New unittest features including test skipping and new assert methods.
  • A much faster io module
  • Automatic numbering of fields in the str.format() method
  • Float repr improvements backported from 3.x.
  • Tile support for Tkinter
  • A backport of the memoryview object from 3.x
  • New syntax for nested with statements

New in Python 2.7 Alpha 1 (Dec 7, 2009)

  • An ordered dictionary type
  • New unittest features including test skipping and new assert methods.
  • A much faster io module
  • Automatic numbering of fields in the str.format() method
  • Float repr improvements backported from 3.x.
  • Tile support for Tkinter
  • A backport of the memoryview object from 3.x
  • New syntax for nested with statements

New in Python 2.6.4 RC1 (Oct 7, 2009)

  • Python 2.6.4 is a critical bug fix for Python 2.6.3, which had regressions in the logging package and in setuptools compatibility.

New in Python 2.6.3 (Oct 3, 2009)

  • We are pleased to announce the release of Python 2.6.3, a bugfix release of Python 2.6.2, on October 2, 2009.
  • Python 2.6 is now in bugfix-only mode; no new features are being added. Somewhere near 100 bugs have been fixed since the release of Python 2.6.2. The NEWS file lists every change in each alpha, beta, and release candidate of Python 2.6.

New in Python 3.1.1 (Aug 19, 2009)

  • Python 3.1 is a continuation of the work started by Python 3.0, the new backwards-incompatible series of Python. Improvements in this release include:
  • An ordered dictionary type
  • Various optimizations to the int type
  • New unittest features including test skipping and new assert methods.
  • A much faster io module
  • Tile support for Tkinter
  • A pure Python reference implementation of the import statement
  • New syntax for nested with statements

New in Python 3.1 RC1 (May 31, 2009)

  • Regular Python dictionaries iterate over key/value pairs in arbitrary order. Over the years, a number of authors have written alternative implementations that remember the order that the keys were originally inserted. Based on the experiences from those implementations, a new collections.OrderedDict class has been introduced.
  • The OrderedDict API is substantially the same as regular dictionaries but will iterate over keys and values in a guaranteed order depending on when a key was first inserted. If a new entry overwrites an existing entry, the original insertion position is left unchanged. Deleting an entry and reinserting it will move it to the end.
  • The standard library now supports use of ordered dictionaries in several modules. The configparser module uses them by default. This lets configuration files be read, modified, and then written back in their original order. The _asdict() method for collections.namedtuple() now returns an ordered dictionary with the values appearing in the same order as the underlying tuple indicies. The json module is being built-out with an object_pairs_hook to allow OrderedDicts to be built by the decoder. Support was also added for third-party tools like PyYAML.

New in Python 3.1 Beta 1 (May 8, 2009)

  • Core and Builtins
  • Issue #3382: float.__format__, complex.__format__, and %-formatting
  • no longer map 'F' to 'f'. Because of issue #5859 (below), this only
  • affects nan -> NAN and inf -> INF.
  • Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames
  • in all operations, including splitdrive, split, etc. splitunc() now issues
  • a PendingDeprecation warning.
  • Issue #5920: For float.__format__, change the behavior with the
  • empty presentation type (that is, not one of 'e', 'f', 'g', or 'n')
  • to be like 'g' but with at least one decimal point and with a
  • default precision of 12. Previously, the behavior the same but with
  • a default precision of 6. This more closely matches str(), and
  • reduces surprises when adding alignment flags to the empty
  • presentation type. This also affects the new complex.__format__ in
  • the same way.
  • Implement PEP 383, Non-decodable Bytes in System Character Interfaces.
  • Issue #5890: in subclasses of 'property' the __doc__ attribute was
  • shadowed by classtype's, even if it was None. property now
  • inserts the __doc__ into the subclass instance __dict__.
  • Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal
  • sequences. Patch by Nick Barnes and Victor Stinner.
  • Issue #3672: Reject surrogates in utf-8 codec; add surrogates error handler.
  • Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have
  • received a new method, detach(). detach() disconnects the underlying stream
  • from the buffer or text IO and returns it.
  • Issue #5859: Remove switch from '%f' to '%g'-style formatting for
  • floats with absolute value over 1e50. Also remove length
  • restrictions for float formatting: '%.67f' % 12.34 and '%.120e' %
  • .34 no longer raise an exception.
  • Issue #1588: Add complex.__format__. For example,
  • format(complex(1, 2./3), '.5') now produces a sensible result.
  • Issue #5864: Fix empty format code formatting for floats so that it
  • never gives more than the requested number of significant digits.
  • Issue #5793: Rationalize isdigit / isalpha / tolower, etc. Includes
  • new Py_ISDIGIT / Py_ISALPHA / Py_TOLOWER, etc. in pctypes.h.
  • Issue #5835: Deprecate PyOS_ascii_formatd.
  • Issue #4971: Fix titlecase for characters that are their own
  • titlecase, but not their own uppercase.
  • Issue #5283: Setting __class__ in __del__ caused a segfault.
  • Issue #5816: complex(repr(z)) now recovers z exactly, even when
  • z involves nans, infs or negative zeros.
  • Issue #3166: Make int -> float conversions correctly rounded.
  • Issue #1869 (and many duplicates): make round(x, n) correctly
  • rounded for a float x, by using the decimal binary conversions
  • from Python/dtoa.c. As a consequence, (e.g.) round(x, 2) now
  • consistently agrees with format(x, '.2f').
  • Issue #5787: object.__getattribute__(some_type, "__bases__") segfaulted on
  • some builtin types.
  • Issue #5772: format(1e100, '

New in Python 3.0.1 Final (Feb 14, 2009)

  • This is the first bugfix release of Python 3.0. Python 3.0 is now in bugfix-only mode; no new features are being added. Dozens of bugs that were reported since the release of 3.0 final have been fixed.
  • Python 3.0 (a.k.a. "Python 3000" or "Py3k") is a new version of the language that is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. Also, the standard library has been reorganized in a few prominent places

New in Python 3.0 Final (Dec 4, 2008)

  • Core and Builtins
  • Issue #3996: On Windows, the PyOS_CheckStack function would cause the
  • interpreter to abort ("Fatal Python error: Could not reset the stack!")
  • instead of throwing a MemoryError.
  • Issue #3689: The list reversed iterator now supports __length_hint__
  • instead of __len__. Behavior now matches other reversed iterators.
  • Issue #4367: Python would segfault during compiling when the unicodedata
  • module couldn't be imported and N escapes were present.
  • Fix build failure of _cursesmodule.c building with -D_FORTIFY_SOURCE=2.
  • Library
  • Issue #4387: binascii now refuses to accept str as binary input.
  • Issue #4073: Add 2to3 support to build_scripts, refactor that support
  • in build_py.
  • IDLE would print a "Unhandled server exception!" message when internal
  • debugging is enabled.
  • Issue #4455: IDLE failed to display the windows list when two windows have
  • the same title.
  • Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
  • exception.
  • Issue #4433: Fixed an access violation when garbage collecting
  • _ctypes.COMError instances.
  • Issue #4429: Fixed UnicodeDecodeError in ctypes.
  • Issue #4373: Corrected a potential reference leak in the pickle module and
  • silenced a false positive ref leak in distutils.tests.test_build_ext.
  • Issue #4382: dbm.dumb did not specify the expected file encoding for opened
  • files.
  • Issue #4383: When IDLE cannot make the connection to its subprocess, it would
  • fail to properly display the error message.
  • Build
  • Issue #4407: Fix source file that caused the compileall step in Windows
  • installer to fail.
  • Docs
  • Issue #4449: Fixed multiprocessing examples
  • Issue #3799: Document that dbm.gnu and dbm.ndbm will accept string arguments
  • for keys and values which will be converted to bytes before committal.

New in Python 3.0 RC2 / 2.6 (Nov 8, 2008)

  • Core and Builtins
  • -----------------
  • Issue #4211: The __path__ attribute of frozen packages is now a list instead
  • of a string as required by PEP 302.
  • Issue #3727: Fixed poplib.
  • Issue #3714: Fixed nntplib by using bytes where appropriate.
  • Issue #1210: Fixed imaplib and its documentation.
  • Issue #4233: Changed semantic of ``_fileio.FileIO``'s ``close()``
  • method on file objects with closefd=False. The file descriptor is still
  • kept open but the file object behaves like a closed file. The ``FileIO``
  • object also got a new readonly attribute ``closefd``.
  • Issue #3626: On cygwin, starting python with a non-existent script name
  • would not display anything if the file name is only 1 character long.
  • Issue #4176: Fixed a crash when pickling an object which ``__reduce__``
  • method does not return iterators for the 4th and 5th items.
  • Issue #3723: Fixed initialization of subinterpreters.
  • Issue #4213: The file system encoding is now normalized by the
  • codec subsystem, for example UTF-8 is turned into utf-8.
  • Issue #4200: Changed the atexit module to store its state in its
  • PyModuleDef atexitmodule. This fixes a bug with multiple subinterpeters.
  • Issue #4237: io.FileIO() was raising invalid warnings caused by
  • insufficient initialization of PyFileIOObject struct members.
  • Issue #4170: Pickling a collections.defaultdict object would crash the
  • interpreter.
  • Issue #4146: Compilation on OpenBSD has been restored.
  • Issue #3574: compile() incorrectly handled source code encoded as Latin-1.
  • Issues #2384 and #3975: Tracebacks were not correctly printed when the
  • source file contains a ``coding:`` header: the wrong line was displayed, and
  • the encoding was not respected.
  • Issue #3740: Null-initialize module state.
  • Issue #3946: PyObject_CheckReadBuffer crashed on a memoryview object.
  • Issue #1688: On Windows, the input() prompt was not correctly displayed if it
  • contains non-ascii characters.
  • Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default.
  • Library
  • Issue #3664: The pickle module could segfault if a subclass of Pickler fails
  • to call the base __init__ method.
  • Issue #3725: telnetlib now works completely in bytes.
  • Issue #4072: Restore build_py_2to3.
  • Issue #4014: Don't claim that Python has an Alpha release status, in addition
  • to claiming it is Mature.
  • Issue #3187: Add sys.setfilesystemencoding.
  • Issue #3187: Better support for "undecodable" filenames. Code by Victor Stinner, with small tweaks by GvR.
  • Issue #3965: Allow repeated calls to turtle.Screen, by making it a true singleton object.
  • Issue #3911: ftplib.FTP.makeport() could give invalid port numbers.
  • Issue #3929: When the database cannot be opened, dbm.open() would incorrectly raise a TypeError: "'tuple' object is not callable" instead of the expected dbm.error.
  • Bug #3884: Make the turtle module toplevel again.
  • Issue #3547: Fixed ctypes structures bitfields of varying integer sizes.
  • Extension Modules
  • Issue #3659: Subclasses of str didn't work as SQL parameters.
  • Build
  • Issue #4120: Exclude manifest from extension modules in VS2008.
  • Issue #4091: Install pythonxy.dll in system32 again.
  • Issue #4018: Disable "for me" installations on Vista.
  • Issue #4204: Fixed module build errors on FreeBSD 4.
  • Tools/Demos
  • Issue #3717: Fix Demo/embed/demo.c.
  • Issue #4072: Add a distutils demo for build_py_2to3.

New in Python 2.5.1 (Apr 20, 2007)

  • Revert SF #1615701: dict.update() does *not* call__getitem__() or keys() if subclassed. This is to remain consistent with 2.5. Also revert revision 53667 with made a similar change to set.update().