Python Changelog

What's new in Python 3.12.3

Apr 10, 2024
  • Security:
  • gh-115399: Update bundled libexpat to 2.6.0
  • gh-115243: Fix possible crashes in collections.deque.index() when the deque is concurrently modified.
  • gh-114572: ssl.SSLContext.cert_store_stats() and ssl.SSLContext.get_ca_certs() now correctly lock access to the certificate store, when the ssl.SSLContext is shared across multiple threads.
  • gh-115398: Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:
  • xml.etree.ElementTree.XMLParser.flush()
  • xml.etree.ElementTree.XMLPullParser.flush()
  • xml.parsers.expat.xmlparser.GetReparseDeferralEnabled()
  • xml.parsers.expat.xmlparser.SetReparseDeferralEnabled()
  • xml.sax.expatreader.ExpatParser.flush()
  • Core and Builtins:
  • gh-109120: Added handle of incorrect star expressions, e.g f(3, *). Patch by Grigoryev Semyon
  • gh-99108: Updated the hashlib built-in HACL* project C code from upstream that we use for many implementations when they are not present via OpenSSL in a given build. This also avoids the rare potential for a C symbol name one definition rule linking issue.
  • gh-116735: For INSTRUMENTED_CALL_FUNCTION_EX, set arg0 to sys.monitoring.MISSING instead of None for CALL event.
  • gh-113964: Starting new threads and process creation through os.fork() are now only prevented once all non-daemon threads exit.
  • gh-116604: Respect the status of the garbage collector when indirect calls are made via PyErr_CheckSignals() and the evaluation breaker. Patch by Pablo Galindo
  • gh-116626: Ensure INSTRUMENTED_CALL_FUNCTION_EX always emits CALL
  • gh-116296: Fix possible refleak in object.__reduce__() internal error handling.
  • gh-116034: Fix location of the error on a failed assertion.
  • gh-115823: Properly calculate error ranges in the parser when raising SyntaxError exceptions caused by invalid byte sequences. Patch by Pablo Galindo
  • gh-112087: For an empty reverse iterator for list will be reduced to reversed(). Patch by Donghee Na.
  • gh-115154: Fix a bug that was causing the tokenize.untokenize() function to handle unicode named literals incorrectly. Patch by Pablo Galindo
  • gh-114828: Fix compilation crashes in uncommon code examples using super() inside a comprehension in a class body.
  • gh-115011: Setters for members with an unsigned integer type now support the same range of valid values for objects that has a __index__() method as for int.
  • gh-112215: Change the C recursion limits to more closely reflect the underlying platform limits.
  • gh-96497: Fix incorrect resolution of mangled class variables used in assignment expressions in comprehensions.
  • Library:
  • gh-117467: Preserve mailbox ownership when rewriting in mailbox.mbox.flush(). Patch by Tony Mountifield.
  • gh-117310: Fixed an unlikely early & extra Py_DECREF triggered crash in ssl when creating a new _ssl._SSLContext if CPython was built implausibly such that the default cipher list is empty or the SSL library it was linked against reports a failure from its C SSL_CTX_set_cipher_list() API.
  • gh-117178: Fix regression in lazy loading of self-referential modules, introduced in gh-114781.
  • gh-117084: Fix zipfile extraction for directory entries with the name containing backslashes on Windows.
  • gh-117110: Fix a bug that prevents subclasses of typing.Any to be instantiated with arguments. Patch by Chris Fu.
  • gh-90872: On Windows, subprocess.Popen.wait() no longer calls WaitForSingleObject() with a negative timeout: pass 0 ms if the timeout is negative. Patch by Victor Stinner.
  • gh-116957: configparser: Don’t leave ConfigParser values in an invalid state (stored as a list instead of a str) after an earlier read raised DuplicateSectionError or DuplicateOptionError.
  • gh-90095: Ignore empty lines and comments in .pdbrc
  • gh-116764: Restore support of None and other false values in urllib.parse functions parse_qs() and parse_qsl(). Also, they now raise a TypeError for non-zero integers and non-empty sequences.
  • gh-116811: In PathFinder.invalidate_caches, delegate to MetadataPathFinder.invalidate_caches.
  • gh-116600: Fix repr() for global Flag members.
  • gh-116484: Change automatically generated tkinter.Checkbutton widget names to avoid collisions with automatically generated tkinter.ttk.Checkbutton widget names within the same parent widget.
  • gh-116401: Fix blocking os.fwalk() and shutil.rmtree() on opening named pipe.
  • gh-116143: Fix a race in pydoc _start_server, eliminating a window in which _start_server can return a thread that is “serving” but without a docserver set.
  • gh-116325: typing: raise SyntaxError instead of AttributeError on forward references as empty strings.
  • gh-90535: Fix support of interval values > 1 in logging.TimedRotatingFileHandler for when='MIDNIGHT' and when='Wx'.
  • gh-115978: Disable preadv(), readv(), pwritev(), and writev() on WASI.
  • Under wasmtime for WASI 0.2, these functions don’t pass test_posix (https://github.com/bytecodealliance/wasmtime/issues/7830).
  • gh-88352: Fix the computation of the next rollover time in the logging.TimedRotatingFileHandler handler. computeRollover() now always returns a timestamp larger than the specified time and works correctly during the DST change. doRollover() no longer overwrite the already rolled over file, saving from data loss when run at midnight or during repeated time at the DST change.
  • gh-87115: Set __main__.__spec__ to None when running a script with pdb
  • gh-76511: Fix UnicodeEncodeError in email.Message.as_string() that results when a message that claims to be in the ascii character set actually has non-ascii characters. Non-ascii characters are now replaced with the U+FFFD replacement character, like in the replace error handler.
  • gh-116040: [Enum] fix by-value calls when second value is falsey; e.g. Cardinal(1, 0)
  • gh-75988: Fixed unittest.mock.create_autospec() to pass the call through to the wrapped object to return the real result.
  • gh-115881: Fix issue where ast.parse() would incorrectly flag conditional context managers (such as with (x() if y else z()): ...) as invalid syntax if feature_version=(3, 8) was passed. This reverts changes to the grammar made as part of gh-94949.
  • gh-115886: Fix silent truncation of the name with an embedded null character in multiprocessing.shared_memory.SharedMemory.
  • gh-115809: Improve algorithm for computing which rolled-over log files to delete in logging.TimedRotatingFileHandler. It is now reliable for handlers without namer and with arbitrary deterministic namer that leaves the datetime part in the file name unmodified.
  • gh-74668: urllib.parse functions parse_qs() and parse_qsl() now support bytes arguments containing raw and percent-encoded non-ASCII data.
  • gh-67044: csv.writer() now always quotes or escapes 'r' and 'n', regardless of lineterminator value.
  • gh-115712: csv.writer() now quotes empty fields if delimiter is a space and skipinitialspace is true and raises exception if quoting is not possible.
  • gh-112364: Fixed ast.unparse() to handle format_spec with ", ' or \. Patched by Frank Hoffmann.
  • gh-111358: Fix a bug in asyncio.BaseEventLoop.shutdown_default_executor() to ensure the timeout passed to the coroutine behaves as expected.
  • gh-115618: Fix improper decreasing the reference count for None argument in property methods getter(), setter() and deleter().
  • gh-115570: A DeprecationWarning is no longer omitted on access to the __doc__ attributes of the deprecated typing.io and typing.re pseudo-modules.
  • gh-112006: Fix inspect.unwrap() for types with the __wrapper__ data descriptor.
  • gh-101293: Support callables with the __call__() method and types with __new__() and __init__() methods set to class methods, static methods, bound methods, partial functions, and other types of methods and descriptors in inspect.Signature.from_callable().
  • gh-115392: Fix a bug in doctest where incorrect line numbers would be reported for decorated functions.
  • gh-114563: Fix several format() bugs when using the C implementation of Decimal: * memory leak in some rare cases when using the z format option (coerce negative 0) * incorrect output when applying the z format option to type F (fixed-point with capital NAN / INF) * incorrect output when applying the # format option (alternate form)
  • gh-115197: urllib.request no longer resolves the hostname before checking it against the system’s proxy bypass list on macOS and Windows.
  • gh-115165: Most exceptions are now ignored when attempting to set the __orig_class__ attribute on objects returned when calling typing generic aliases (including generic aliases created using typing.Annotated). Previously only AttributeError was ignored. Patch by Dave Shawley.
  • gh-115133: Fix tests for XMLPullParser with Expat 2.6.0.
  • gh-115059: io.BufferedRandom.read1() now flushes the underlying write buffer.
  • gh-79382: Trailing ** no longer allows to match files and non-existing paths in recursive glob().
  • gh-114071: Support tuple subclasses using auto() for enum member value.
  • gh-114763: Protect modules loaded with importlib.util.LazyLoader from race conditions when multiple threads try to access attributes before the loading is complete.
  • gh-97959: Fix rendering class methods, bound methods, method and function aliases in pydoc. Class methods no longer have “method of builtins.type instance” note. Corresponding notes are now added for class and unbound methods. Method and function aliases now have references to the module or the class where the origin was defined if it differs from the current. Bound methods are now listed in the static methods section. Methods of builtin classes are now supported as well as methods of Python classes.
  • gh-112281: Allow creating union of types for typing.Annotated with unhashable metadata.
  • gh-111775: Fix importlib.resources.simple.ResourceHandle.open() for text mode, added missed stream argument.
  • gh-90095: Make .pdbrc and -c work with any valid pdb commands.
  • gh-107155: Fix incorrect output of help(x) where x is a lambda function, which has an __annotations__ dictionary attribute with a "return" key.
  • gh-105866: Fixed _get_slots bug which caused error when defining dataclasses with slots and a weakref_slot.
  • gh-60346: Fix ArgumentParser inconsistent with parse_known_args.
  • gh-100985: Update HTTPSConnection to consistently wrap IPv6 Addresses when using a proxy.
  • gh-100884: email: fix misfolding of comma in address-lists over multiple lines in combination with unicode encoding.
  • gh-95782: Fix io.BufferedReader.tell(), io.BufferedReader.seek(), _pyio.BufferedReader.tell(), io.BufferedRandom.tell(), io.BufferedRandom.seek() and _pyio.BufferedRandom.tell() being able to return negative offsets.
  • gh-96310: Fix a traceback in argparse when all options in a mutually exclusive group are suppressed.
  • gh-93205: Fixed a bug in logging.handlers.TimedRotatingFileHandler where multiple rotating handler instances pointing to files with the same name but different extensions would conflict and not delete the correct files.
  • bpo-44865: Add missing call to localization function in argparse.
  • bpo-43952: Fix multiprocessing.connection.Listener.accept() to accept empty bytes as authkey. Not accepting empty bytes as key causes it to hang indefinitely.
  • bpo-42125: linecache: get module name from __spec__ if available. This allows getting source code for the __main__ module when a custom loader is used.
  • gh-66543: Make mimetypes.guess_type() properly parsing of URLs with only a host name, URLs containing fragment or query, and filenames with only a UNC sharepoint on Windows. Based on patch by Dong-hee Na.
  • bpo-33775: Add ‘default’ and ‘version’ help text for localization in argparse.
  • Documentation:
  • gh-115399: Document CVE-2023-52425 of Expat

New in Python 3.12.1 (Feb 7, 2024)

  • Core and Builtins:
  • gh-112125: Fix None.__ne__(None) returning NotImplemented instead of False
  • gh-112625: Fixes a bug where a bytearray object could be cleared while iterating over an argument in the bytearray.join() method that could result in reading memory after it was freed.
  • gh-105967: Workaround a bug in Apple’s macOS platform zlib library where zlib.crc32() and binascii.crc32() could produce incorrect results on multi-gigabyte inputs. Including when using zipfile on zips containing large data.
  • gh-112356: Stopped erroneously deleting a LOAD_NULL bytecode instruction when optimized twice.
  • gh-111058: Change coro.cr_frame/gen.gi_frame to return None after the coroutine/generator has been closed. This fixes a bug where getcoroutinestate() and getgeneratorstate() return the wrong state for a closed coroutine/generator.
  • gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors. Patch by pablo Galindo
  • gh-112387: Fix error positions for decoded strings with backwards tokenize errors. Patch by Pablo Galindo
  • gh-112367: Avoid undefined behaviour when using the perf trampolines by not freeing the code arenas until shutdown. Patch by Pablo Galindo
  • gh-112243: Don’t include comments in f-string debug expressions. Patch by Pablo Galindo
  • gh-112266: Change docstrings of __dict__ and __weakref__.
  • gh-111654: Fix runtime crash when some error happens in opcode LOAD_FROM_DICT_OR_DEREF.
  • gh-109181: Speed up Traceback object creation by lazily compute the line number. Patch by Pablo Galindo
  • gh-102388: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 codecs read out of bounds
  • gh-111366: Fix an issue in the codeop that was causing SyntaxError exceptions raised in the presence of invalid syntax to not contain precise error messages. Patch by Pablo Galindo
  • gh-111380: Fix a bug that was causing SyntaxWarning to appear twice when parsing if invalid syntax is encountered later. Patch by Pablo galindo
  • gh-94438: Fix a regression that prevented jumping across is None and is not None when debugging. Patch by Savannah Ostrowski.
  • gh-110938: Fix error messages for indented blocks with functions and classes with generic type parameters. Patch by Pablo Galindo
  • gh-109894: Fixed crash due to improperly initialized static MemoryError in subinterpreter.
  • gh-110782: Fix crash when typing.TypeVar is constructed with a keyword argument. Patch by Jelle Zijlstra.
  • gh-110696: Fix incorrect error message for invalid argument unpacking. Patch by Pablo Galindo
  • gh-110543: Fix regression in Python 3.12 where types.CodeType.replace() would produce a broken code object if called on a module or class code object that contains a comprehension. Patch by Jelle Zijlstra.
  • gh-110514: Add PY_THROW to sys.setprofile() events
  • gh-110455: Guard assert(tstate->thread_id > 0) with #ifndef HAVE_PTHREAD_STUBS. This allows for for pydebug builds to work under WASI which (currently) lacks thread support.
  • gh-110259: Correctly identify the format spec in f-strings (with single or triple quotes) that have multiple lines in the expression part and include a formatting spec. Patch by Pablo Galindo
  • gh-110237: Fix missing error checks for calls to PyList_Append in _PyEval_MatchClass.
  • gh-109889: Fix the compiler’s redundant NOP detection algorithm to skip over NOPs with no line number when looking for the next instruction’s lineno.
  • gh-109853: sys.path[0] is now set correctly for subinterpreters.
  • gh-105716: Subinterpreters now correctly handle the case where they have threads running in the background. Before, such threads would interfere with cleaning up and destroying them, as well as prevent running another script.
  • gh-109793: The main thread no longer exits prematurely when a subinterpreter is cleaned up during runtime finalization. The bug was a problem particularly because, when triggered, the Python process would always return with a 0 exitcode, even if it failed.
  • gh-109596: Fix some tokens in the grammar that were incorrectly marked as soft keywords. Also fix some repeated rule names and ensure that repeated rules are not allowed. Patch by Pablo Galindo
  • gh-109351: Fix crash when compiling an invalid AST involving a named (walrus) expression.
  • gh-109216: Fix possible memory leak in BUILD_MAP.
  • 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-109052: Use the base opcode when comparing code objects to avoid interference from instrumentation
  • 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-106931: Statically allocated string objects are now interned globally instead of per-interpreter. This fixes a situation where such a string would only be interned in a single interpreter. Normal string objects are unaffected.
  • Library:
  • gh-79325: Fix an infinite recursion error in tempfile.TemporaryDirectory() cleanup on Windows.
  • gh-112645: Remove deprecation error on passing onerror to shutil.rmtree().
  • gh-112618: Fix a caching bug relating to typing.Annotated. Annotated[str, True] is no longer identical to Annotated[str, 1].
  • gh-112334: Fixed a performance regression in 3.12’s subprocess on Linux where it would no longer use the fast-path vfork() system call when it should have due to a logic bug, instead always falling back to the safe but slower fork().
  • Also fixed a related 3.12 security regression: If a value of extra_groups=[] was passed to subprocess.Popen or related APIs, the underlying setgroups(0, NULL) system call to clear the groups list would not be made in the child process prior to exec(). This has been assigned CVE-2023-6507.
  • This was identified via code inspection in the process of fixing the first bug.
  • gh-110190: Fix ctypes structs with array on Arm platform by setting MAX_STRUCT_SIZE to 32 in stgdict. Patch by Diego Russo.
  • gh-112578: Fix a spurious RuntimeWarning when executing the zipfile module.
  • gh-112509: Fix edge cases that could cause a key to be present in both the __required_keys__ and __optional_keys__ attributes of a typing.TypedDict. Patch by Jelle Zijlstra.
  • gh-112414: Fix regression in Python 3.12 where calling repr() on a module that had been imported using a custom loader could fail with AttributeError. Patch by Alex Waygood.
  • gh-112358: Revert change to struct.Struct initialization that broke some cases of subclassing.
  • gh-94722: Fix bug where comparison between instances of DocTest fails if one of them has None as its lineno.
  • gh-112105: Make readline.set_completer_delims() work with libedit
  • gh-111942: Fix SystemError in the TextIOWrapper constructor with non-encodable “errors” argument in non-debug mode.
  • gh-109538: Issue warning message instead of having RuntimeError be displayed when event loop has already been closed at StreamWriter.__del__().
  • gh-111942: Fix crashes in io.TextIOWrapper.reconfigure() when pass invalid arguments, e.g. non-string encoding.
  • gh-111460: curses: restore wide character support (including curses.unget_wch() and get_wch()) on macOS, which was unavailable due to a regression in Python 3.12.
  • gh-103791: contextlib.suppress now supports suppressing exceptions raised as part of a BaseExceptionGroup, in addition to the recent support for ExceptionGroup.
  • gh-111804: Remove posix.fallocate() under WASI as the underlying posix_fallocate() is not available in WASI preview2.
  • gh-111841: Fix truncating arguments on an embedded null character in os.putenv() and os.unsetenv() on Windows.
  • gh-111541: Fix doctest for SyntaxError not-builtin subclasses.
  • gh-110894: Call loop exception handler for exceptions in client_connected_cb of asyncio.start_server() so that applications can handle it. Patch by Kumar Aditya.
  • gh-111531: Fix reference leaks in bind_class() and bind_all() methods of tkinter widgets.
  • gh-111356: Added io.text_encoding(), io.DEFAULT_BUFFER_SIZE, and io.IncrementalNewlineDecoder to io.__all__.
  • gh-111342: Fixed typo in math.sumprod().
  • gh-68166: Remove mention of not supported “vsapi” element type in tkinter.ttk.Style.element_create(). Add tests for element_create() and other ttk.Style methods. Add examples for element_create() in the documentation.
  • gh-75666: Fix the behavior of tkinter widget’s unbind() method with two arguments. Previously, widget.unbind(sequence, funcid) destroyed the current binding for sequence, leaving sequence unbound, and deleted the funcid command. Now it removes only funcid from the binding for sequence, keeping other commands, and deletes the funcid command. It leaves sequence unbound only if funcid was the last bound command.
  • gh-79033: Another attempt at fixing asyncio.Server.wait_closed(). It now blocks until both conditions are true: the server is closed, and there are no more active connections. (This means that in some cases where in 3.12.0 this function would incorrectly have returned immediately, it will now block; in particular, when there are no active connections but the server hasn’t been closed yet.)
  • gh-111295: Fix time not checking for errors when initializing.
  • gh-111253: Add error checking during _socket module init.
  • gh-111251: Fix _blake2 not checking for errors when initializing.
  • gh-111174: Fix crash in io.BytesIO.getbuffer() called repeatedly for empty BytesIO.
  • gh-111187: Postpone removal version for locale.getdefaultlocale() to Python 3.15.
  • gh-111159: Fix doctest output comparison for exceptions with notes.
  • gh-110910: Fix invalid state handling in asyncio.TaskGroup and asyncio.Timeout. They now raise proper RuntimeError if they are improperly used and are left in consistent state after this.
  • gh-111092: Make turtledemo run without default root enabled.
  • gh-110488: Fix a couple of issues in pathlib.PurePath.with_name(): a single dot was incorrectly considered a valid name, and in PureWindowsPath, a name with an NTFS alternate data stream, like a:b, was incorrectly considered invalid.
  • gh-110392: Fix tty.setraw() and tty.setcbreak(): previously they returned partially modified list of the original tty attributes. tty.cfmakeraw() and tty.cfmakecbreak() now make a copy of the list of special characters before modifying it.
  • gh-110590: Fix a bug in _sre.compile() where TypeError would be overwritten by OverflowError when the code argument was a list of non-ints.
  • gh-65052: Prevent pdb from crashing when trying to display undisplayable objects
  • gh-110519: Deprecation warning about non-integer number in gettext now alwais refers to the line in the user code where gettext function or method is used. Previously it could refer to a line in gettext code.
  • gh-110395: Ensure that select.kqueue() objects correctly appear as closed in forked children, to prevent operations on an invalid file descriptor.
  • gh-110378: contextmanager() and asynccontextmanager() context managers now close an invalid underlying generator object that yields more then one value.
  • gh-110365: Fix termios.tcsetattr() bug that was overwritting existing errors during parsing integers from term list.
  • gh-109653: Fix a Python 3.12 regression in the import time of random. Patch by Alex Waygood.
  • gh-110196: Add __reduce__ method to IPv6Address in order to keep scope_id
  • 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-109747: Improve errors for unsupported look-behind patterns. Now re.error is raised instead of OverflowError or RuntimeError for too large width of look-behind pattern.
  • gh-109818: Fix reprlib.recursive_repr() not copying __type_params__ from decorated function.
  • gh-109047: concurrent.futures: The executor manager thread now catches exceptions when adding an item to the call queue. During Python finalization, creating a new thread can now raise RuntimeError. Catch the exception and call terminate_broken() in this case. Patch by Victor Stinner.
  • gh-109782: Ensure the signature of os.path.isdir() is identical on all platforms. Patch by Amin Alaee.
  • gh-109590: shutil.which() will prefer files with an extension in PATHEXT if the given mode includes os.X_OK on win32. If no PATHEXT match is found, a file without an extension in PATHEXT can be returned. This change will have shutil.which() act more similarly to previous behavior in Python 3.11.
  • gh-109786: Fix possible reference leaks and crash when re-enter the __next__() method of itertools.pairwise.
  • 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-108791: Improved error handling in pdb command line interface, making it produce more concise error messages.
  • gh-105829: Fix concurrent.futures.ProcessPoolExecutor deadlock
  • gh-106584: Fix exit code for unittest if all tests are skipped. Patch by Egor Eliseev.
  • gh-102956: Fix returning of empty byte strings after seek in zipfile module
  • gh-84867: unittest.TestLoader no longer loads test cases from exact unittest.TestCase and unittest.FunctionTestCase classes.
  • gh-91133: Fix a bug in tempfile.TemporaryDirectory cleanup, which now no longer dereferences symlinks when working around file system permission errors.
  • gh-73561: Omit the interface scope from an IPv6 address when used as Host header by http.client.
  • gh-86826: zipinfo now supports the full range of values in the TZ string determined by RFC 8536 and detects all invalid formats. Both Python and C implementations now raise exceptions of the same type on invalid data.
  • bpo-43153: On Windows, tempfile.TemporaryDirectory previously masked a PermissionError with NotADirectoryError during directory cleanup. It now correctly raises PermissionError if errors are not ignored. Patch by Andrei Kulakov and Ken Jin.
  • bpo-35332: The shutil.rmtree() function now ignores errors when calling os.close() when ignore_errors is True, and os.close() no longer retried after error.
  • bpo-41422: Fixed memory leaks of pickle.Pickler and pickle.Unpickler involving cyclic references via the internal memo mapping.
  • bpo-40262: The ssl.SSLSocket.recv_into() method no longer requires the buffer argument to implement __len__ and supports buffers with arbitrary item size.
  • Documentation:
  • gh-111699: Relocate smtpd deprecation notice to its own section rather than under locale in What’s New in Python 3.12 document
  • gh-108826: dis module command-line interface is now mentioned in documentation.
  • Tests:
  • gh-112769: The tests now correctly compare zlib version when zlib.ZLIB_RUNTIME_VERSION contains non-integer suffixes. For example zlib-ng defines the version as 1.3.0.zlib-ng.
  • gh-110367: Make regrtest --verbose3 option compatible with --huntrleaks -jN options. The ./python -m test -j1 -R 3:3 --verbose3 command now works as expected. Patch by Victor Stinner.
  • gh-111165: Remove no longer used functions run_unittest() and run_doctest() from the test.support module.
  • gh-110932: Fix regrtest if the SOURCE_DATE_EPOCH environment variable is defined: use the variable value as the random seed. Patch by Victor Stinner.
  • gh-110995: test_gdb: Fix detection of gdb built without Python scripting support. Patch by Victor Stinner.
  • gh-110918: Test case matching patterns specified by options --match, --ignore, --matchfile and --ignorefile are now tested in the order of specification, and the last match determines whether the test case be run or ignored.
  • gh-110647: Fix test_stress_modifying_handlers() of test_signal. Patch by Victor Stinner.
  • gh-103053: Fix test_tools.test_freeze on FreeBSD: run “make distclean” instead of “make clean” in the copied source directory to remove also the “python” program. Patch by Victor Stinner.
  • gh-110167: Fix a deadlock in test_socket when server fails with a timeout but the client is still running in its thread. Don’t hold a lock to call cleanup functions in doCleanups(). One of the cleanup function waits until the client completes, whereas the client could deadlock if it called addCleanup() in such situation. Patch by Victor Stinner.
  • gh-110388: Add tests for tty.
  • gh-81002: Add tests for termios.
  • gh-110267: Add tests for pickling and copying PyStructSequence objects. Patched by Xuehai Pan.
  • 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-109974: Fix race conditions in test_threading lock tests. Wait until a condition is met rather than using time.sleep() with a hardcoded number of seconds. 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-109972: Split test_gdb.py file into a test_gdb package made of multiple tests, so tests can now be run 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-109580: Skip test_perf_profiler if Python is built with ASAN, MSAN or UBSAN sanitizer. Python does crash randomly in this test on such build. 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-108927: Fixed order dependence in running tests in the same process when a test that has submodules (e.g. test_importlib) follows a test that imports its submodule (e.g. test_importlib.util) and precedes a test (e.g. test_unittest or test_compileall) that uses that submodule.
  • Build:
  • gh-112088: Add Tools/build/regen-configure.sh script to regenerate the configure with an Ubuntu container image. The quay.io/tiran/cpython_autoconf:271 container image (tiran/cpython_autoconf) is no longer used. Patch by Victor Stinner.
  • gh-111046: For wasi-threads, memory is now exported to fix compatibility issues with some wasm runtimes.
  • gh-103053: “make check-clean-src” now also checks if the “python” program is found in the source directory: fail with an error if it does exist. Patch by Victor Stinner.
  • gh-109191: Fix compile error when building with recent versions of libedit.
  • Windows:
  • gh-111856: Fixes fstat() on file systems that do not support file ID requests. This includes FAT32 and exFAT.
  • gh-111293: Fix os.DirEntry.inode dropping higher 64 bits of a file id on some filesystems on Windows.
  • gh-110913: WindowsConsoleIO now correctly chunks large buffers without splitting up UTF-8 sequences.
  • gh-110437: Allows overriding the source of VC redistributables so that releases can be guaranteed to never downgrade between updates.
  • gh-109286: Update Windows installer to use SQLite 3.43.1.
  • macOS
  • gh-109981: Use /dev/fd on macOS to determine the number of open files in test.support.os_helper.fd_count to avoid a crash with “guarded” file descriptors when probing for open files.
  • gh-110950: Update macOS installer to include an upstream Tcl/Tk fix for the Secure coding is not enabled for restorable state! warning encountered in Tkinter on macOS 14 Sonoma.
  • gh-111015: Ensure that IDLE.app and Python Launcher.app are installed with appropriate permissions on macOS builds.
  • gh-109286: Update macOS installer to use SQLite 3.43.1.
  • gh-71383: Update macOS installer to include an upstream Tcl/Tk fix for the ttk::ThemeChanged error encountered in Tkinter.
  • gh-92603: Update macOS installer to include a fix accepted by upstream Tcl/Tk for a crash encountered after the first tkinter.Tk() instance is destroyed.
  • IDLE:
  • bpo-35668: Add docstrings to the IDLE debugger module. Fix two bugs: initialize Idb.botframe (should be in Bdb); in Idb.in_rpc_code, check whether prev_frame is None before trying to use it. Greatly expand test_debugger.
  • C API:
  • gh-106560: Fix redundant declarations in the public C API. Declare PyBool_Type and PyLong_Type only once. Patch by Victor Stinner.
  • gh-112438: Fix support of format units “es”, “et”, “es#”, and “et#” in nested tuples in PyArg_ParseTuple()-like functions.
  • gh-109521: PyImport_GetImporter() now sets RuntimeError if it fails to get sys.path_hooks or sys.path_importer_cache or they are not list and dict correspondingly. Previously it could return NULL without setting error in obscure cases, crash or raise SystemError if these attributes have wrong type.

New in Python 3.12.0 (Oct 5, 2023)

  • Core and Builtins:
  • gh-109823: Fix bug where compiler does not adjust labels when removing an empty basic block which is a jump target.
  • gh-109719: Fix missing jump target labels when compiler reorders cold/warm blocks.
  • gh-109627: Fix bug where the compiler does not assign a new jump target label to a duplicated small exit block.
  • Library:
  • gh-110045: Update the symtable module to support the new scopes introduced by PEP 695.
  • Documentation:
  • gh-109209: The minimum Sphinx version required for the documentation is now 4.2.
  • Windows:
  • gh-109991: Update Windows build to use OpenSSL 3.0.11.
  • macOS:
  • gh-109991: Update macOS installer to use OpenSSL 3.0.11.
  • 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.11.4 (Jun 7, 2023)

  • Security:
  • gh-103142: The version of OpenSSL used in our binary builds has been upgraded to 1.1.1u to address several CVEs.
  • gh-99889: Fixed a security in flaw in uu.decode() that could allow for directory traversal based on the input if no out_file was specified.
  • gh-104049: Do not expose the local on-disk location in directory indexes produced by http.client.SimpleHTTPRequestHandler.
  • gh-102153: urllib.parse.urlsplit() now strips leading C0 control and space characters following the specification for URLs defined by WHATWG in response to CVE-2023-24329. Patch by Illia Volochii.
  • Core and Builtins:
  • gh-105164: Ensure annotations are set up correctly if the only annotation in a block is within a match block. Patch by Jelle Zijlstra.
  • gh-104615: Fix wrong ordering of assignments in code like a, a = x, y. Contributed by Carl Meyer.
  • gh-104482: Fix three error handling bugs in ast.c’s validation of pattern matching statements.
  • gh-102818: Do not add a frame to the traceback in the sys.setprofile and sys.settrace trampoline functions. This ensures that frames are not duplicated if an exception is raised in the callback function, and ensures that frames are not omitted if a C callback is used and that does not add the frame.
  • gh-104405: Fix an issue where some bytecode instructions could ignore PEP 523 when “inlining” calls.
  • gh-104018: Disallow the “z” format specifier in %-format of bytes objects.
  • gh-103971: Fix an issue where incorrect locations numbers could be assigned to code following case blocks.
  • gh-102310: Change the error range for invalid bytes literals.
  • gh-103590: Do not wrap a single exception raised from a try-except* construct in an ExceptionGroup.
  • gh-101517: Fix bug in line numbers of instructions emitted for except*.
  • gh-103242: Migrate set_ecdh_curve() method not to use deprecated OpenSSL APIs. Patch by Dong-hee Na.
  • gh-102700: Allow built-in modules to be submodules. This allows submodules to be statically linked into a CPython binary.
  • gh-101857: Fix xattr support detection on Linux systems by widening the check to linux, not just glibc. This fixes support for musl.
  • gh-99184: Bypass instance attribute access of __name__ in repr of weakref.ref.
  • gh-96670: The parser now raises SyntaxError when parsing source code containing null bytes. Backported from aab01e3. Patch by Pablo Galindo
  • bpo-31821: Fix pause_reading() to work when called from connection_made() in asyncio.
  • Library:
  • gh-105080: Fixed inconsistent signature on derived classes for inspect.signature()
  • gh-104874: Document the __name__ and __supertype__ attributes of typing.NewType. Patch by Jelle Zijlstra.
  • gh-104340: When an asyncio pipe protocol loses its connection due to an error, and the caller doesn’t await wait_closed() on the corresponding StreamWriter, don’t log a warning about an exception that was never retrieved. After all, according to the StreamWriter.close() docs, the wait_closed() call is optional (“not mandatory”).
  • gh-104372: Refactored the _posixsubprocess internals to avoid Python C API usage between fork and exec when marking pass_fds= file descriptors inheritable.
  • gh-75367: Fix data descriptor detection in inspect.getattr_static().
  • gh-104536: Fix a race condition in the internal multiprocessing.process cleanup logic that could manifest as an unintended AttributeError when calling process.close().
  • gh-104307: socket.getnameinfo() now releases the GIL while contacting the DNS server
  • gh-87695: Fix issue where pathlib.Path.glob() raised OSError when it encountered a symlink to an overly long path.
  • gh-104265: Prevent possible crash by disallowing instantiation of the _csv.Reader and _csv.Writer types. The regression was introduced in 3.10.0a4 with PR 23224 (bpo-14935). Patch by Radislav Chugunov.
  • gh-104035: Do not ignore user-defined __getstate__ and __setstate__ methods for slotted frozen dataclasses.
  • gh-103987: In mmap, fix several bugs that could lead to access to memory-mapped files after they have been invalidated.
  • gh-103935: Use io.open_code() for files to be executed instead of raw open()
  • gh-100370: Fix potential OverflowError in sqlite3.Connection.blobopen() for 32-bit builds. Patch by Erlend E. Aasland.
  • gh-103848: Add checks to ensure that [ bracketed ] hosts found by urllib.parse.urlsplit() are of IPv6 or IPvFuture format.
  • gh-103872: Update the bundled copy of pip to version 23.1.2.
  • gh-103861: Fix zipfile.Zipfile creating invalid zip files when force_zip64 was used to add files to them. Patch by Carey Metcalfe.
  • gh-103685: Prepare tkinter.Menu.index() for Tk 8.7 so that it does not raise TclError: expected integer but got "" when it should return None.
  • gh-81403: urllib.request.CacheFTPHandler no longer raises URLError if a cached FTP instance is reused. ftplib’s endtransfer method calls voidresp to drain the connection to handle FTP instance reuse properly.
  • gh-103578: Fixed a bug where pdb crashes when reading source file with different encoding by replacing io.open() with io.open_code(). The new method would also call into the hook set by PyFile_SetOpenCodeHook().
  • gh-103556: Now creating inspect.Signature objects with positional-only parameter with a default followed by a positional-or-keyword parameter without one is impossible.
  • gh-103559: Update the bundled copy of pip to version 23.1.1.
  • gh-103365: Set default Flag boundary to STRICT and fix bitwise operations.
  • gh-103472: Avoid a potential ResourceWarning in http.client.HTTPConnection by closing the proxy / tunnel’s CONNECT response explicitly.
  • gh-103449: Fix a bug in doc string generation in dataclasses.dataclass().
  • gh-103256: Fixed a bug that caused hmac to raise an exception when the requested hash algorithm was not available in OpenSSL despite being available separately as part of hashlib itself. It now falls back properly to the built-in. This could happen when, for example, your OpenSSL does not include SHA3 support and you want to compute hmac.digest(b'K', b'M', 'sha3_256').
  • gh-103225: Fix a bug in pdb when displaying line numbers of module-level source code.
  • gh-93910: Remove deprecation of enum memmber.member access.
  • gh-102978: Fixes unittest.mock.patch() not enforcing function signatures for methods decorated with @classmethod or @staticmethod when patch is called with autospec=True.
  • gh-103204: Fixes http.server accepting HTTP requests with HTTP version numbers preceded by ‘+’, or ‘-’, or with digit-separating ‘_’ characters. The length of the version numbers is also constrained.
  • gh-102953: The extraction methods in tarfile, and shutil.unpack_archive(), have a new a filter argument that allows limiting tar features than may be surprising or dangerous, such as creating files outside the destination directory. See Extraction filters for details.
  • gh-101640: argparse.ArgumentParser now catches errors when writing messages, such as when sys.stderr is None. Patch by Oleg Iarygin.
  • gh-96522: Fix potential deadlock in pty.spawn()
  • gh-87474: Fix potential file descriptor leaks in subprocess.Popen.
  • Documentation:
  • gh-89455: Add missing documentation for the max_group_depth and max_group_width parameters and the exceptions attribute of the traceback.TracebackException class.
  • gh-89412: Add missing documentation for the end_lineno and end_offset attributes of the traceback.TracebackException class.
  • gh-104943: Remove mentions of old Python versions in typing.NamedTuple.
  • gh-67056: Document that the effect of registering or unregistering an atexit cleanup function from within a registered cleanup function is undefined.
  • gh-48241: Clarifying documentation about the url parameter to urllib.request.urlopen and urllib.request.Requst needing to be encoded properly.
  • Tests:
  • gh-104494: Update test_pack_configure_in and test_place_configure_in for changes to error message formatting in Tk 8.7.
  • gh-104461: Run test_configure_screen on X11 only, since the DISPLAY environment variable and -screen option for toplevels are not useful on Tk for Win32 or Aqua.
  • gh-103329: Regression tests for the behaviour of unittest.mock.PropertyMock were added.
  • gh-85984: Utilize new “winsize” functions from termios in pty tests.
  • gh-75729: Fix the os.spawn* tests failing on Windows when the working directory or interpreter path contains spaces.
  • Build:
  • gh-90005: Fix a regression in configure where we could end up unintentionally linking with libbsd.
  • gh-104106: Add gcc fallback of mkfifoat/mknodat for macOS. Patch by Dong-hee Na.
  • gh-99069: Extended workaround defining static_assert when missing from the libc headers to all clang and gcc builds. In particular, this fixes building on macOS

New in Python 3.11.3 (Apr 7, 2023)

  • Security:
  • gh-101727: Updated the OpenSSL version used in Windows and macOS binary release builds to 1.1.1t to address CVE-2023-0286, CVE-2022-4303, and CVE-2022-4303 per the OpenSSL 2023-02-07 security advisory.
  • gh-101283: subprocess.Popen now uses a safer approach to find cmd.exe when launching with shell=True. Patch by Eryk Sun, based on a patch by Oleg Iarygin.
  • Core and Builtins:
  • gh-101975: Fixed stacktop value on tracing entries to avoid corruption on garbage collection.
  • gh-102701: Fix overflow when creating very large dict.
  • gh-102416: Do not memoize incorrectly automatically generated loop rules in the parser. Patch by Pablo Galindo.
  • gh-102356: Fix a bug that caused a crash when deallocating deeply nested filter objects. Patch by Marta Gómez Macías.
  • gh-102397: Fix segfault from race condition in signal handling during garbage collection. Patch by Kumar Aditya.
  • gh-102281: Fix potential nullptr dereference and use of uninitialized memory in fileutils. Patch by Max Bachmann.
  • gh-102126: Fix deadlock at shutdown when clearing thread states if any finalizer tries to acquire the runtime head lock. Patch by Kumar Aditya.
  • gh-102027: Fix SSE2 and SSE3 detection in _blake2 internal module. Patch by Max Bachmann.
  • gh-101967: Fix possible segfault in positional_only_passed_as_keyword function, when new list created.
  • gh-101765: Fix SystemError / segmentation fault in iter __reduce__ when internal access of builtins.__dict__ keys mutates the iter object.
  • gh-101696: Invalidate type version tag in _PyStaticType_Dealloc for static types, avoiding bug where a false cache hit could crash the interpreter. Patch by Kumar Aditya.
  • Library:
  • gh-102549: Don’t ignore exceptions in member type creation.
  • gh-102947: Improve traceback when dataclasses.fields() is called on a non-dataclass. Patch by Alex Waygood
  • gh-102780: The asyncio.Timeout context manager now works reliably even when performing cleanup due to task cancellation. Previously it could raise a CancelledError instead of an TimeoutError in such cases.
  • gh-88965: typing: Fix a bug relating to substitution in custom classes generic over a ParamSpec. Previously, if the ParamSpec was substituted with a parameters list that itself contained a TypeVar, the TypeVar in the parameters list could not be subsequently substituted. This is now fixed.
  • Patch by Nikita Sobolev.
  • gh-101979: Fix a bug where parentheses in the metavar argument to argparse.ArgumentParser.add_argument() were dropped. Patch by Yeojin Kim.
  • gh-102179: Fix os.dup2() error message for negative fds.
  • gh-101961: For the binary mode, fileinput.hookcompressed() doesn’t set the encoding value even if the value is None. Patch by Gihwan Kim.
  • gh-101936: The default value of fp becomes io.BytesIO if HTTPError is initialized without a designated fp parameter. Patch by Long Vo.
  • gh-102069: Fix __weakref__ descriptor generation for custom dataclasses.
  • gh-101566: In zipfile, apply fix for extractall on the underlying zipfile after being wrapped in Path.
  • gh-101892: Callable iterators no longer raise SystemError when the callable object exhausts the iterator but forgets to either return a sentinel value or raise StopIteration.
  • gh-97786: Fix potential undefined behaviour in corner cases of floating-point-to-time conversions.
  • gh-101517: Fixed bug where bdb looks up the source line with linecache with a lineno=None, which causes it to fail with an unhandled exception.
  • gh-101673: Fix a pdb bug where ll clears the changes to local variables.
  • gh-96931: Fix incorrect results from ssl.SSLSocket.shared_ciphers()
  • gh-88233: Correctly preserve “extra” fields in zipfile regardless of their ordering relative to a zip64 “extra.”
  • gh-96127: inspect.signature was raising TypeError on call with mock objects. Now it correctly returns (*args, **kwargs) as infered signature.
  • gh-95495: When built against OpenSSL 3.0, the ssl module had a bug where it reported unauthenticated EOFs (i.e. without close_notify) as a clean TLS-level EOF. It now raises SSLEOFError, matching the behavior in previous versions of OpenSSL. The options attribute on SSLContext also no longer includes OP_IGNORE_UNEXPECTED_EOF by default. This option may be set to specify the previous OpenSSL 3.0 behavior.
  • gh-94440: Fix a concurrent.futures.process bug where ProcessPoolExecutor shutdown could hang after a future has been quickly submitted and canceled.
  • Documentation:
  • gh-103112: Add docstring to http.client.HTTPResponse.read() to fix pydoc output.
  • gh-85417: Update cmath documentation to clarify behaviour on branch cuts.
  • gh-97725: Fix asyncio.Task.print_stack() description for file=None. Patch by Oleg Iarygin.
  • Tests:
  • gh-102980: Improve test coverage on pdb.
  • gh-102537: Adjust the error handling strategy in test_zoneinfo.TzPathTest.python_tzpath_context. Patch by Paul Ganssle.
  • gh-89792: test_tools now copies up to 10x less source data to a temporary directory during the freeze test by ignoring git metadata and other artifacts. It also limits its python build parallelism based on os.cpu_count instead of hard coding it as 8 cores.
  • gh-101377: Improved test_locale_calendar_formatweekday of calendar.
  • Build:
  • gh-102711: Fix -Wstrict-prototypes compiler warnings.
  • Windows:
  • gh-101849: Ensures installer will correctly upgrade existing py.exe launcher installs.
  • gh-101763: Updates copy of libffi bundled with Windows installs to 3.4.4.
  • gh-101759: Update Windows installer to SQLite 3.40.1.
  • gh-101614: Correctly handle extensions built against debug binaries that reference python3_d.dll.
  • macOS:
  • gh-103207: Add instructions to the macOS installer welcome display on how to workaround the macOS 13 Ventura “The installer encountered an error” failure.
  • gh-101759: Update macOS installer to SQLite 3.40.1.

New in Python 3.11.2 (Apr 7, 2023)

  • Core and Builtins:
  • gh-92173: Fix the defs and kwdefs arguments to PyEval_EvalCodeEx() and a reference leak in that function.
  • gh-101400: Fix wrong lineno in exception message on continue or break which are not in a loop. Patch by Dong-hee Na.
  • gh-101372: Fix is_normalized() to properly handle the UCD 3.2.0 cases. Patch by Dong-hee Na.
  • gh-101046: Fix a possible memory leak in the parser when raising MemoryError. Patch by Pablo Galindo
  • gh-101037: Fix potential memory underallocation issue for instances of int subclasses with value zero.
  • gh-100942: Fixed segfault in property.getter/setter/deleter that occurred when a property subclass overrode the __new__ method to return a non-property instance.
  • gh-100892: Fix race while iterating over thread states in clearing threading.local. Patch by Kumar Aditya.
  • gh-100776: Fix misleading default value in input()’s __text_signature__.
  • gh-100637: Fix int.__sizeof__() calculation to include the 1 element ob_digit array for 0 and False.
  • gh-100649: Update the native_thread_id field of PyThreadState after fork.
  • gh-100374: Fix incorrect result and delay in socket.getfqdn(). Patch by Dominic Socular.
  • gh-99110: Initialize frame->previous in frameobject.c to fix a segmentation fault when accessing frames created by PyFrame_New().
  • gh-100050: Honor existing errors obtained when searching for mismatching parentheses in the tokenizer. Patch by Pablo Galindo
  • bpo-32782: ctypes arrays of length 0 now report a correct itemsize when a memoryview is constructed from them, rather than always giving a value of 0.
  • Library:
  • gh-101541: [Enum] - fix psuedo-flag creation
  • gh-101326: Fix regression when passing None as second or third argument to FutureIter.throw.
  • gh-100795: Avoid potential unexpected freeaddrinfo call (double free) in socket when when a libc getaddrinfo() implementation leaves garbage in an output pointer when returning an error. Original patch by Sergey G. Brester.
  • gh-101143: Remove unused references to TimerHandle in asyncio.base_events.BaseEventLoop._add_callback.
  • gh-101144: Make zipfile.Path.open() and zipfile.Path.read_text() also accept encoding as a positional argument. This was the behavior in Python 3.9 and earlier. 3.10 introduced a regression where supplying it as a positional argument would lead to a TypeError.
  • gh-101015: Fix typing.get_type_hints() on '*tuple[...]' and *tuple[...]. It must not drop the Unpack part.
  • gh-100573: Fix a Windows asyncio bug with named pipes where a client doing os.stat() on the pipe would cause an error in the server that disabled serving future requests.
  • gh-100805: Modify random.choice() implementation to once again work with NumPy arrays.
  • gh-90104: Avoid RecursionError on repr if a dataclass field definition has a cyclic reference.
  • gh-100750: pass encoding kwarg to subprocess in platform
  • gh-100689: Fix crash in pyexpat by statically allocating PyExpat_CAPI capsule.
  • gh-100740: Fix unittest.mock.Mock not respecting the spec for attribute names prefixed with assert.
  • gh-86508: Fix asyncio.open_connection() to skip binding to local addresses of different family. Patch by Kumar Aditya.
  • gh-100287: Fix the interaction of unittest.mock.seal() with unittest.mock.AsyncMock.
  • gh-100474: http.server now checks that an index page is actually a regular file before trying to serve it. This avoids issues with directories named index.html.
  • gh-100160: Remove any deprecation warnings in asyncio.get_event_loop(). They are deferred to Python 3.12.
  • gh-96290: Fix handling of partial and invalid UNC drives in ntpath.splitdrive(), and in ntpath.normpath() on non-Windows systems. Paths such as ‘server’ and ‘’ are now considered by splitdrive() to contain only a drive, and consequently are not modified by normpath() on non-Windows systems. The behaviour of normpath() on Windows systems is unaffected, as native OS APIs are used. Patch by Eryk Sun, with contributions by Barney Gale.
  • gh-78878: Fix crash when creating an instance of _ctypes.CField.
  • gh-99952: Fix a reference undercounting issue in ctypes.Structure with from_param() results larger than a C pointer.
  • gh-100133: Fix regression in asyncio where a subprocess would sometimes lose data received from pipe.
  • gh-100098: Fix tuple subclasses being cast to tuple when used as enum values.
  • gh-98778: Update HTTPError to be initialized properly, even if the fp is None. Patch by Dong-hee Na.
  • gh-83035: Fix inspect.getsource() handling of decorator calls with nested parentheses.
  • gh-99576: Fix .save() method for LWPCookieJar and MozillaCookieJar: saved file was not truncated on repeated save.
  • gh-99433: Fix doctest failure on types.MethodWrapperType in modules.
  • gh-99240: Fix double-free bug in Argument Clinic str_converter by extracting memory clean up to a new post_parsing section.
  • gh-64490: Fix refcount error when arguments are packed to tuple in Argument Clinic.
  • gh-85267: Several improvements to inspect.signature()’s handling of __text_signature. - Fixes a case where inspect.signature() dropped parameters - Fixes a case where inspect.signature() raised tokenize.TokenError - Allows inspect.signature() to understand defaults involving binary operations of constants - inspect.signature() is documented as only raising TypeError or ValueError, but sometimes raised RuntimeError. These cases now raise ValueError - Removed a dead code path
  • gh-95882: Fix a 3.11 regression in asynccontextmanager(), which caused it to propagate exceptions with incorrect tracebacks and fix a 3.11 regression in contextmanager(), which caused it to propagate exceptions with incorrect tracebacks for StopIteration.
  • bpo-44817: Ignore WinError 53 (ERROR_BAD_NETPATH), 65 (ERROR_NETWORK_ACCESS_DENIED) and 161 (ERROR_BAD_PATHNAME) when using ntpath.realpath().
  • bpo-40447: Accept os.PathLike (such as pathlib.Path) in the stripdir arguments of compileall.compile_file() and compileall.compile_dir().
  • bpo-36880: Fix a reference counting issue when a ctypes callback with return type py_object returns None, which could cause crashes.
  • Documentation:
  • gh-100616: Document existing attr parameter to curses.window.vline() function in curses.
  • gh-100472: Remove claim in documentation that the stripdir, prependdir and limit_sl_dest parameters of compileall.compile_dir() and compileall.compile_file() could be bytes.
  • gh-99931: Use sphinxext-opengraph to generate OpenGraph metadata.
  • Tests:
  • gh-101334: test_tarfile has been updated to pass when run as a high UID.
  • gh-100454: Start running SSL tests with OpenSSL 3.1.0-beta1.
  • gh-96002: Add functional test for Argument Clinic.
  • Build:
  • gh-101522: Allow overriding Windows dependencies versions and paths using MSBuild properties.
  • Windows:
  • gh-101543: Ensure the install path in the registry is only used when the standard library hasn’t been located in any other way.
  • gh-101467: The py.exe launcher now correctly filters when only a single runtime is installed. It also correctly handles prefix matches on tags so that -3.1 does not match 3.11, but would still match 3.1-32.
  • gh-101135: Restore ability to launch older 32-bit versions from the py.exe launcher when both 32-bit and 64-bit installs of the same version are available.
  • gh-82052: Fixed an issue where writing more than 32K of Unicode output to the console screen in one go can result in mojibake.
  • gh-100320: Ensures the PythonPath registry key from an install is used when launching from a different copy of Python that relies on an existing install to provide a copy of its modules and standard library.
  • gh-100247: Restores support for the py.exe launcher finding shebang commands in its configuration file using the full command name.
  • gh-100180: Update Windows installer to OpenSSL 1.1.1s
  • bpo-43984: winreg.SetValueEx() now leaves the target value untouched in the case of conversion errors. Previously, -1 would be written in case of such errors.
  • macOS:
  • gh-100180: Update macOS installer to OpenSSL 1.1.1s
  • Tools/Demos:
  • bpo-45256: Fix a bug that caused an AttributeError to be raised in python-gdb.py when py-locals is used without a frame.
  • gh-100342: Add missing NULL check for possible allocation failure in *args parsing in Argument Clinic.
  • gh-64490: Argument Clinic varargs bugfixes:
  • Fix out-of-bounds error in _PyArg_UnpackKeywordsWithVararg().
  • Fix incorrect check which allowed more than one varargs in clinic.py.
  • Fix miscalculation of noptargs in generated code.
  • Do not generate noptargs when there is a vararg argument and no optional argument.
  • C API:
  • gh-99240: In argument parsing, after deallocating newly allocated memory, reset its pointer to NULL.

New in Python 3.11.1 (Dec 7, 2022)

  • Security:
  • gh-100001: python -m http.server no longer allows terminal control characters sent within a garbage request to be printed to the stderr server log.
  • This is done by changing the http.server BaseHTTPRequestHandler .log_message method to replace control characters with a xHH hex escape before printing.
  • gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module
  • gh-98433: The IDNA codec decoder used on DNS hostnames by socket or asyncio related name resolution functions no longer involves a quadratic algorithm. This prevents a potential CPU denial of service if an out-of-spec excessive length hostname involving bidirectional characters were decoded. Some protocols such as urllib http 3xx redirects potentially allow for an attacker to supply such a name.
  • gh-98739: Update bundled libexpat to 2.5.0
  • gh-97612: Fix a shell code injection vulnerability in the get-remote-certificate.py example script. The script no longer uses a shell to run openssl commands. Issue reported and initial fix by Caleb Shortt. Patch by Victor Stinner.
  • Core and Builtins:
  • gh-99886: Fix a crash when an object which does not have a dictionary frees its instance values.
  • gh-99891: Fix a bug in the tokenizer that could cause infinite recursion when showing syntax warnings that happen in the first line of the source. Patch by Pablo Galindo
  • gh-99729: Fix an issue that could cause frames to be visible to Python code as they are being torn down, possibly leading to memory corruption or hard crashes of the interpreter.
  • gh-99578: Fix a reference bug in _imp.create_builtin() after the creation of the first sub-interpreter for modules builtins and sys. Patch by Victor Stinner.
  • gh-99581: Fixed a bug that was causing a buffer overflow if the tokenizer copies a line missing the newline caracter from a file that is as long as the available tokenizer buffer. Patch by Pablo galindo
  • gh-99553: Fix bug where an ExceptionGroup subclass can wrap a BaseException.
  • gh-99370: Fix zip path for venv created from a non-installed python on POSIX platforms.
  • gh-99298: Fix an issue that could potentially cause incorrect error handling for some bytecode instructions.
  • gh-99205: Fix an issue that prevented PyThreadState and PyInterpreterState memory from being freed properly.
  • gh-99181: Fix failure in except* with unhashable exceptions.
  • gh-99204: Fix calculation of sys._base_executable when inside a POSIX virtual environment using copies of the python binary when the base installation does not provide the executable name used by the venv. Calculation will fall back to alternative names (“python”, “python.”).
  • gh-96055: Update faulthandler to emit an error message with the proper unexpected signal number. Patch by Dong-hee Na.
  • gh-99153: Fix location of SyntaxError for a try block with both except and except*.
  • gh-99103: Fix the error reporting positions of specialized traceback anchors when the source line contains Unicode characters.
  • gh-98852: Fix subscription of type aliases containing bare generic types or types like TypeVar: for example tuple[A, T][int] and tuple[TypeVar, T][int], where A is a generic type, and T is a type variable.
  • gh-98925: Lower the recursion depth for marshal on WASI to support wasmtime 2.0/main.
  • gh-98783: Fix multiple crashes in debug mode when str subclasses are used instead of str itself.
  • gh-99257: Fix an issue where member descriptors (such as those for __slots__) could behave incorrectly or crash instead of raising a TypeError when accessed via an instance of an invalid type.
  • gh-98374: Suppress ImportError for invalid query for help() command. Patch by Dong-hee Na.
  • gh-98415: Fix detection of MAC addresses for uuid on certain OSs. Patch by Chaim Sanders
  • gh-92119: Print exception class name instead of its string representation when raising errors from ctypes calls.
  • gh-96078: os.sched_yield() now release the GIL while calling sched_yield(2). Patch by Dong-hee Na.
  • gh-93354: Fix an issue that could delay the specialization of PRECALL instructions.
  • gh-97943: Bugfix: PyFunction_GetAnnotations() should return a borrowed reference. It was returning a new reference.
  • gh-97779: Ensure that all Python frame objects are backed by “complete” frames.
  • gh-97591: Fixed a missing incref/decref pair in Exception.__setstate__(). Patch by Ofey Chan.
  • gh-94526: Fix the Python path configuration used to initialized sys.path at Python startup. Paths are no longer encoded to UTF-8/strict to avoid encoding errors if it contains surrogate characters (bytes paths are decoded with the surrogateescape error handler). Patch by Victor Stinner.
  • gh-95921: Fix overly-broad source position information for chained comparisons used as branching conditions.
  • gh-96387: At Python exit, sometimes a thread holding the GIL can wait forever for a thread (usually a daemon thread) which requested to drop the GIL, whereas the thread already exited. To fix the race condition, the thread which requested the GIL drop now resets its request before exiting. Issue discovered and analyzed by Mingliang ZHAO. Patch by Victor Stinner.
  • gh-96864: Fix a possible assertion failure, fatal error, or SystemError if a line tracing event raises an exception while opcode tracing is enabled.
  • gh-96678: Fix undefined behaviour in C code of null pointer arithmetic.
  • gh-96754: Make sure that all frame objects created are created from valid interpreter frames. Prevents the possibility of invalid frames in backtraces and signal handlers.
  • gh-95196: Disable incorrect pickling of the C implemented classmethod descriptors.
  • gh-96005: On WASI ENOTCAPABLE is now mapped to PermissionError. The errno modules exposes the new error number. getpath.py now ignores PermissionError when it cannot open landmark files pybuilddir.txt and pyenv.cfg.
  • gh-93696: Allow pdb to locate source for frozen modules in the standard library.
  • bpo-31718: Raise ValueError instead of SystemError when methods of uninitialized io.IncrementalNewlineDecoder objects are called. Patch by Oren Milman.
  • bpo-38031: Fix a possible assertion failure in io.FileIO when the opener returns an invalid file descriptor.
  • Library:
  • gh-100001: Also escape s in the http.server BaseHTTPRequestHandler.log_message so that it is technically possible to parse the line and reconstruct what the original data was. Without this a xHH is ambiguious as to if it is a hex replacement we put in or the characters r”x” came through in the original request line.
  • gh-93453: asyncio.get_event_loop() now only emits a deprecation warning when a new event loop was created implicitly. It no longer emits a deprecation warning if the current event loop was set.
  • gh-51524: Fix bug when calling trace.CoverageResults with valid infile.
  • gh-99645: Fix a bug in handling class cleanups in unittest.TestCase. Now addClassCleanup() uses separate lists for different TestCase subclasses, and doClassCleanups() only cleans up the particular class.
  • gh-97001: Release the GIL when calling termios APIs to avoid blocking threads.
  • gh-99341: Fix ast.increment_lineno() to also cover ast.TypeIgnore when changing line numbers.
  • gh-99418: Fix bug in urllib.parse.urlparse() that causes URL schemes that begin with a digit, a plus sign, or a minus sign to be parsed incorrectly.
  • gh-99382: Check the number of arguments in substitution in user generics containing a TypeVarTuple and one or more TypeVar.
  • gh-99379: Fix substitution of ParamSpec followed by TypeVarTuple in generic aliases.
  • gh-99344: Fix substitution of TypeVarTuple and ParamSpec together in user generics.
  • gh-74044: Fixed bug where inspect.signature() reported incorrect arguments for decorated methods.
  • gh-99275: Fix SystemError in ctypes when exception was not set during __initsubclass__.
  • gh-99277: Remove older version of _SSLProtocolTransport.get_write_buffer_limits in asyncio.sslproto
  • gh-99248: fix negative numbers failing in verify()
  • gh-99155: Fix statistics.NormalDist pickle with 0 and 1 protocols.
  • gh-93464: enum.auto() is now correctly activated when combined with other assignment values. E.g. ONE = auto(), 'some text' will now evaluate as (1, 'some text').
  • gh-99134: Update the bundled copy of pip to version 22.3.1.
  • gh-83004: Clean up refleak on failed module initialisation in _zoneinfo
  • gh-83004: Clean up refleaks on failed module initialisation in in _pickle
  • gh-83004: Clean up refleak on failed module initialisation in _io.
  • gh-98897: Fix memory leak in math.dist() when both points don’t have the same dimension. Patch by Kumar Aditya.
  • gh-98706: [3.11] Applied changes from importlib_metadata 4.11.4 through 4.13, including compatibility and robustness fixes for Distribution objects without _normalized_name, disallowing invalid inputs to Distribution.from_name, and refined behaviors in PathDistribution._name_from_stem and PathDistribution._normalized_name.
  • gh-98793: Fix argument typechecks in _overlapped.WSAConnect() and _overlapped.Overlapped.WSASendTo() functions.
  • gh-98744: Prevent crashing in traceback when retrieving the byte-offset for some source files that contain certain unicode characters.
  • gh-98740: Fix internal error in the re module which in very rare circumstances prevented compilation of a regular expression containing a conditional expression without the “else” branch.
  • gh-98703: Fix asyncio.StreamWriter.drain() to call protocol.connection_lost callback only once on Windows.
  • gh-98624: Add a mutex to unittest.mock.NonCallableMock to protect concurrent access to mock attributes.
  • gh-89237: Fix hang on Windows in subprocess.wait_closed() in asyncio with ProactorEventLoop. Patch by Kumar Aditya.
  • gh-98458: Fix infinite loop in unittest when a self-referencing chained exception is raised
  • gh-97928: tkinter.Text.count() raises now an exception for options starting with “-” instead of silently ignoring them.
  • gh-97966: On uname_result, restored expectation that _fields and _asdict would include all six properties including processor.
  • gh-98307: A createSocket() method was added to SysLogHandler.
  • gh-96035: Fix bug in urllib.parse.urlparse() that causes certain port numbers containing whitespace, underscores, plus and minus signs, or non-ASCII digits to be incorrectly accepted.
  • gh-98251: Allow venv to pass along PYTHON* variables to ensurepip and pip when they do not impact path resolution
  • gh-98178: On macOS, fix a crash in syslog.syslog() in multi-threaded applications. On macOS, the libc syslog() function is not thread-safe, so syslog.syslog() no longer releases the GIL to call it. Patch by Victor Stinner.
  • gh-96151: Allow BUILTINS to be a valid field name for frozen dataclasses.
  • gh-87730: Wrap network errors consistently in urllib FTP support, so the test suite doesn’t fail when a network is available but the public internet is not reachable.
  • gh-98086: Make sure patch.dict() can be applied on async functions.
  • gh-90985: Earlier in 3.11 we deprecated asyncio.Task.cancel("message"). We realized we were too harsh, and have undeprecated it.
  • gh-97837: Change deprecate warning message in unittest from
  • It is deprecated to return a value!=None
  • It is deprecated to return a value that is not None from a test case
  • gh-97825: Fixes AttributeError when subprocess.check_output() is used with argument input=None and either of the arguments encoding or errors are used.
  • gh-82836: Fix is_private properties in the ipaddress module. Previously non-private networks (0.0.0.0/0) would return True from this method; now they correctly return False.
  • gh-96827: Avoid spurious tracebacks from asyncio when default executor cleanup is delayed until after the event loop is closed (e.g. as the result of a keyboard interrupt).
  • gh-97592: Avoid a crash in the C version of asyncio.Future.remove_done_callback() when an evil argument is passed.
  • gh-97639: Remove tokenize.NL check from tabnanny.
  • gh-73588: Fix generation of the default name of tkinter.Checkbutton. Previously, checkbuttons in different parent widgets could have the same short name and share the same state if arguments “name” and “variable” are not specified. Now they are globally unique.
  • gh-97005: Update bundled libexpat to 2.4.9
  • gh-85760: Fix race condition in asyncio where process_exited() called before the pipe_data_received() leading to inconsistent output. Patch by Kumar Aditya.
  • gh-96819: Fixed check in multiprocessing.resource_tracker that guarantees that the length of a write to a pipe is not greater than PIPE_BUF.
  • gh-96741: Corrected type annotation for dataclass attribute pstats.FunctionProfile.ncalls to be str.
  • gh-95987: Fix repr of Any subclasses.
  • gh-96388: Work around missing socket functions in socket’s __repr__.
  • gh-96073: In inspect, fix overeager replacement of “typing.” in formatting annotations.
  • gh-96192: Fix handling of bytes path-like objects in os.ismount().
  • gh-96052: Fix handling compiler warnings (SyntaxWarning and DeprecationWarning) in codeop.compile_command() when checking for incomplete input. Previously it emitted warnings and raised a SyntaxError. Now it always returns None for incomplete input without emitting any warnings.
  • gh-88863: To avoid apparent memory leaks when asyncio.open_connection() raises, break reference cycles generated by local exception and future instances (which has exception instance as its member var). Patch by Dong Uk, Kang.
  • gh-91212: Fixed flickering of the turtle window when the tracer is turned off. Patch by Shin-myoung-serp.
  • gh-88050: Fix asyncio subprocess transport to kill process cleanly when process is blocked and avoid RuntimeError when loop is closed. Patch by Kumar Aditya.
  • gh-93858: Prevent error when activating venv in nested fish instances.
  • gh-91078: TarFile.next() now returns None when called on an empty tarfile.
  • bpo-47220: Document the optional callback parameter of WeakMethod. Patch by Géry Ogam.
  • bpo-46364: Restrict use of sockets instead of pipes for stdin of subprocesses created by asyncio to AIX platform only.
  • bpo-38523: shutil.copytree() now applies the ignore_dangling_symlinks argument recursively.
  • bpo-36267: Fix IndexError in argparse.ArgumentParser when a store_true action is given an explicit argument.
  • Documentation:
  • gh-92892: Document that calling variadic functions with ctypes requires special care on macOS/arm64 (and possibly other platforms).
  • gh-85525: Remove extra row
  • gh-95588: Clarified the conflicting advice given in the ast documentation about ast.literal_eval() being “safe” for use on untrusted input while at the same time warning that it can crash the process. The latter statement is true and is deemed unfixable without a large amount of work unsuitable for a bugfix. So we keep the warning and no longer claim that literal_eval is safe.
  • bpo-41825: Restructured the documentation for the os.wait* family of functions, and improved the docs for os.waitid() with more explanation of the possible argument constants.
  • Tests:
  • gh-99892: Skip test_normalization() of test_unicodedata if it fails to download NormalizationTest.txt file from pythontest.net. Patch by Victor Stinner.
  • gh-99934: Correct test_marsh on (32 bit) x86: test_deterministic sets was failing.
  • gh-99659: Optional big memory tests in test_sqlite3 now catch the correct sqlite.DataError exception type in case of too large strings and/or blobs passed.
  • gh-98713: Fix a bug in the typing tests where a test relying on CPython-specific implementation details was not decorated with @cpython_only and was not skipped on other implementations.
  • gh-87390: Add tests for star-unpacking with PEP 646, and some other miscellaneous PEP 646 tests.
  • gh-96853: Added explicit coverage of Py_Initialize (and hence Py_InitializeEx) back to the embedding tests (all other embedding tests migrated to Py_InitializeFromConfig in Python 3.11)
  • bpo-34272: Some C API tests were moved into the new Lib/test/test_capi/ directory.
  • Build:
  • gh-99086: Fix -Wimplicit-int, -Wstrict-prototypes, and -Wimplicit-function-declaration compiler warnings in configure checks.
  • gh-99337: Fix a compilation issue with GCC 12 on macOS.
  • gh-99086: Fix -Wimplicit-int compiler warning in configure check for PTHREAD_SCOPE_SYSTEM.
  • gh-98872: Fix a possible fd leak in Programs/_freeze_module.c introduced in Python 3.11.
  • gh-99016: Fix build with PYTHON_FOR_REGEN=python3.8.
  • gh-97731: Specify the full path to the source location for make docclean (needed for cross-builds).
  • gh-98707: Don’t use vendored libmpdec headers if --with-system-libmpdec is passed to configure. Don’t use vendored libexpat headers if --with-system-expat is passed to !configure.
  • gh-96761: Fix the build process of clang compiler for _bootstrap_python if LTO optimization is applied. Patch by Matthias Görgens and Dong-hee Na.
  • gh-96883: wasm32-emscripten builds for browsers now include concurrent.futures for asyncio and unittest.mock.
  • gh-84461: wasm32-emscripten platform no longer builds resource module, getresuid(), getresgid(), and their setters. The APIs are stubs and not functional.
  • gh-94280: Updated pegen regeneration script on Windows to find and use Python 3.9 or higher. Prior to this, pegen regeneration already required 3.9 or higher, but the script may have used lower versions of Python.
  • Windows:
  • gh-99345: Use faster initialization functions to detect install location for Windows Store package
  • gh-98629: Fix initialization of sys.version and sys._git on Windows
  • gh-99442: Fix handling in Python Launcher for Windows when argv[0] does not include a file extension.
  • gh-98689: Update Windows builds to zlib v1.2.13. v1.2.12 has CVE-2022-37434, but the vulnerable inflateGetHeader API is not used by Python.
  • gh-98790: Assumes that a missing DLLs directory means that standard extension modules are in the executable’s directory.
  • gh-98745: Update py.exe launcher to install 3.11 by default and 3.12 on request.
  • gh-98692: Fix the Python Launcher for Windows ignoring unrecognized shebang lines instead of treating them as local paths
  • gh-94328: Update Windows installer to use SQLite 3.39.4.
  • gh-97728: Fix possible crashes caused by the use of uninitialized variables when pass invalid arguments in os.system() on Windows and in Windows-specific modules (like winreg).
  • gh-96965: Update libffi to 3.4.3
  • gh-94781: Fix pcbuild.proj to clean previous instances of ouput files in Pythondeepfreeze and Pythonfrozen_modules directories on Windows. Patch by Charlie Zhao.
  • bpo-40882: Fix a memory leak in multiprocessing.shared_memory.SharedMemory on Windows.
  • macOS:
  • gh-87235: On macOS python3 /dev/fd/9 9

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
  • 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.

New in Python 3.10.6 (Sep 6, 2022)

  • Security:
  • gh-87389: http.server: Fix an open redirection vulnerability in the HTTP server when an URI path starts with //. Vulnerability discovered, and initial fix proposed, by Hamza Avvan.
  • gh-92888: Fix memoryview use after free when accessing the backing buffer in certain cases.
  • Core and Builtins:
  • gh-95355: _PyPegen_Parser_New now properly detects token memory allocation errors. Patch by Honglin Zhu.
  • gh-94938: Fix error detection in some builtin functions when keyword argument name is an instance of a str subclass with overloaded __eq__ and __hash__. Previously it could cause SystemError or other undesired behavior.
  • gh-94949: ast.parse() will no longer parse parenthesized context managers when passed feature_version less than (3, 9). Patch by Shantanu Jain.
  • gh-94947: ast.parse() will no longer parse assignment expressions when passed feature_version less than (3, 8). Patch by Shantanu Jain.
  • gh-94869: Fix the column offsets for some expressions in multi-line f-strings ast nodes. Patch by Pablo Galindo.
  • gh-91153: Fix an issue where a bytearray item assignment could crash if it’s resized by the new value’s __index__() method.
  • gh-94329: Compile and run code with unpacking of extremely large sequences (1000s of elements). Such code failed to compile. It now compiles and runs correctly.
  • gh-94360: Fixed a tokenizer crash when reading encoded files with syntax errors from stdin with non utf-8 encoded text. Patch by Pablo Galindo
  • gh-94192: Fix error for dictionary literals with invalid expression as value.
  • gh-93964: Strengthened compiler overflow checks to prevent crashes when compiling very large source files.
  • gh-93671: Fix some exponential backtrace case happening with deeply nested sequence patterns in match statements. Patch by Pablo Galindo
  • gh-93021: Fix the __text_signature__ for __get__() methods implemented in C. Patch by Jelle Zijlstra.
  • gh-92930: Fixed a crash in _pickle.c from mutating collections during __reduce__ or persistent_id.
  • gh-92914: Always round the allocated size for lists up to the nearest even number.
  • gh-92858: Improve error message for some suites with syntax error before ‘:’
  • Library:
  • gh-95339: Update bundled pip to 22.2.1.
  • gh-95045: Fix GC crash when deallocating _lsprof.Profiler by untracking it before calling any callbacks. Patch by Kumar Aditya.
  • gh-95087: Fix IndexError in parsing invalid date in the email module.
  • gh-95199: Upgrade bundled setuptools to 63.2.0.
  • gh-95194: Upgrade bundled pip to 22.2.
  • gh-93899: Fix check for existence of os.EFD_CLOEXEC, os.EFD_NONBLOCK and os.EFD_SEMAPHORE flags on older kernel versions where these flags are not present. Patch by Kumar Aditya.
  • gh-95166: Fix concurrent.futures.Executor.map() to cancel the currently waiting on future on an error - e.g. TimeoutError or KeyboardInterrupt.
  • gh-93157: Fix fileinput module didn’t support errors option when inplace is true.
  • gh-94821: Fix binding of unix socket to empty address on Linux to use an available address from the abstract namespace, instead of “0”.
  • gh-94736: Fix crash when deallocating an instance of a subclass of _multiprocessing.SemLock. Patch by Kumar Aditya.
  • gh-94637: SSLContext.set_default_verify_paths() now releases the GIL around SSL_CTX_set_default_verify_paths call. The function call performs I/O and CPU intensive work.
  • gh-94510: Re-entrant calls to sys.setprofile() and sys.settrace() now raise RuntimeError. Patch by Pablo Galindo.
  • gh-92336: Fix bug where linecache.getline() fails on bad files with UnicodeDecodeError or SyntaxError. It now returns an empty string as per the documentation.
  • gh-89988: Fix memory leak in pickle.Pickler when looking up dispatch_table. Patch by Kumar Aditya.
  • gh-94254: Fixed types of struct module to be immutable. Patch by Kumar Aditya.
  • gh-94245: Fix pickling and copying of typing.Tuple[()].
  • gh-94207: Made _struct.Struct GC-tracked in order to fix a reference leak in the _struct module.
  • gh-94101: Manual instantiation of ssl.SSLSession objects is no longer allowed as it lead to misconfigured instances that crashed the interpreter when attributes where accessed on them.
  • gh-84753: inspect.iscoroutinefunction(), inspect.isgeneratorfunction(), and inspect.isasyncgenfunction() now properly return True for duck-typed function-like objects like instances of unittest.mock.AsyncMock.
  • This makes inspect.iscoroutinefunction() consistent with the behavior of asyncio.iscoroutinefunction(). Patch by Mehdi ABAAKOUK.
  • gh-83499: Fix double closing of file description in tempfile.
  • gh-79512: Fixed names and __module__ value of weakref classes ReferenceType, ProxyType, CallableProxyType. It makes them pickleable.
  • gh-90494: copy.copy() and copy.deepcopy() now always raise a TypeError if __reduce__() returns a tuple with length 6 instead of silently ignore the 6th item or produce incorrect result.
  • gh-90549: Fix a multiprocessing bug where a global named resource (such as a semaphore) could leak when a child process is spawned (as opposed to forked).
  • gh-79579: sqlite3 now correctly detects DML queries with leading comments. Patch by Erlend E. Aasland.
  • gh-93421: Update sqlite3.Cursor.rowcount when a DML statement has run to completion. This fixes the row count for SQL queries like UPDATE ... RETURNING. Patch by Erlend E. Aasland.
  • gh-91810: Suppress writing an XML declaration in open files in ElementTree.write() with encoding='unicode' and xml_declaration=None.
  • gh-93353: Fix the importlib.resources.as_file() context manager to remove the temporary file if destroyed late during Python finalization: keep a local reference to the os.remove() function. Patch by Victor Stinner.
  • gh-83658: Make multiprocessing.Pool raise an exception if maxtasksperchild is not None or a positive int.
  • gh-74696: shutil.make_archive() no longer temporarily changes the current working directory during creation of standard .zip or tar archives.
  • gh-91577: Move imports in SharedMemory methods to module level so that they can be executed late in python finalization.
  • bpo-47231: Fixed an issue with inconsistent trailing slashes in tarfile longname directories.
  • bpo-46755: In QueueHandler, clear stack_info from LogRecord to prevent stack trace from being written twice.
  • bpo-46053: Fix OSS audio support on NetBSD.
  • bpo-46197: Fix ensurepip environment isolation for subprocess running pip.
  • bpo-45924: Fix asyncio incorrect traceback when future’s exception is raised multiple times. Patch by Kumar Aditya.
  • bpo-34828: sqlite3.Connection.iterdump() now handles databases that use AUTOINCREMENT in one or more tables.
  • Documentation:
  • gh-94321: Document the PEP 246 style protocol type sqlite3.PrepareProtocol.
  • gh-86128: Document a limitation in ThreadPoolExecutor where its exit handler is executed before any handlers in atexit.
  • gh-61162: Clarify sqlite3 behavior when How to use the connection context manager.
  • gh-87260: Align sqlite3 argument specs with the actual implementation.
  • gh-86986: The minimum Sphinx version required to build the documentation is now 3.2.
  • gh-88831: Augmented documentation of asyncio.create_task(). Clarified the need to keep strong references to tasks and added a code snippet detailing how to do this.
  • bpo-47161: Document that pathlib.PurePath does not collapse initial double slashes because they denote UNC paths.
  • Tests:
  • gh-95280: Fix problem with test_ssl test_get_ciphers on systems that require perfect forward secrecy (PFS) ciphers.
  • gh-95212: Make multiprocessing test case test_shared_memory_recreate parallel-safe.
  • gh-91330: Added more tests for dataclasses to cover behavior with data descriptor-based fields.
  • gh-94208: test_ssl is now checking for supported TLS version and protocols in more tests.
  • gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxiliary importers.
  • gh-93957: Provide nicer error reporting from subprocesses in test_venv.EnsurePipTest.test_with_pip.
  • gh-57539: Increase calendar test coverage for calendar.LocaleTextCalendar.formatweekday().
  • gh-92886: Fixing tests that fail when running with optimizations (-O) in test_zipimport.py
  • bpo-47016: Create a GitHub Actions workflow for verifying bundled pip and setuptools. Patch by Illia Volochii and Adam Turner.
  • Build:
  • gh-94841: Fix the possible performance regression of PyObject_Free() compiled with MSVC version 1932.
  • bpo-45816: Python now supports building with Visual Studio 2022 (MSVC v143, VS Version 17.0). Patch by Jeremiah Vivian.
  • Windows:
  • gh-90844: Allow virtual environments to correctly launch when they have spaces in the path.
  • gh-92841: asyncio no longer throws RuntimeError: Event loop is closed on interpreter exit after asynchronous socket activity. Patch by Oleg Iarygin.
  • bpo-42658: Support native Windows case-insensitive path comparisons by using LCMapStringEx instead of str.lower() in ntpath.normcase(). Add LCMapStringEx to the _winapi module.
  • IDLE:
  • gh-95511: Fix the Shell context menu copy-with-prompts bug of copying an extra line when one selects whole lines.
  • gh-95471: In the Edit menu, move Select All and add a new separator.
  • gh-95411: Enable using IDLE’s module browser with .pyw files.
  • gh-89610: Add .pyi as a recognized extension for IDLE on macOS. This allows opening stub files by double clicking on them in the Finder.
  • Tools/Demos:
  • gh-94538: Fix Argument Clinic output to custom file destinations. Patch by Erlend E. Aasland.
  • gh-94430: Allow parameters named module and self with custom C names in Argument Clinic. Patch by Erlend E. Aasland
  • C API:
  • gh-94930: Fix SystemError raised when PyArg_ParseTupleAndKeywords() is used with # in (...) but without PY_SSIZE_T_CLEAN defined.
  • gh-94864: Fix PyArg_Parse* with deprecated format units “u” and “Z”. It returned 1 (success) when warnings are turned into exceptions.

New in Python 3.10.5 (Jun 11, 2022)

  • Core and Builtins:
  • gh-93418: Fixed an assert where an f-string has an equal sign ‘=’ following an expression, but there’s no trailing brace. For example, f”{i=”.
  • gh-91924: Fix __ltrace__ debug feature if the stdout encoding is not UTF-8. Patch by Victor Stinner.
  • gh-93061: Backward jumps after async for loops are no longer given dubious line numbers.
  • gh-93065: Fix contextvars HAMT implementation to handle iteration over deep trees.
  • The bug was discovered and fixed by Eli Libman. See MagicStack/immutables#84 for more details.
  • gh-92311: Fixed a bug where setting frame.f_lineno to jump over a list comprehension could misbehave or crash.
  • gh-92112: Fix crash triggered by an evil custom mro() on a metaclass.
  • gh-92036: Fix a crash in subinterpreters related to the garbage collector. When a subinterpreter is deleted, untrack all objects tracked by its GC. To prevent a crash in deallocator functions expecting objects to be tracked by the GC, leak a strong reference to these objects on purpose, so they are never deleted and their deallocator functions are not called. Patch by Victor Stinner.
  • gh-91421: Fix a potential integer overflow in _Py_DecodeUTF8Ex.
  • bpo-47212: Raise IndentationError instead of SyntaxError for a bare except with no following indent. Improve SyntaxError locations for an un-parenthesized generator used as arguments. Patch by Matthieu Dartiailh.
  • bpo-47182: Fix a crash when using a named unicode character like "N{digit nine}" after the main interpreter has been initialized a second time.
  • bpo-46775: Some Windows system error codes(>= 10000) are now mapped into the correct errno and may now raise a subclass of OSError. Patch by Dong-hee Na.
  • bpo-47117: Fix a crash if we fail to decode characters in interactive mode if the tokenizer buffers are uninitialized. Patch by Pablo Galindo.
  • bpo-39829: Removed the __len__() call when initializing a list and moved initializing to list_extend. Patch by Jeremiah Pascual.
  • bpo-46962: Classes and functions that unconditionally declared their docstrings ignoring the --without-doc-strings compilation flag no longer do so.
  • The classes affected are ctypes.UnionType, pickle.PickleBuffer, testcapi.RecursingInfinitelyError, and types.GenericAlias.
  • The functions affected are 24 methods in ctypes.
  • Patch by Oleg Iarygin.
  • bpo-36819: Fix crashes in built-in encoders with error handlers that return position less or equal than the starting position of non-encodable characters.
  • Library:
  • gh-93156: Accessing the pathlib.PurePath.parents sequence of an absolute path using negative index values produced incorrect results.
  • gh-89973: Fix re.error raised in fnmatch if the pattern contains a character range with upper bound lower than lower bound (e.g. [c-a]). Now such ranges are interpreted as empty ranges.
  • gh-93010: In a very special case, the email package tried to append the nonexistent InvalidHeaderError to the defect list. It should have been InvalidHeaderDefect.
  • gh-92839: Fixed crash resulting from calling bisect.insort() or bisect.insort_left() with the key argument not equal to None.
  • gh-91581: utcfromtimestamp() no longer attempts to resolve fold in the pure Python implementation, since the fold is never 1 in UTC. In addition to being slightly faster in the common case, this also prevents some errors when the timestamp is close to datetime.min. Patch by Paul Ganssle.
  • gh-92530: Fix an issue that occurred after interrupting threading.Condition.notify().
  • gh-92049: Forbid pickling constants re._constants.SUCCESS etc. Previously, pickling did not fail, but the result could not be unpickled.
  • bpo-47029: Always close the read end of the pipe used by multiprocessing.Queue after the last write of buffered data to the write end of the pipe to avoid BrokenPipeError at garbage collection and at multiprocessing.Queue.close() calls. Patch by Géry Ogam.
  • gh-91401: Provide a fail-safe way to disable subprocess use of vfork() via a private subprocess._USE_VFORK attribute. While there is currently no known need for this, if you find a need please only set it to False. File a CPython issue as to why you needed it and link to that from a comment in your code. This attribute is documented as a footnote in 3.11.
  • gh-91910: Add missing f prefix to f-strings in error messages from the multiprocessing and asyncio modules.
  • gh-91810: ElementTree method write() and function tostring() now use the text file’s encoding (“UTF-8” if not available) instead of locale encoding in XML declaration when encoding="unicode" is specified.
  • gh-91832: Add required attribute to argparse.Action repr output.
  • gh-91734: Fix OSS audio support on Solaris.
  • gh-91700: Compilation of regular expression containing a conditional expression (?(group)...) now raises an appropriate re.error if the group number refers to not defined group. Previously an internal RuntimeError was raised.
  • gh-91676: Fix unittest.IsolatedAsyncioTestCase to shutdown the per test event loop executor before returning from its run method so that a not yet stopped or garbage collected executor state does not persist beyond the test.
  • gh-90568: Parsing N escapes of Unicode Named Character Sequences in a regular expression raises now re.error instead of TypeError.
  • gh-91595: Fix the comparison of character and integer inside Tools.gdb.libpython.write_repr(). Patch by Yu Liu.
  • gh-90622: Worker processes for concurrent.futures.ProcessPoolExecutor are no longer spawned on demand (a feature added in 3.9) when the multiprocessing context start method is "fork" as that can lead to deadlocks in the child processes due to a fork happening while threads are running.
  • gh-91575: Update case-insensitive matching in the re module to the latest Unicode version.
  • gh-91581: Remove an unhandled error case in the C implementation of calls to datetime.fromtimestamp with no time zone (i.e. getting a local time from an epoch timestamp). This should have no user-facing effect other than giving a possibly more accurate error message when called with timestamps that fall on 10000-01-01 in the local time. Patch by Paul Ganssle.
  • bpo-47260: Fix os.closerange() potentially being a no-op in a Linux seccomp sandbox.
  • bpo-39064: zipfile.ZipFile now raises zipfile.BadZipFile instead of ValueError when reading a corrupt zip file in which the central directory offset is negative.
  • bpo-47151: When subprocess tries to use vfork, it now falls back to fork if vfork returns an error. This allows use in situations where vfork isn’t allowed by the OS kernel.
  • bpo-27929: Fix asyncio.loop.sock_connect() to only resolve names for socket.AF_INET or socket.AF_INET6 families. Resolution may not make sense for other families, like socket.AF_BLUETOOTH and socket.AF_UNIX.
  • bpo-43323: Fix errors in the email module if the charset itself contains undecodable/unencodable characters.
  • bpo-47101: hashlib.algorithms_available now lists only algorithms that are provided by activated crypto providers on OpenSSL 3.0. Legacy algorithms are not listed unless the legacy provider has been loaded into the default OSSL context.
  • bpo-46787: Fix concurrent.futures.ProcessPoolExecutor exception memory leak
  • bpo-45393: Fix the formatting for await x and not x in the operator precedence table when using the help() system.
  • bpo-46415: Fix ipaddress.ip_{address,interface,network} raising TypeError instead of ValueError if given invalid tuple as address parameter.
  • bpo-28249: Set doctest.DocTest.lineno to None when object does not have __doc__.
  • bpo-45138: Fix a regression in the sqlite3 trace callback where bound parameters were not expanded in the passed statement string. The regression was introduced in Python 3.10 by bpo-40318. Patch by Erlend E. Aasland.
  • bpo-44493: Add missing terminated NUL in sockaddr_un’s length
  • This was potentially observable when using non-abstract AF_UNIX datagram sockets to processes written in another programming language.
  • bpo-42627: Fix incorrect parsing of Windows registry proxy settings
  • bpo-36073: Raise ProgrammingError instead of segfaulting on recursive usage of cursors in sqlite3 converters. Patch by Sergey Fedoseev.
  • Documentation:
  • gh-86438: Clarify that -W and PYTHONWARNINGS are matched literally and case-insensitively, rather than as regular expressions, in warnings.
  • gh-92240: Added release dates for “What’s New in Python 3.X” for 3.0, 3.1, 3.2, 3.8 and 3.10
  • gh-91888: Add a new gh role to the documentation to link to GitHub issues.
  • gh-91783: Document security issues concerning the use of the function shutil.unpack_archive()
  • gh-91547: Remove “Undocumented modules” page.
  • bpo-44347: Clarify the meaning of dirs_exist_ok, a kwarg of shutil.copytree().
  • bpo-38668: Update the introduction to documentation for os.path to remove warnings that became irrelevant after the implementations of PEP 383 and PEP 529.
  • bpo-47138: Pin Jinja to a version compatible with Sphinx version 3.2.1.
  • bpo-46962: All docstrings in code snippets are now wrapped into PyDoc_STR() to follow the guideline of PEP 7’s Documentation Strings paragraph. Patch by Oleg Iarygin.
  • bpo-26792: Improve the docstrings of runpy.run_module() and runpy.run_path(). Original patch by Andrew Brezovsky.
  • bpo-40838: Document that inspect.getdoc(), inspect.getmodule(), and inspect.getsourcefile() might return None.
  • bpo-45790: Adjust inaccurate phrasing in Defining Extension Types: Tutorial about the ob_base field and the macros used to access its contents.
  • bpo-42340: Document that in some circumstances KeyboardInterrupt may cause the code to enter an inconsistent state. Provided a sample workaround to avoid it if needed.
  • bpo-41233: Link the errnos referenced in Doc/library/exceptions.rst to their respective section in Doc/library/errno.rst, and vice versa. Previously this was only done for EINTR and InterruptedError. Patch by Yan “yyyyyyyan” Orestes.
  • bpo-38056: Overhaul the Error Handlers documentation in codecs.
  • bpo-13553: Document tkinter.Tk args.
  • Tests:
  • gh-92886: Fixing tests that fail when running with optimizations (-O) in test_imaplib.py.
  • gh-92670: Skip test_shutil.TestCopy.test_copyfile_nonexistent_dir test on AIX as the test uses a trailing slash to force the OS consider the path as a directory, but on AIX the trailing slash has no effect and is considered as a file.
  • gh-91904: Fix initialization of PYTHONREGRTEST_UNICODE_GUARD which prevented running regression tests on non-UTF-8 locale.
  • gh-91607: Fix test_concurrent_futures to test the correct multiprocessing start method context in several cases where the test logic mixed this up.
  • bpo-47205: Skip test for sched_getaffinity() and sched_setaffinity() error case on FreeBSD.
  • bpo-47104: Rewrite asyncio.to_thread() tests to use unittest.IsolatedAsyncioTestCase.
  • bpo-29890: Add tests for ipaddress.IPv4Interface and ipaddress.IPv6Interface construction with tuple arguments. Original patch and tests by louisom.
  • Build:
  • bpo-47103: Windows PGInstrument builds now copy a required DLL into the output directory, making it easier to run the profile stage of a PGO build.
  • Windows:
  • gh-92984: Explicitly disable incremental linking for non-Debug builds
  • bpo-47194: Update zlib to v1.2.12 to resolve CVE-2018-25032.
  • bpo-46785: Fix race condition between os.stat() and unlinking a file on Windows, by using errors codes returned by FindFirstFileW() when appropriate in win32_xstat_impl.
  • bpo-40859: Update Windows build to use xz-5.2.5
  • Tools/Demos:
  • gh-91583: Fix regression in the code generated by Argument Clinic for functions with the defining_class parameter.

New in Python 3.10.4 (Jun 11, 2022)

  • Core and Builtins:
  • bpo-46968: Check for the existence of the “sys/auxv.h” header in faulthandler to avoid compilation problems in systems where this header doesn’t exist. Patch by Pablo Galindo
  • Library:
  • bpo-23691: Protect the re.finditer() iterator from re-entering.
  • bpo-42369: Fix thread safety of zipfile._SharedFile.tell() to avoid a “zipfile.BadZipFile: Bad CRC-32 for file” exception when reading a ZipFile from multiple threads.
  • bpo-38256: Fix binascii.crc32() when it is compiled to use zlib’c crc32 to work properly on inputs 4+GiB in length instead of returning the wrong result. The workaround prior to this was to always feed the function data in increments smaller than 4GiB or to just call the zlib module function.
  • bpo-39394: A warning about inline flags not at the start of the regular expression now contains the position of the flag.
  • bpo-47061: Deprecate the various modules listed by PEP 594:
  • aifc, asynchat, asyncore, audioop, cgi, cgitb, chunk, crypt, imghdr, msilib, nntplib, nis, ossaudiodev, pipes, smtpd, sndhdr, spwd, sunau, telnetlib, uu, xdrlib
  • bpo-2604: Fix bug where doctests using globals would fail when run multiple times.
  • bpo-45997: Fix asyncio.Semaphore re-aquiring FIFO order.
  • bpo-47022: The asynchat, asyncore and smtpd modules have been deprecated since at least Python 3.6. Their documentation and deprecation warnings and have now been updated to note they will removed in Python 3.12 (PEP 594).
  • bpo-46421: Fix a unittest issue where if the command was invoked as python -m unittest and the filename(s) began with a dot (.), a ValueError is returned.
  • bpo-40296: Fix supporting generic aliases in pydoc.

New in Python 3.10.3 (Mar 24, 2022)

  • Core and Builtins:
  • bpo-46940: Avoid overriding AttributeError metadata information for nested attribute access calls. Patch by Pablo Galindo.
  • bpo-46852: Rename the private undocumented float.__set_format__() method to float.__setformat__() to fix a typo introduced in Python 3.7. The method is only used by test_float. Patch by Victor Stinner.
  • bpo-46794: Bump up the libexpat version into 2.4.6
  • bpo-46820: Fix parsing a numeric literal immediately (without spaces) followed by “not in” keywords, like in 1not in x. Now the parser only emits a warning, not a syntax error.
  • bpo-46762: Fix an assert failure in debug builds when a ‘’, or ‘=’ is the last character in an f-string that’s missing a closing right brace.
  • bpo-46724: Make sure that all backwards jumps use the JUMP_ABSOLUTE instruction, rather than JUMP_FORWARD with an argument of (2**32)+offset.
  • bpo-46732: Correct the docstring for the __bool__() method. Patch by Jelle Zijlstra.
  • bpo-46707: Avoid potential exponential backtracking when producing some syntax errors involving lots of brackets. Patch by Pablo Galindo.
  • bpo-40479: Add a missing call to va_end() in Modules/_hashopenssl.c.
  • bpo-46615: When iterating over sets internally in setobject.c, acquire strong references to the resulting items from the set. This prevents crashes in corner-cases of various set operations where the set gets mutated.
  • bpo-45773: Remove two invalid “peephole” optimizations from the bytecode compiler.
  • bpo-43721: Fix docstrings of getter, setter, and deleter to clarify that they create a new copy of the property.
  • bpo-46503: Fix an assert when parsing some invalid N escape sequences in f-strings.
  • bpo-46417: Fix a race condition on setting a type __bases__ attribute: the internal function add_subclass() now gets the PyTypeObject.tp_subclasses member after calling PyWeakref_NewRef() which can trigger a garbage collection which can indirectly modify PyTypeObject.tp_subclasses. Patch by Victor Stinner.
  • bpo-46383: Fix invalid signature of _zoneinfo’s module_free function to resolve a crash on wasm32-emscripten platform.
  • bpo-46070: Py_EndInterpreter() now explicitly untracks all objects currently tracked by the GC. Previously, if an object was used later by another interpreter, calling PyObject_GC_UnTrack() on the object crashed if the previous or the next object of the PyGC_Head structure became a dangling pointer. Patch by Victor Stinner.
  • bpo-46339: Fix a crash in the parser when retrieving the error text for multi-line f-strings expressions that do not start in the first line of the string. Patch by Pablo Galindo
  • bpo-46240: Correct the error message for unclosed parentheses when the tokenizer doesn’t reach the end of the source when the error is reported. Patch by Pablo Galindo
  • bpo-46091: Correctly calculate indentation levels for lines with whitespace character that are ended by line continuation characters. Patch by Pablo Galindo
  • Library:
  • bpo-43253: Fix a crash when closing transports where the underlying socket handle is already invalid on the Proactor event loop.
  • bpo-47004: Apply bugfixes from importlib_metadata 4.11.3, including bugfix for EntryPoint.extras, which was returning match objects and not the extras strings.
  • bpo-46985: Upgrade pip wheel bundled with ensurepip (pip 22.0.4)
  • bpo-46968: faulthandler: On Linux 5.14 and newer, dynamically determine size of signal handler stack size CPython allocates using getauxval(AT_MINSIGSTKSZ). This changes allows for Python extension’s request to Linux kernel to use AMX_TILE instruction set on Sapphire Rapids Xeon processor to succeed, unblocking use of the ISA in frameworks.
  • bpo-46955: Expose asyncio.base_events.Server as asyncio.Server. Patch by Stefan Zabka.
  • bpo-23325: The signal module no longer assumes that SIG_IGN and SIG_DFL are small int singletons.
  • bpo-46932: Update bundled libexpat to 2.4.7
  • bpo-25707: Fixed a file leak in xml.etree.ElementTree.iterparse() when the iterator is not exhausted. Patch by Jacob Walls.
  • bpo-44886: Inherit asyncio proactor datagram transport from asyncio.DatagramTransport.
  • bpo-46827: Support UDP sockets in asyncio.loop.sock_connect() for selector-based event loops. Patch by Thomas Grainger.
  • bpo-46811: Make test suite support Expat >=2.4.5
  • bpo-46252: Raise TypeError if ssl.SSLSocket is passed to transport-based APIs.
  • bpo-46784: Fix libexpat symbols collisions with user dynamically loaded or statically linked libexpat in embedded Python.
  • bpo-39327: shutil.rmtree() can now work with VirtualBox shared folders when running from the guest operating-system.
  • bpo-46756: Fix a bug in urllib.request.HTTPPasswordMgr.find_user_password() and urllib.request.HTTPPasswordMgrWithPriorAuth.is_authenticated() which allowed to bypass authorization. For example, access to URI example.org/foobar was allowed if the user was authorized for URI example.org/foo.
  • bpo-46643: In typing.get_type_hints(), support evaluating stringified ParamSpecArgs and ParamSpecKwargs annotations. Patch by Gregory Beauregard.
  • bpo-45863: When the tarfile module creates a pax format archive, it will put an integer representation of timestamps in the ustar header (if possible) for the benefit of older unarchivers, in addition to the existing full-precision timestamps in the pax extended header.
  • bpo-46676: Make typing.ParamSpec args and kwargs equal to themselves. Patch by Gregory Beauregard.
  • bpo-46672: Fix NameError in asyncio.gather() when initial type check fails.
  • bpo-46655: In typing.get_type_hints(), support evaluating bare stringified TypeAlias annotations. Patch by Gregory Beauregard.
  • bpo-45948: Fixed a discrepancy in the C implementation of the xml.etree.ElementTree module. Now, instantiating an xml.etree.ElementTree.XMLParser with a target=None keyword provides a default xml.etree.ElementTree.TreeBuilder target as the Python implementation does.
  • bpo-46521: Fix a bug in the codeop module that was incorrectly identifying invalid code involving string quotes as valid code.
  • bpo-46581: Brings ParamSpec propagation for GenericAlias in line with Concatenate (and others).
  • bpo-46591: Make the IDLE doc URL on the About IDLE dialog clickable.
  • bpo-46400: expat: Update libexpat from 2.4.1 to 2.4.4
  • bpo-46487: Add the get_write_buffer_limits method to asyncio.transports.WriteTransport and to the SSL transport.
  • bpo-45173: Note the configparser deprecations will be removed in Python 3.12.
  • bpo-46539: In typing.get_type_hints(), support evaluating stringified ClassVar and Final annotations inside Annotated. Patch by Gregory Beauregard.
  • bpo-46491: Allow typing.Annotated to wrap typing.Final and typing.ClassVar. Patch by Gregory Beauregard.
  • bpo-46436: Fix command-line option -d/--directory in module http.server which is ignored when combined with command-line option --cgi. Patch by Géry Ogam.
  • bpo-41403: Make mock.patch() raise a TypeError with a relevant error message on invalid arg. Previously it allowed a cryptic AttributeError to escape.
  • bpo-46474: In importlib.metadata.EntryPoint.pattern, avoid potential REDoS by limiting ambiguity in consecutive whitespace.
  • bpo-46469: asyncio generic classes now return types.GenericAlias in __class_getitem__ instead of the same class.
  • bpo-46434: pdb now gracefully handles help when __doc__ is missing, for example when run with pregenerated optimized .pyc files.
  • bpo-46333: The __eq__() and __hash__() methods of typing.ForwardRef now honor the module parameter of typing.ForwardRef. Forward references from different modules are now differentiated.
  • bpo-46246: Add missing __slots__ to importlib.metadata.DeprecatedList. Patch by Arie Bovenberg.
  • bpo-46266: Improve day constants in calendar.
  • Now all constants (MONDAY … SUNDAY) are documented, tested, and added to __all__.
  • bpo-46232: The ssl module now handles certificates with bit strings in DN correctly.
  • bpo-43118: Fix a bug in inspect.signature() that was causing it to fail on some subclasses of classes with a __text_signature__ referencing module globals. Patch by Weipeng Hong.
  • bpo-26552: Fixed case where failing asyncio.ensure_future() did not close the coroutine. Patch by Kumar Aditya.
  • bpo-21987: Fix an issue with tarfile.TarFile.getmember() getting a directory name with a trailing slash.
  • bpo-20392: Fix inconsistency with uppercase file extensions in MimeTypes.guess_type(). Patch by Kumar Aditya.
  • bpo-46080: Fix exception in argparse help text generation if a argparse.BooleanOptionalAction argument’s default is argparse.SUPPRESS and it has help specified. Patch by Felix Fontein.
  • bpo-44439: Fix .write() method of a member file in ZipFile, when the input data is an object that supports the buffer protocol, the file length may be wrong.
  • bpo-45703: When a namespace package is imported before another module from the same namespace is created/installed in a different sys.path location while the program is running, calling the importlib.invalidate_caches() function will now also guarantee the new module is noticed.
  • bpo-24959: Fix bug where unittest sometimes drops frames from tracebacks of exceptions raised in tests.
  • bpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter expressions. Substitution with a list of types returns now a tuple of types. Substitution with Concatenate returns now a Concatenate with concatenated lists of arguments.
  • bpo-14156: argparse.FileType now supports an argument of ‘-‘ in binary mode, returning the .buffer attribute of sys.stdin/sys.stdout as appropriate. Modes including ‘x’ and ‘a’ are treated equivalently to ‘w’ when argument is ‘-‘. Patch contributed by Josh Rosenberg
  • Documentation:
  • bpo-46463: Fixes escape4chm.py script used when building the CHM documentation file
  • Tests:
  • bpo-46913: Fix test_faulthandler.test_sigfpe() if Python is built with undefined behavior sanitizer (UBSAN): disable UBSAN on the faulthandler_sigfpe() function. Patch by Victor Stinner.
  • bpo-46708: Prevent default asyncio event loop policy modification warning after test_asyncio execution.
  • bpo-46678: The function make_legacy_pyc in Lib/test/support/import_helper.py no longer fails when PYTHONPYCACHEPREFIX is set to a directory on a different device from where tempfiles are stored.
  • bpo-46616: Ensures test_importlib.test_windows cleans up registry keys after completion.
  • bpo-44359: test_ftplib now silently ignores socket errors to prevent logging unhandled threading exceptions. Patch by Victor Stinner.
  • bpo-46542: Fix a Python crash in test_lib2to3 when using Python built in debug mode: limit the recursion limit. Patch by Victor Stinner.
  • bpo-46576: test_peg_generator now disables compiler optimization when testing compilation of its own C extensions to significantly speed up the testing on non-debug builds of CPython.
  • bpo-46542: Fix test_json tests checking for RecursionError: modify these tests to use support.infinite_recursion(). Patch by Victor Stinner.
  • bpo-13886: Skip test_builtin PTY tests on non-ASCII characters if the readline module is loaded. The readline module changes input() behavior, but test_builtin is not intented to test the readline module. Patch by Victor Stinner.
  • Build:
  • bpo-47032: Ensure Windows install builds fail correctly with a non-zero exit code when part of the build fails.
  • bpo-47024: Update OpenSSL to 1.1.1n for macOS installers and all Windows builds.
  • bpo-38472: Fix GCC detection in setup.py when cross-compiling. The C compiler is now run with LC_ALL=C. Previously, the detection failed with a German locale.
  • bpo-46513: configure no longer uses AC_C_CHAR_UNSIGNED macro and pyconfig.h no longer defines reserved symbol __CHAR_UNSIGNED__.
  • bpo-45925: Update Windows installer to use SQLite 3.37.2.
  • Windows:
  • bpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate CVE-2016-3189 and CVE-2019-12900
  • bpo-46948: Prevent CVE-2022-26488 by ensuring the Add to PATH option in the Windows installer uses the correct path when being repaired.
  • bpo-46638: Ensures registry virtualization is consistently disabled. For 3.10 and earlier, it remains enabled (some registry writes are protected), while for 3.11 and later it is disabled (registry modifications affect all applications).
  • macOS:
  • bpo-45925: Update macOS installer to SQLite 3.37.2.
  • IDLE:
  • bpo-46630: Make query dialogs on Windows start with a cursor in the entry box.
  • bpo-45296: Clarify close, quit, and exit in IDLE. In the File menu, ‘Close’ and ‘Exit’ are now ‘Close Window’ (the current one) and ‘Exit’ is now ‘Exit IDLE’ (by closing all windows). In Shell, ‘quit()’ and ‘exit()’ mean ‘close Shell’. If there are no other windows, this also exits IDLE.
  • bpo-45447: Apply IDLE syntax highlighting to pyi files. Patch by Alex Waygood and Terry Jan Reedy.
  • C API:
  • bpo-46433: The internal function _PyType_GetModuleByDef now correctly handles inheritance patterns involving static types.
  • bpo-14916: Fixed bug in the tokenizer that prevented PyRun_InteractiveOne from parsing from the provided FD.

New in Python 3.10.2 (Mar 16, 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.
  • macOS:
  • bpo-40477: The Python Launcher app for macOS now properly launches scripts and, if necessary, the Terminal app when running on recent macOS releases.
  • 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)

  • Core and Builtins:
  • bpo-42268: Fail the configure step if the selected compiler doesn’t support memory sanitizer. Patch by Pablo Galindo
  • bpo-45727: Refine the custom syntax error that suggests that a comma may be missing to trigger only when the expressions are detected between parentheses or brackets. Patch by Pablo Galindo
  • bpo-45614: Fix traceback display for exceptions with invalid module name.
  • bpo-45848: Allow the parser to obtain error lines directly from encoded files. Patch by Pablo Galindo
  • bpo-45826: Fixed a crash when calling .with_traceback(None) on NameError. This occurs internally in unittest.TestCase.assertRaises().
  • bpo-45822: Fixed a bug in the parser that was causing it to not respect PEP 263 coding cookies when no flags are provided. Patch by Pablo Galindo
  • bpo-45820: Fix a segfault when the parser fails without reading any input. Patch by Pablo Galindo
  • bpo-42540: Fix crash when os.fork() is called with an active non-default memory allocator.
  • bpo-45738: Fix computation of error location for invalid continuation characters in the parser. Patch by Pablo Galindo.
  • bpo-45773: Fix a compiler hang when attempting to optimize certain jump patterns.
  • bpo-45716: Improve the SyntaxError message when using True, None or False as keywords in a function call. Patch by Pablo Galindo.
  • bpo-45688: sys.stdlib_module_names now contains the macOS-specific module _scproxy.
  • bpo-30570: Fixed a crash in issubclass() from infinite recursion when searching pathological __bases__ tuples.
  • bpo-45521: Fix a bug in the obmalloc radix tree code. On 64-bit machines, the bug causes the tree to hold 46-bits of virtual addresses, rather than the intended 48-bits.
  • bpo-45494: Fix parser crash when reporting errors involving invalid continuation characters. Patch by Pablo Galindo.
  • bpo-45408: Fix a crash in the parser when reporting tokenizer errors that occur at the same time unclosed parentheses are detected. Patch by Pablo Galindo.
  • bpo-45385: Fix reference leak from descr_check. Patch by Dong-hee Na.
  • bpo-45167: Fix deepcopying of types.GenericAlias objects.
  • bpo-44219: Release the GIL while performing isatty system calls on arbitrary file descriptors. In particular, this affects os.isatty(), os.device_encoding() and io.TextIOWrapper. By extension, io.open() in text mode is also affected. This change solves a deadlock in os.isatty(). Patch by Vincent Michel in bpo-44219.
  • bpo-44959: Added fallback to extension modules with ‘.sl’ suffix on HP-UX
  • bpo-44050: Extensions that indicate they use global state (by setting m_size to -1) can again be used in multiple interpreters. This reverts to behavior of Python 3.8.
  • bpo-45121: Fix issue where Protocol.__init__ raises RecursionError when it’s called directly or via super(). Patch provided by Yurii Karabas.
  • bpo-45083: When the interpreter renders an exception, its name now has a complete qualname. Previously only the class name was concatenated to the module name, which sometimes resulted in an incorrect full name being displayed.
  • (This issue impacted only the C code exception rendering, the traceback module was using qualname already).
  • bpo-45056: Compiler now removes trailing unused constants from co_consts.
  • Library:
  • bpo-27946: Fix possible crash when getting an attribute of class:xml.etree.ElementTree.Element simultaneously with replacing the attrib dict.
  • bpo-37658: Fix issue when on certain conditions asyncio.wait_for() may allow a coroutine to complete successfully, but fail to return the result, potentially causing memory leaks or other issues.
  • bpo-44649: Handle dataclass(slots=True) with a field that has default a default value, but for which init=False.
  • bpo-45803: Added missing kw_only parameter to dataclasses.make_dataclass().
  • bpo-45831: faulthandler can now write ASCII-only strings (like filenames and function names) with a single write() syscall when dumping a traceback. It reduces the risk of getting an unreadable dump when two threads or two processes dump a traceback to the same file (like stderr) at the same time. Patch by Victor Stinner.
  • bpo-41735: Fix thread lock in zlib.Decompress.flush() method before PyObject_GetBuffer.
  • bpo-45235: Reverted an argparse bugfix that caused regression in the handling of default arguments for subparsers. This prevented leaf level arguments from taking precedence over root level arguments.
  • bpo-45765: In importlib.metadata, fix distribution discovery for an empty path.
  • bpo-45757: Fix bug where dis produced an incorrect oparg when EXTENDED_ARG is followed by an opcode that does not use its argument.
  • bpo-45644: In-place JSON file formatting using python3 -m json.tool infile infile now works correctly, previously it left the file empty. Patch by Chris Wesseling.
  • bpo-45679: Fix caching of multi-value typing.Literal. Literal[True, 2] is no longer equal to Literal[1, 2].
  • bpo-45664: Fix types.resolve_bases() and types.new_class() for types.GenericAlias instance as a base.
  • bpo-45663: Fix dataclasses.is_dataclass() for dataclasses which are subclasses of types.GenericAlias.
  • bpo-45662: Fix the repr of dataclasses.InitVar with a type alias to the built-in class, e.g. InitVar[list[int]].
  • bpo-45438: Fix typing.Signature string representation for generic builtin types.
  • bpo-45574: Fix warning about print_escape being unused.
  • bpo-45581: sqlite3.connect() now correctly raises MemoryError if the underlying SQLite API signals memory error. Patch by Erlend E. Aasland.
  • bpo-45557: pprint.pprint() now handles underscore_numbers correctly. Previously it was always setting it to False.
  • bpo-45515: Add references to zoneinfo in the datetime documentation, mostly replacing outdated references to dateutil.tz. Change by Paul Ganssle.
  • bpo-45475: Reverted optimization of iterating gzip.GzipFile, bz2.BZ2File, and lzma.LZMAFile (see bpo-43787) because it caused regression when user iterate them without having reference of them. Patch by Inada Naoki.
  • bpo-45428: Fix a regression in py_compile when reading filenames from standard input.
  • bpo-45467: Fix incremental decoder and stream reader in the “raw-unicode-escape” codec. Previously they failed if the escape sequence was split.
  • bpo-45461: Fix incremental decoder and stream reader in the “unicode-escape” codec. Previously they failed if the escape sequence was split.
  • bpo-45239: Fixed email.utils.parsedate_tz() crashing with UnboundLocalError on certain invalid input instead of returning None. Patch by Ben Hoyt.
  • bpo-45249: Fix the behaviour of traceback.print_exc() when displaying the caret when the end_offset in the exception is set to 0. Patch by Pablo Galindo
  • bpo-45416: Fix use of asyncio.Condition with explicit asyncio.Lock objects, which was a regression due to removal of explicit loop arguments. Patch by Joongi Kim.
  • bpo-45419: Correct interfaces on DegenerateFiles.Path.
  • bpo-44904: Fix bug in the doctest module that caused it to fail if a docstring included an example with a classmethod property. Patch by Alex Waygood.
  • bpo-45406: Make inspect.getmodule() catch FileNotFoundError raised by :’func:inspect.getabsfile, and return None to indicate that the module could not be determined.
  • bpo-45262: Prevent use-after-free in asyncio. Make sure the cached running loop holder gets cleared on dealloc to prevent use-after-free in get_running_loop
  • bpo-45386: Make xmlrpc.client more robust to C runtimes where the underlying C strftime function results in a ValueError when testing for year formatting options.
  • bpo-45371: Fix clang rpath issue in distutils. The UnixCCompiler now uses correct clang option to add a runtime library directory (rpath) to a shared library.
  • bpo-20028: Improve error message of csv.Dialect when initializing. Patch by Vajrasky Kok and Dong-hee Na.
  • bpo-45343: Update bundled pip to 21.2.4 and setuptools to 58.1.0
  • bpo-45329: Fix freed memory access in pyexpat.xmlparser when building it with an installed expat library = 20170401.
  • Windows:
  • bpo-45901: When installed through the Microsoft Store and set as the default app for *.py files, command line arguments will now be passed to Python when invoking a script without explicitly launching Python (that is, script.py args rather than python script.py args).
  • bpo-45616: Fix Python Launcher’s ability to distinguish between versions 3.1 and 3.10 when either one is explicitly requested. Previously, 3.1 would be used if 3.10 was requested but not installed, and 3.10 would be used if 3.1 was requested but 3.10 was installed.
  • bpo-45732: Updates bundled Tcl/Tk to 8.6.12.
  • bpo-45720: Internal reference to shlwapi.dll was dropped to help improve startup time. This DLL will no longer be loaded at the start of every Python process.
  • bpo-43652: Update Tcl/Tk to 8.6.11, actually this time. The previous update incorrectly included 8.6.10.
  • bpo-45337: venv now warns when the created environment may need to be accessed at a different path, due to redirections, links or junctions. It also now correctly installs or upgrades components when the alternate path is required.
  • macOS:
  • bpo-45732: Update python.org macOS installer to use Tcl/Tk 8.6.12.
  • bpo-44828: Avoid tkinter file dialog failure on macOS 12 Monterey when using the Tk 8.6.11 provided by python.org macOS installers. Patch by Marc Culler of the Tk project.
  • bpo-34602: When building CPython on macOS with ./configure --with-undefined-behavior-sanitizer --with-pydebug, the stack size is now quadrupled to allow for the entire test suite to pass.
  • IDLE:
  • bpo-45495: Add context keywords ‘case’ and ‘match’ to completions list.
  • bpo-45296: On Windows, change exit/quit message to suggest Ctrl-D, which works, instead of , which does not work in IDLE.
  • bpo-45193: Make completion boxes appear on Ubuntu again.
  • Tools/Demos:
  • bpo-44786: Fix a warning in regular expression in the c-analyzer script.
  • C API:
  • bpo-39026: Fix Python.h to build C extensions with Xcode: remove a relative include from Include/cpython/pystate.h.
  • bpo-45307: Restore the private C API function _PyImport_FindExtensionObject(). It will be removed in Python 3.11.
  • bpo-44687: BufferedReader.peek() no longer raises ValueError when the entire file has already been buffered.
  • bpo-44751: Remove crypt.h include from the public Python.h header.

New in Python 3.10.0 (Oct 8, 2021)

  • 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)

  • Security:
  • bpo-42278: Replaced usage of tempfile.mktemp() with TemporaryDirectory to avoid a potential race condition.
  • bpo-41180: Add auditing events to the marshal module, and stop raising code.__init__ events for every unmarshalled code object. Directly instantiated code objects will continue to raise an event, and audit event handlers should inspect or collect the raw marshal data. This reduces a significant performance overhead when loading from .pyc files.
  • bpo-44394: Update the vendored copy of libexpat to 2.4.1 (from 2.2.8) to get the fix for the CVE-2013-0340 “Billion Laughs” vulnerability. This copy is most used on Windows and macOS.
  • bpo-43124: Made the internal putcmd function in smtplib sanitize input for presence of r and n characters to avoid (unlikely) command injection.
  • Core and Builtins:
  • bpo-45018: Fixed pickling of range iterators that iterated for over 2**32 times.
  • bpo-44962: Fix a race in WeakKeyDictionary, WeakValueDictionary and WeakSet when two threads attempt to commit the last pending removal. This fixes asyncio.create_task and fixes a data loss in asyncio.run where shutdown_asyncgens is not run
  • bpo-44954: Fixed a corner case bug where the result of float.fromhex('0x.8p-1074') was rounded the wrong way.
  • bpo-44947: Refine the syntax error for trailing commas in import statements. Patch by Pablo Galindo.
  • bpo-44698: Restore behaviour of complex exponentiation with integer-valued exponent of type float or complex.
  • bpo-44885: Correct the ast locations of f-strings with format specs and repeated expressions. Patch by Pablo Galindo
  • bpo-44872: Use new trashcan macros (Py_TRASHCAN_BEGIN/END) in frameobject.c instead of the old ones (Py_TRASHCAN_SAFE_BEGIN/END).
  • bpo-33930: Fix segmentation fault with deep recursion when cleaning method objects. Patch by Augusto Goulart and Pablo Galindo.
  • bpo-25782: Fix bug where PyErr_SetObject hangs when the current exception has a cycle in its context chain.
  • bpo-44856: Fix reference leaks in the error paths of update_bases() and __build_class__. Patch by Pablo Galindo.
  • bpo-44698: Fix undefined behaviour in complex object exponentiation.
  • bpo-44562: Remove uses of PyObject_GC_Del() in error path when initializing types.GenericAlias.
  • bpo-44523: Remove the pass-through for hash() of weakref.proxy objects to prevent unintended consequences when the original referred object dies while the proxy is part of a hashable object. Patch by Pablo Galindo.
  • bpo-44472: Fix ltrace functionality when exceptions are raised. Patch by Pablo Galindo
  • bpo-44184: Fix a crash at Python exit when a deallocator function removes the last strong reference to a heap type. Patch by Victor Stinner.
  • bpo-39091: Fix crash when using passing a non-exception to a generator’s throw() method. Patch by Noah Oxer
  • Library:
  • bpo-41620: run() now always return a TestResult instance. Previously it returned None if the test class or method was decorated with a skipping decorator.
  • bpo-43913: Fix bugs in cleaning up classes and modules in unittest:
  • Functions registered with addModuleCleanup() were not called unless the user defines tearDownModule() in their test module.
  • Functions registered with addClassCleanup() were not called if tearDownClass is set to None.
  • Buffering in TestResult did not work with functions registered with addClassCleanup() and addModuleCleanup().
  • Errors in functions registered with addClassCleanup() and addModuleCleanup() were not handled correctly in buffered and debug modes.
  • Errors in setUpModule() and functions registered with addModuleCleanup() were reported in wrong order.
  • And several lesser bugs.
  • bpo-45001: Made email date parsing more robust against malformed input, namely a whitespace-only Date: header. Patch by Wouter Bolsterlee.
  • bpo-44449: Fix a crash in the signal handler of the faulthandler module: no longer modify the reference count of frame objects. Patch by Victor Stinner.
  • bpo-44955: Method stopTestRun() is now always called in pair with method startTestRun() for TestResult objects implicitly created in run(). Previously it was not called for test methods and classes decorated with a skipping decorator.
  • bpo-38956: argparse.BooleanOptionalAction’s default value is no longer printed twice when used with argparse.ArgumentDefaultsHelpFormatter.
  • bpo-44581: Upgrade bundled pip to 21.2.3 and setuptools to 57.4.0
  • bpo-44849: Fix the os.set_inheritable() function on FreeBSD 14 for file descriptor opened with the O_PATH flag: ignore the EBADF error on ioctl(), fallback on the fcntl() implementation. Patch by Victor Stinner.
  • bpo-44605: The @functools.total_ordering() decorator now works with metaclasses.
  • bpo-44822: sqlite3 user-defined functions and aggregators returning strings with embedded NUL characters are no longer truncated. Patch by Erlend E. Aasland.
  • bpo-44815: Always show loop= arg deprecations in asyncio.gather() and asyncio.sleep()
  • bpo-44806: Non-protocol subclasses of typing.Protocol ignore now the __init__ method inherited from protocol base classes.
  • bpo-44667: The tokenize.tokenize() doesn’t incorrectly generate a NEWLINE token if the source doesn’t end with a new line character but the last line is a comment, as the function is already generating a NL token. Patch by Pablo Galindo
  • bpo-42853: Fix http.client.HTTPSConnection fails to download >2GiB data.
  • bpo-44752: rcompleter does not call getattr() on property objects to avoid the side-effect of evaluating the corresponding method.
  • bpo-44720: weakref.proxy objects referencing non-iterators now raise TypeError rather than dereferencing the null tp_iternext slot and crashing.
  • bpo-44704: The implementation of collections.abc.Set._hash() now matches that of frozenset.__hash__().
  • bpo-44666: Fixed issue in compileall.compile_file() when sys.stdout is redirected. Patch by Stefan Hölzl.
  • bpo-40897: Give priority to using the current class constructor in inspect.signature(). Patch by Weipeng Hong.
  • bpo-44608: Fix memory leak in _tkinter._flatten() if it is called with a sequence or set, but not list or tuple.
  • bpo-41928: Update shutil.copyfile() to raise FileNotFoundError instead of confusing IsADirectoryError when a path ending with a os.path.sep does not exist; shutil.copy() and shutil.copy2() are also affected.
  • bpo-44566: handle StopIteration subclass raised from @contextlib.contextmanager generator
  • bpo-44558: Make the implementation consistency of indexOf() between C and Python versions. Patch by Dong-hee Na.
  • bpo-41249: Fixes TypedDict to work with typing.get_type_hints() and postponed evaluation of annotations across modules.
  • bpo-44461: Fix bug with pdb’s handling of import error due to a package which does not have a __main__ module
  • bpo-42892: Fixed an exception thrown while parsing a malformed multipart email by email.message.EmailMessage.
  • bpo-27827: pathlib.PureWindowsPath.is_reserved() now identifies a greater range of reserved filenames, including those with trailing spaces or colons.
  • bpo-34266: Handle exceptions from parsing the arg of pdb’s run/restart command.
  • bpo-27334: The sqlite3 context manager now performs a rollback (thus releasing the database lock) if commit failed. Patch by Luca Citi and Erlend E. Aasland.
  • bpo-43853: Improved string handling for sqlite3 user-defined functions and aggregates
  • It is now possible to pass strings with embedded null characters to UDFs
  • Conversion failures now correctly raise MemoryError
  • Patch by Erlend E. Aasland.
  • bpo-43048: Handle RecursionError in TracebackException’s constructor, so that long exceptions chains are truncated instead of causing traceback formatting to fail.
  • bpo-41402: Fix email.message.EmailMessage.set_content() when called with binary data and 7bit content transfer encoding.
  • bpo-32695: The compresslevel and preset keyword arguments of tarfile.open() are now both documented and tested.
  • bpo-34990: Fixed a Y2k38 bug in the compileall module where it would fail to compile files with a modification time after the year 2038.
  • bpo-38840: Fix test___all__ on platforms lacking a shared memory implementation.
  • bpo-30256: Pass multiprocessing BaseProxy argument manager_owned through AutoProxy.
  • bpo-27513: email.utils.getaddresses() now accepts email.header.Header objects along with string values. Patch by Zackery Spytz.
  • bpo-33349: lib2to3 now recognizes async generators everywhere.
  • bpo-29298: Fix TypeError when required subparsers without dest do not receive arguments. Patch by Anthony Sottile.
  • Documentation:
  • bpo-44903: Removed the othergui.rst file, any references to it, and the list of GUI frameworks in the FAQ. In their place I’ve added links to the Python Wiki page on GUI frameworks.
  • bpo-44693: Update the definition of __future__ in the glossary by replacing the confusing word “pseudo-module” with a more accurate description.
  • bpo-35183: Add typical examples to os.path.splitext docs
  • bpo-30511: Clarify that shutil.make_archive() is not thread-safe due to reliance on changing the current working directory.
  • bpo-44561: Update of three expired hyperlinks in Doc/distributing/index.rst: “Project structure”, “Building and packaging the project”, and “Uploading the project to the Python Packaging Index”.
  • bpo-42958: Updated the docstring and docs of filecmp.cmp() to be more accurate and less confusing especially in respect to shallow arg.
  • bpo-44558: Match the docstring and python implementation of countOf() to the behavior of its c implementation.
  • bpo-44544: List all kwargs for textwrap.wrap(), textwrap.fill(), and textwrap.shorten(). Now, there are nav links to attributes of TextWrap, which makes navigation much easier while minimizing duplication in the documentation.
  • bpo-38062: Clarify that atexit uses equality comparisons internally.
  • bpo-43066: Added a warning to zipfile docs: filename arg with a leading slash may cause archive to be un-openable on Windows systems.
  • bpo-27752: Documentation of csv.Dialect is more descriptive.
  • bpo-44453: Fix documentation for the return type of sysconfig.get_path().
  • bpo-39498: Add a “Security Considerations” index which links to standard library modules that have explicitly documented security considerations.
  • bpo-33479: Remove the unqualified claim that tkinter is threadsafe. It has not been true for several years and likely never was. An explanation of what is true may be added later, after more discussion, and possibly after patching _tkinter.c,
  • Tests:
  • bpo-25130: Add calls of gc.collect() in tests to support PyPy.
  • bpo-45011: Made tests relying on the _asyncio C extension module optional to allow running on alternative Python implementations. Patch by Serhiy Storchaka.
  • bpo-44949: Fix auto history tests of test_readline: sometimes, the newline character is not written at the end, so don’t expect it in the output.
  • bpo-44852: Add ability to wholesale silence DeprecationWarnings while running the regression test suite.
  • bpo-40928: Notify users running test_decimal regression tests on macOS of potential harmless “malloc can’t allocate region” messages spewed by test_decimal.
  • bpo-44734: Fixed floating point precision issue in turtle tests.
  • bpo-44708: Regression tests, when run with -w, are now re-running only the affected test methods instead of re-running the entire test file.
  • bpo-30256: Add test for nested queues when using multiprocessing shared objects AutoProxy[Queue] inside ListProxy and DictProxy
  • Build:
  • bpo-44535: Enable building using a Visual Studio 2022 install on Windows.
  • bpo-43298: Improved error message when building without a Windows SDK installed.
  • Windows:
  • bpo-45007: Update to OpenSSL 1.1.1l in Windows build
  • bpo-44572: Avoid consuming standard input in the platform module
  • bpo-40263: This is a follow-on bug from https://bugs.python.org/issue26903. Once that is applied we run into an off-by-one assertion problem. The assert was not correct.
  • macOS:
  • bpo-45007: Update macOS installer builds to use OpenSSL 1.1.1l.
  • bpo-44689: ctypes.util.find_library() now works correctly on macOS 11 Big Sur even if Python is built on an older version of macOS. Previously, when built on older macOS systems, find_library was not able to find macOS system libraries when running on Big Sur due to changes in how system libraries are stored.

New in Python 3.9.6 (Jul 8, 2021)

  • Security:
  • bpo-44022: mod:http.client now avoids infinitely reading potential HTTP headers after a 100 Continue status response from the server.
  • Core and Builtins
  • bpo-44409: Fix error location information for tokenizer errors raised on initialization of the tokenizer. Patch by Pablo Galindo.
  • bpo-43667: Improve Unicode support in non-UTF locales on Oracle Solaris. This issue does not affect other Solaris systems.
  • bpo-44168: Fix error message in the parser involving keyword arguments with invalid expressions. Patch by Pablo Galindo
  • bpo-44114: Fix incorrect dictkeys_reversed and dictitems_reversed function signatures in C code, which broke webassembly builds.
  • bpo-44070: No longer eagerly makes import filenames absolute, except for extension modules, which was introduced in 3.9.5.
  • bpo-28146: Fix a confusing error message in str.format().
  • bpo-11105: When compiling ast.AST objects with recursive references through compile(), the interpreter doesn’t crash anymore instead it raises a RecursionError.
  • Library:
  • bpo-44516: Update vendored pip to 21.1.3
  • bpo-44482: Fix very unlikely resource leak in glob in alternate Python implementations.
  • bpo-44439: Fix in bz2.BZ2File.write() / lzma.LZMAFile.write() methods, when the input data is an object that supports the buffer protocol, the file length may be wrong.
  • bpo-44434: _thread.start_new_thread() no longer calls PyThread_exit_thread() explicitly at the thread exit, the call was redundant. On Linux with the glibc, pthread_exit() aborts the whole process if dlopen() fails to open libgcc_s.so file (ex: EMFILE error). Patch by Victor Stinner.
  • bpo-44422: The threading.enumerate() function now uses a reentrant lock to prevent a hang on reentrant call. Patch by Victor Stinner.
  • bpo-44395: Fix as_string() to pass unixfrom properly. Patch by Dong-hee Na.
  • bpo-44342: [Enum] Be more robust in searching for pickle support before making an enum class unpicklable.
  • bpo-44356: [Enum] Allow multiple data-type mixins if they are all the same.
  • bpo-44254: On Mac, give turtledemo button text a color that works on both light or dark background. Programmers cannot control the latter.
  • bpo-44145: hmac computations were not releasing the GIL while calling the OpenSSL HMAC_Update C API (a new feature in 3.9). This unintentionally prevented parallel computation as other hashlib algorithms support.
  • bpo-37788: Fix a reference leak when a Thread object is never joined.
  • bpo-44061: Fix regression in previous release when calling pkgutil.iter_modules() with a list of pathlib.Path objects
  • bpo-36515: The hashlib module no longer does unaligned memory accesses when compiled for ARM platforms.
  • bpo-44018: random.seed() no longer mutates bytearray inputs.
  • bpo-38352: Add IO, BinaryIO, TextIO, Match, and Pattern to typing.__all__. Patch by Jelle Zijlstra.
  • bpo-43972: When http.server.SimpleHTTPRequestHandler sends a 301 (Moved Permanently) for a directory path not ending with /, add a Content-Length: 0 header. This improves the behavior for certain clients.
  • bpo-28528: Fix a bug in pdb where checkline() raises AttributeError if it is called after reset().
  • bpo-43776: When subprocess.Popen args are provided as a string or as pathlib.Path, the Popen instance repr now shows the right thing.
  • bpo-43666: AIX: Lib/_aix_support.get_platform() may fail in an AIX WPAR. The fileset bos.rte appears to have a builddate in both LPAR and WPAR so this fileset is queried rather than bos.mp64. To prevent a similiar situation (no builddate in ODM) a value (9988) sufficient for completing a build is provided. Patch by M Felt.
  • bpo-43650: Fix MemoryError in shutil.unpack_archive() which fails inside shutil._unpack_zipfile() on large files. Patch by Igor Bolshakov.
  • bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints.
  • bpo-43295: datetime.datetime.strptime() now raises ValueError instead of IndexError when matching 'z' with the %z format specifier.
  • bpo-37022: pdb now displays exceptions from repr() with its p and pp commands.
  • Documentation:
  • bpo-40620: Convert examples in tutorial controlflow.rst section 4.3 to be interpreter-demo style.
  • bpo-13814: In the Design FAQ, answer “Why don’t generators support the with statement?”
  • bpo-44392: Added a new section in the C API documentation for types used in type hinting. Documented Py_GenericAlias and Py_GenericAliasType.
  • bpo-38291: Mark typing.io and typing.re as deprecated since Python 3.8 in the documentation. They were never properly supported by type checkers.
  • bpo-44322: Document that SyntaxError args have a details tuple and that details are adjusted for errors in f-string field replacement expressions.
  • bpo-44195: Corrected references to TraversableResources in docs. There is no TraversableReader.
  • bpo-41963: Document that ConfigParser strips off comments when reading configuration files.
  • bpo-44072: Correct where in the numeric ABC hierarchy ** support is added, i.e., in numbers.Complex, not numbers.Integral.
  • bpo-43558: Add the remark to dataclasses documentation that the __init__() of any base class has to be called in __post_init__(), along with a code example.
  • bpo-41621: Document that collections.defaultdict parameter default_factory defaults to None and is positional-only.
  • Tests:
  • bpo-44287: Fix asyncio test_popen() of test_windows_utils by using a longer timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT timeout rather than a hardcoded timeout of 10 seconds: it’s 30 seconds by default, but it is made longer on slow buildbots. Patch by Victor Stinner.
  • bpo-44363: Account for address sanitizer in test_capi. test_capi now passes when run GCC address sanitizer.
  • Build:
  • bpo-44381: The Windows build now accepts EnableControlFlowGuard set to guard to enable CFG.
  • Windows:
  • bpo-41299: Fix 16ms jitter when using timeouts in threading, such as with threading.Lock.acquire() or threading.Condition.wait().
  • macOS:
  • bpo-43568: Relax unnecessarily restrictive MACOSX_DEPLOYMENT_TARGET check when building extension modules for macOS. Patch by Joshua Root.
  • bpo-43109: Allow –with-lto configure option to work with Apple-supplied Xcode or Command Line Tools.
  • IDLE:
  • bpo-40128: Mostly fix completions on macOS when not using tcl/tk 8.6.11 (as with 3.9). The added update_idletask call should be harmless and possibly helpful otherwise.
  • bpo-33962: Move the indent space setting from the Font tab to the new Windows tab. Patch by Mark Roseman and Terry Jan Reedy.
  • bpo-40468: Split the settings dialog General tab into Windows and Shell/ED tabs. Move help sources, which extend the Help menu, to the Extensions tab. Make space for new options and shorten the dialog. The latter makes the dialog better fit small screens.
  • bpo-41611: Avoid uncaught exceptions in AutoCompleteWindow.winconfig_event().
  • bpo-41611: Fix IDLE sometimes freezing upon tab-completion on macOS.
  • Tools/Demos:
  • bpo-44074: Make patchcheck automatically detect the correct base branch name (previously it was hardcoded to ‘master’)
  • C API:
  • bpo-44441: Py_RunMain() now resets PyImport_Inittab to its initial value at exit. It must be possible to call PyImport_AppendInittab() or PyImport_ExtendInittab() at each Python initialization. Patch by Victor Stinner.
  • bpo-42083: Fix crash in PyStructSequence_NewType() when passed NULL in the documentation string slot.

New in Python 3.9.5 (Jun 28, 2021)

  • Security:
  • bpo-43434: 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.
  • bpo-43882: 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.
  • bpo-43472: Ensures interpreter-level audit hooks receive the cpython.PyInterpreterState_New event when called through the _xxsubinterpreters module.
  • bpo-36384: 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.
  • bpo-43075: 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.
  • bpo-42800: Audit hooks are now fired for frame.f_code, traceback.tb_frame, and generator code/frame attribute access.
  • Core and Builtins
  • bpo-43105: Importlib now resolves relative paths when creating module spec objects from file locations.
  • bpo-42924: 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:
  • bpo-43993: Update bundled pip to 21.1.1.
  • bpo-43937: Fixed the turtle module working with non-default root window.
  • bpo-43930: Update bundled pip to 21.1 and setuptools to 56.0.0
  • bpo-43920: OpenSSL 3.0.0: load_verify_locations() now returns a consistent error message when cadata contains no valid certificate.
  • bpo-43607: urllib can now convert Windows paths with \? prefixes into URL paths.
  • bpo-43284: 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.
  • bpo-42248: [Enum] ensure exceptions raised in _missing_ are released.
  • bpo-43799: OpenSSL 3.0.0: define OPENSSL_API_COMPAT 1.1.1 to suppress deprecation warnings. Python requires OpenSSL 1.1.1 APIs.
  • bpo-43794: Add ssl.OP_IGNORE_UNEXPECTED_EOF constants (OpenSSL 3.0.0)
  • bpo-43789: OpenSSL 3.0.0: Don’t call the password callback function a second time when first call has signaled an error condition.
  • bpo-43788: 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.
  • bpo-43655: tkinter dialog windows are now recognized as dialogs by window managers on macOS and X Window.
  • bpo-43534: turtle.textinput() and turtle.numinput() create now a transient window working on behalf of the canvas window.
  • bpo-43522: Fix problem with hostname_checks_common_name. OpenSSL does not copy hostflags from struct SSL_CTX to struct SSL.
  • bpo-42967: Allow bytes separator argument in urllib.parse.parse_qs and urllib.parse.parse_qsl when parsing str query strings. Previously, this raised a TypeError.
  • bpo-43176: Fixed processing of a dataclass that inherits from a frozen dataclass with no fields. It is now correctly detected as an error.
  • bpo-41735: Fix thread locks in zlib module may go wrong in rare case. Patch by Ma Lin.
  • bpo-36470: Fix dataclasses with InitVars and replace(). Patch by Claudiu Popa.
  • bpo-32745: 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:
  • bpo-43959: The documentation on the PyContextVar C-API was clarified.
  • bpo-43938: Update dataclasses documentation to express that FrozenInstanceError is derived from AttributeError.
  • bpo-43755: 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.
  • bpo-43739: Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type.
  • Tests:
  • bpo-43961: Fix test_logging.test_namer_rotator_inheritance() on Windows: use os.replace() rather than os.rename(). Patch by Victor Stinner.
  • bpo-43842: 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.
  • bpo-43811: Tests multiple OpenSSL versions on GitHub Actions. Use ccache to speed up testing.
  • bpo-43791: OpenSSL 3.0.0: Disable testing of legacy protocols TLS 1.0 and 1.1. Tests are failing with TLSV1_ALERT_INTERNAL_ERROR.
  • Windows:
  • bpo-35306: Avoid raising errors from pathlib.Path.exists() when passed an invalid filename.
  • bpo-38822: 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().
  • bpo-26227: Fixed decoding of host names in socket.gethostbyaddr() and socket.gethostbyname_ex().
  • bpo-40432: 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.
  • bpo-43745: Actually updates Windows release to OpenSSL 1.1.1k. Earlier releases were mislabelled and actually included 1.1.1i again.
  • bpo-43492: Upgrade Windows installer to use SQLite 3.35.5.
  • macOS:
  • bpo-42119: Fix check for macOS SDK paths when building Python. Narrow search to match contents of SDKs, namely only files in /System/Library, /System/IOSSupport, and /usr other than /usr/local. Previously, anything under /System was assumed to be in an SDK which causes problems with the new file system layout in 10.15+ where user file systems may appear to be mounted under /System. Paths in /Library were also incorrectly treated as SDK locations.
  • bpo-44009: Provide “python3.x-intel64” executable to allow reliably forcing macOS universal2 framework builds to run under Rosetta 2 Intel-64 emulation on Apple Silicon Macs. This can be useful for testing or when universal2 wheels are not yet available.
  • bpo-43492: Update macOS installer to use SQLite 3.35.4.
  • IDLE:
  • bpo-43655: 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 5, 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 ’ 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.9.1 (Dec 8, 2020)

  • Core and Builtins:
  • bpo-42576: types.GenericAlias will now raise a TypeError when attempting to initialize with a keyword argument. Previously, this would cause the interpreter to crash if the interpreter was compiled with debug symbols. This does not affect interpreters compiled for release. Patch by Ken Jin.
  • Library:
  • bpo-5054: CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed. Replace the special purpose getallmatchingheaders with generic get_all method and add relevant tests.
  • Original Patch by Martin Panter. Modified by Senthil Kumaran.
  • bpo-17735: inspect.findsource() now raises OSError instead of IndexError when co_lineno of a code object is greater than the file length. This can happen, for example, when a file is edited after it was imported. PR by Irit Katriel.
  • bpo-42116: Fix handling of trailing comments by inspect.getsource().
  • bpo-42487: ChainMap.__iter__ no longer calls __getitem__ on underlying maps
  • bpo-42482: TracebackException no longer holds a reference to the exception’s traceback object. Consequently, instances of TracebackException for equivalent but non-equal exceptions now compare as equal.
  • bpo-42406: We fixed an issue in pickle.whichmodule in which importing multiprocessing could change the how pickle identifies which module an object belongs to, potentially breaking the unpickling of those objects.
  • bpo-34215: Clarify the error message for asyncio.IncompleteReadError when expected is None.
  • bpo-12800: Extracting a symlink from a tarball should succeed and overwrite the symlink if it already exists. The fix is to remove the existing file or symlink before extraction. Based on patch by Chris AtLee, Jeffrey Kintscher, and Senthil Kumaran.
  • Tests:
  • bpo-41473: Reenable test_gdb on gdb 9.2 and newer: https://bugzilla.redhat.com/show_bug.cgi?id=1866884 bug is fixed in gdb 10.1.
  • bpo-42553: Fix test_asyncio.test_call_later() race condition: don’t measure asyncio performance in the call_later() unit test. The test failed randomly on the CI.
  • macOS:
  • bpo-41116: If no explicit macOS SDK was specified, setup.py should check for Tcl and TK frameworks in /Library/Frameworks; the previous commit inadvertently broke that test.
  • bpo-42504: Fix build on macOS Big Sur when MACOSX_DEPLOYMENT_TARGET=11
  • IDLE:
  • bpo-42508: Keep IDLE running on macOS. Remove obsolete workaround that prevented running files with shortcuts when using new universal2 installers built on macOS 11.

New in Python 3.9.1 RC 1 (Dec 8, 2020)

  • Security:
  • bpo-42103: Prevented potential DoS attack via CPU and RAM exhaustion when processing malformed Apple Property List files in binary format.
  • bpo-42051: The plistlib module no longer accepts entity declarations in XML plist files to avoid XML vulnerabilities. This should not affect users as entity declarations are not used in regular plist files.
  • bpo-40791: Add volatile to the accumulator variable in hmac.compare_digest, making constant-time-defeating optimizations less likely.
  • Core and Builtins:
  • bpo-41686: On Windows, the SIGINT event, _PyOS_SigintEvent(), is now created even if Python is configured to not install signal handlers (if PyConfig.install_signal_handlers equals to 0, or Py_InitializeEx(0)).
  • bpo-42381: Allow assignment expressions in set literals and set comprehensions as per PEP 572. Patch by Pablo Galindo.
  • bpo-42374: Fix a regression introduced by the new parser, where an unparenthesized walrus operator was not allowed within generator expressions.
  • bpo-42296: On Windows, fix a regression in signal handling which prevented to interrupt a program using CTRL+C. The signal handler can be run in a thread different than the Python thread, in which case the test deciding if the thread can handle signals is wrong.
  • bpo-42332: types.GenericAlias objects can now be the targets of weakrefs.
  • bpo-42218: Fixed a bug in the PEG parser that was causing crashes in debug mode. Now errors are checked in left-recursive rules to avoid cases where such errors do not get handled in time and appear as long-distance crashes in other places.
  • bpo-42214: Fixed a possible crash in the PEG parser when checking for the ‘!=’ token in the barry_as_flufl rule. Patch by Pablo Galindo.
  • bpo-42143: Fix handling of errors during creation of PyFunctionObject, which resulted in operations on uninitialized memory. Patch by Yonatan Goldschmidt.
  • bpo-41659: Fix a bug in the parser, where a curly brace following a primary didn’t fail immediately. This led to invalid expressions like a {b} to throw a SyntaxError with a wrong offset, or invalid expressions ending with a curly brace like a { to not fail immediately in the REPL.
  • bpo-42150: Fix possible buffer overflow in the new parser when checking for continuation lines. Patch by Pablo Galindo.
  • bpo-42123: Run the parser two times. On the first run, disable all the rules that only generate better error messages to gain performance. If there’s a parse failure, run the parser a second time with those enabled.
  • bpo-41910: Document the default implementation of object.__eq__.
  • bpo-42057: Fix peephole optimizer misoptimize conditional jump + JUMP_IF_NOT_EXC_MATCH pair.
  • bpo-41984: The garbage collector now tracks all user-defined classes. Patch by Brandt Bucher.
  • bpo-41993: Fixed potential issues with removing not completely initialized module from sys.modules when import fails.
  • bpo-41979: Star-unpacking is now allowed for with item’s targets in the PEG parser.
  • bpo-41909: Fixed stack overflow in issubclass() and isinstance() when getting the __bases__ attribute leads to infinite recursion.
  • bpo-41894: When loading a native module and a load failure occurs, prevent a possible UnicodeDecodeError when not running in a UTF-8 locale by decoding the load error message using the current locale’s encoding.
  • bpo-39934: Correctly count control blocks in ‘except’ in compiler. Ensures that a syntax error, rather a fatal error, occurs for deeply nested, named exception handlers.
  • Library:
  • bpo-42328: Fixed tkinter.ttk.Style.map(). The function accepts now the representation of the default state as empty sequence (as returned by Style.map()). The structure of the result is now the same on all platform and does not depend on the value of wantobjects.
  • bpo-42345: Fix various issues with typing.Literal parameter handling (flatten, deduplicate, use type to cache key). Patch provided by Yurii Karabas.
  • bpo-42350: Fix the threading.Thread class at fork: do nothing if the thread is already stopped (ex: fork called at Python exit). Previously, an error was logged in the child process.
  • bpo-42014: The onerror callback from shutil.rmtree now receives correct function when os.open fails.
  • bpo-42237: Fix os.sendfile() on illumos.
  • bpo-42249: Fixed writing binary Plist files larger than 4 GiB.
  • bpo-35455: On Solaris, thread_time() is now implemented with gethrvtime() because clock_gettime(CLOCK_THREAD_CPUTIME_ID) is not always available. Patch by Jakub Kulik.
  • bpo-42233: The repr() of typing types containing Generic Alias Types previously did not show the parameterized types in the GenericAlias. They have now been changed to do so.
  • bpo-41754: webbrowser: Ignore NotADirectoryError when calling xdg-settings.
  • bpo-29566: binhex.binhex() consisently writes macOS 9 line endings.
  • bpo-42183: Fix a stack overflow error for asyncio Task or Future repr().
  • The overflow occurs under some circumstances when a Task or Future recursively returns itself.
  • bpo-42146: Fix memory leak in subprocess.Popen() in case an uid (gid) specified in user (group, extra_groups) overflows uid_t (gid_t).
  • bpo-42140: Improve asyncio.wait function to create the futures set just one time.
  • bpo-42103: InvalidFileException and RecursionError are now the only errors caused by loading malformed binary Plist file (previously ValueError and TypeError could be raised in some specific cases).
  • bpo-41052: Pickling heap types implemented in C with protocols 0 and 1 raises now an error instead of producing incorrect data.
  • bpo-41491: plistlib: fix parsing XML plists with hexadecimal integer values
  • bpo-42065: Fix an incorrectly formatted error from _codecs.charmap_decode() when called with a mapped value outside the range of valid Unicode code points. PR by Max Bernstein.
  • bpo-41966: Fix pickling pure Python datetime.time subclasses. Patch by Dean Inwood.
  • bpo-41976: Fixed a bug that was causing ctypes.util.find_library() to return None when triying to locate a library in an environment when gcc>=9 is available and ldconfig is not. Patch by Pablo Galindo
  • bpo-41900: C14N 2.0 serialisation in xml.etree.ElementTree failed for unprefixed attributes when a default namespace was defined.
  • bpo-41840: Fix a bug in the symtable module that was causing module-scope global variables to not be reported as both local and global. Patch by Pablo Galindo.
  • bpo-41831: str() for the type attribute of the tkinter.Event object always returns now the numeric code returned by Tk instead of the name of the event type.
  • bpo-41817: fix tkinter.EventType Enum so all members are strings, and none are tuples
  • bpo-41815: Fix SQLite3 segfault when backing up closed database. Patch contributed by Peter David McCormick.
  • bpo-41316: Fix the tarfile module to write only basename of TAR file to GZIP compression header.
  • bpo-16936: Allow ctypes.wintypes to be imported on non-Windows systems.
  • bpo-40592: shutil.which() now ignores empty entries in PATHEXT instead of treating them as a match.
  • bpo-40550: Fix time-of-check/time-of-action issue in subprocess.Popen.send_signal.
  • bpo-40492: Fix --outfile for cProfile / profile not writing the output file in the original directory when the program being profiled changes the working directory. PR by Anthony Sottile.
  • bpo-40105: ZipFile truncates files to avoid corruption when a shorter comment is provided in append (“a”) mode. Patch by Jan Mazur.
  • bpo-27321: Fixed KeyError exception when flattening an email to a string attempts to replace a non-existent Content-Transfer-Encoding header.
  • Documentation:
  • bpo-42153: Fix the URL for the IMAP protocol documents.
  • bpo-42061: Document __format__ functionality for IP addresses.
  • bpo-42010: Clarify that subscription expressions are also valid for certain classes and types in the standard library, and for user-defined classes and types if the classmethod __class_getitem__() is provided.
  • bpo-41805: Documented generic alias type and types.GenericAlias. Also added an entry in glossary for generic types.
  • bpo-41774: In Programming FAQ “Sequences (Tuples/Lists)” section, add “How do you remove multiple items from a list”.
  • bpo-35293: Fix RemovedInSphinx40Warning when building the documentation. Patch by Dong-hee Na.
  • bpo-41726: Update the refcounts info of PyType_FromModuleAndSpec.
  • bpo-39693: Fix tarfile’s extractfile documentation
  • bpo-39416: Document some restrictions on the default string representations of numeric classes.
  • Tests:
  • bpo-40754: Include _testinternalcapi module in Windows installer for test suite
  • bpo-41739: Fix test_logging.test_race_between_set_target_and_flush(): the test now waits until all threads complete to avoid leaking running threads.
  • bpo-41970: Avoid a test failure in test_lib2to3 if the module has already imported at the time the test executes. Patch by Pablo Galindo.
  • bpo-41944: Tests for CJK codecs no longer call eval() on content received via HTTP.
  • bpo-41939: Fix test_site.test_license_exists_at_url(): call urllib.request.urlcleanup() to reset the global urllib.request._opener. Patch by Victor Stinner.
  • bpo-41561: test_ssl: skip test_min_max_version_mismatch when TLS 1.0 is not available
  • bpo-41602: Add tests for SIGINT handling in the runpy module.
  • bpo-41306: Fixed a failure in test_tk.test_widgets.ScaleTest happening when executing the test with Tk 8.6.10.
  • Build:
  • bpo-42398: Fix a race condition in “make regen-all” when make -jN option is used to run jobs in parallel. The clinic.py script now only use atomic write to write files. Moveover, generated files are now left unchanged if the content does not change, to not change the file modification time.
  • bpo-41617: Fix building pycore_bitutils.h internal header on old clang version without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7). Patch by Joshua Root and Victor Stinner.
  • bpo-38249: Update Py_UNREACHABLE to use __builtin_unreachable() if only the compiler is able to use it. Patch by Dong-hee Na.
  • bpo-40998: Addressed three compiler warnings found by undefined behavior sanitizer (ubsan).
  • Windows:
  • bpo-42120: Remove macro definition of copysign (to _copysign) in headers.
  • bpo-38439: Updates the icons for IDLE in the Windows Store package.
  • bpo-41744: Fixes automatic import of props file when using the Nuget package.
  • bpo-41557: Update Windows installer to use SQLite 3.33.0.
  • bpo-38324: Avoid Unicode errors when accessing certain locale data on Windows.
  • macOS:
  • bpo-41116: Ensure distutils.unixxcompiler.find_library_file can find system provided libraries on macOS 11.
  • bpo-41100: Add support for macOS 11 and Apple Silicon systems.
  • It is now possible to build “Universal 2” binaries using “–enable-universalsdk –with-universal-archs=universal2”.
  • Binaries build on later macOS versions can be deployed back to older versions (tested up to macOS 10.9), when using the correct deployment target. This is tested using Xcode 11 and later.
  • bpo-38443: The --enable-universalsdk and --with-universal-archs options for the configure script now check that the specified architectures can be used.
  • bpo-41471: Ignore invalid prefix lengths in system proxy excludes.
  • bpo-41557: Update macOS installer to use SQLite 3.33.0.
  • IDLE:
  • bpo-42426: Fix reporting offset of the RE error in searchengine.
  • bpo-42415: Get docstrings for IDLE calltips more often by using inspect.getdoc.
  • bpo-33987: Mostly finish using ttk widgets, mainly for editor, settings, and searches. Some patches by Mark Roseman.
  • bpo-41775: Use ‘IDLE Shell’ as shell title
  • bpo-35764: Rewrite the Calltips doc section.
  • bpo-40181: In calltips, stop reminding that ‘/’ marks the end of positional-only arguments.
  • bpo-40511: Typing opening and closing parentheses inside the parentheses of a function call will no longer cause unnecessary “flashing” off and on of an existing open call-tip, e.g. when typed in a string literal.
  • bpo-38439: Add a 256×256 pixel IDLE icon to the Windows .ico file. Created by Andrew Clover. Remove the low-color gif variations from the .ico file.
  • C API:
  • bpo-42015: Fix potential crash in deallocating method objects when dynamically allocated PyMethodDef’s lifetime is managed through the self argument of a PyCFunction.
  • bpo-41986: Py_FileSystemDefaultEncodeErrors and Py_UTF8Mode are available again in limited API.

New in Python 3.9.0 (Oct 6, 2020)

  • Library:
  • bpo-41815: Fix SQLite3 segfault when backing up closed database. Patch contributed by Peter David McCormick.
  • bpo-41662: No longer override exceptions raised in __len__() of a sequence of parameters in sqlite3 with ProgrammingError.
  • bpo-41662: Fixed crash when mutate list of parameters during iteration in sqlite3.
  • bpo-39728: fix default _missing_ so a duplicate ValueError is not set as the __context__ of the original ValueError
  • Tests:
  • bpo-41602: Add tests for SIGINT handling in the runpy module.
  • Build:
  • bpo-38249: Update Py_UNREACHABLE to use __builtin_unreachable() if only the compiler is able to use it. Patch by Dong-hee Na.

New in Python 3.9.0 RC 2 (Oct 6, 2020)

  • Core and Builtins:
  • bpo-41780: Fix __dir__() of types.GenericAlias. Patch by Batuhan Taskaya.
  • bpo-41690: Fix a possible stack overflow in the parser when parsing functions and classes with a huge ammount of arguments. Patch by Pablo Galindo.
  • bpo-41681: Fixes the wrong error description in the error raised by using 2 , in format string in f-string and str.format().
  • bpo-41654: Fix a crash that occurred when destroying subclasses of MemoryError. Patch by Pablo Galindo.
  • bpo-41631: The _ast module uses again a global state. Using a module state per module instance is causing subtle practical problems. For example, the Mercurial project replaces the __import__() function to implement lazy import, whereas Python expected that import _ast always return a fully initialized _ast module.
  • bpo-41533: Free the stack allocated in va_build_stack if do_mkstack fails and the stack is not a small_stack.
  • bpo-41531: Fix a bug that was dropping keys when compiling dict literals with more than 0xFFFF elements. Patch by Pablo Galindo.
  • bpo-41525: The output of python --help contains now only ASCII characters.
  • bpo-29590: Make the stack trace correct after calling generator.throw() on a generator that has yielded from a yield from.
  • Library:
  • bpo-41517: fix bug allowing Enums to be extended via multiple inheritance
  • bpo-39587: use the correct mix-in data type when constructing Enums
  • bpo-41789: Honor object overrides in Enum class creation (specifically, __str__, __repr__, __format__, and __reduce_ex__).
  • bpo-39651: Fix a race condition in the call_soon_threadsafe() method of asyncio.ProactorEventLoop: do nothing if the self-pipe socket has been closed.
  • bpo-41720: Fixed turtle.Vec2D.__rmul__() for arguments which are not int or float.
  • bpo-41696: Fix handling of debug mode in asyncio.run(). This allows setting PYTHONASYNCIODEBUG or -X dev to enable asyncio debug mode when using asyncio.run().
  • bpo-41687: Fix implementation of sendfile to be compatible with Solaris.
  • bpo-39010: Restarting a ProactorEventLoop on Windows no longer logs spurious ConnectionResetErrors.
  • bpo-41609: The pdb whatis command correctly reports instance methods as ‘Method’ rather than ‘Function’.
  • bpo-32751: When cancelling the task due to a timeout, asyncio.wait_for() will now wait until the cancellation is complete also in the case when timeout is

New in Python 3.8.6 (Oct 6, 2020)

  • Core and Builtins:
  • bpo-41525: The output of python --help contains now only ASCII characters.
  • Library:
  • bpo-41817: fix tkinter.EventType Enum so all members are strings, and none are tuples
  • bpo-41815: Fix SQLite3 segfault when backing up closed database. Patch contributed by Peter David McCormick.
  • bpo-41517: fix bug allowing Enums to be extended via multiple inheritance
  • bpo-39587: use the correct mix-in data type when constructing Enums
  • bpo-41789: Honor object overrides in Enum class creation (specifically, __str__, __repr__, __format__, and __reduce_ex__).
  • bpo-39651: Fix a race condition in the call_soon_threadsafe() method of asyncio.ProactorEventLoop: do nothing if the self-pipe socket has been closed.
  • bpo-41720: Fixed turtle.Vec2D.__rmul__() for arguments which are not int or float.
  • bpo-39728: fix default _missing_ so a duplicate ValueError is not set as the __context__ of the original ValueError
  • bpo-37479: When Enum.__str__ is overridden in a derived class, the override will be used by Enum.__format__ regardless of whether mixin classes are present.
  • Documentation:
  • bpo-35293: Fix RemovedInSphinx40Warning when building the documentation. Patch by Dong-hee Na.
  • bpo-37149: Change Shipman tkinter doc link from archive.org to TkDocs. (The doc has been removed from the NMT server.) The new link responds much faster and includes a short explanatory note.
  • Tests:
  • bpo-41731: Make test_cmd_line_script pass with option ‘-vv’.
  • Windows:
  • bpo-41744: Fixes automatic import of props file when using the Nuget package.
  • IDLE:
  • bpo-35764: Rewrite the Calltips doc section.
  • bpo-40181: In calltips, stop reminding that ‘/’ marks the end of positional-only arguments.

New in Python 3.8.6 RC 1 (Sep 9, 2020)

  • Core and Builtins:
  • bpo-41654: Fix a crash that occurred when destroying subclasses of MemoryError. Patch by Pablo Galindo.
  • bpo-41533: Free the stack allocated in va_build_stack if do_mkstack fails and the stack is not a small_stack.
  • bpo-38156: Handle interrupts that come after EOF correctly in PyOS_StdioReadline.
  • Library:
  • bpo-41696: Fix handling of debug mode in asyncio.run(). This allows setting PYTHONASYNCIODEBUG or -X dev to enable asyncio debug mode when using asyncio.run().
  • bpo-39010: Restarting a ProactorEventLoop on Windows no longer logs spurious ConnectionResetErrors.
  • bpo-41609: The pdb whatis command correctly reports instance methods as ‘Method’ rather than ‘Function’.
  • bpo-32751: When cancelling the task due to a timeout, asyncio.wait_for() will now wait until the cancellation is complete also in the case when timeout is

New in Python 3.8.5 (Jul 21, 2020)

  • Security:
  • bpo-41304: Fixes python3x._pth being ignored on Windows, caused by the fix for bpo-29778 (CVE-2020-15801).
  • bpo-39603: Prevent http header injection by rejecting control characters in http.client.putrequest(…).
  • Core and Builtins:
  • bpo-41295: Resolve a regression in CPython 3.8.4 where defining “__setattr__” in a multi-inheritance setup and calling up the hierarchy chain could fail if builtins/extension types were involved in the base types.
  • Library:
  • bpo-41288: Unpickling invalid NEWOBJ_EX opcode with the C implementation raises now UnpicklingError instead of crashing.
  • bpo-39017: Avoid infinite loop when reading specially crafted TAR files using the tarfile module (CVE-2019-20907).
  • Documentation:
  • bpo-37703: Updated Documentation to comprehensively elaborate on the behaviour of gather.cancel()
  • Build:
  • bpo-41302: Enable building Python 3.8 with libmpdec-2.5.0 to ease maintenance for Linux distributions. Patch by Felix Yan.
  • macOS:
  • bpo-40741: Update macOS installer to use SQLite 3.32.3.
  • IDLE:
  • bpo-41300: Save files with non-ascii chars. Fix regression released in 3.9.0b4 and 3.8.4.

New in Python 3.8.4 (Jul 20, 2020)

  • Security:
  • bpo-41162: Audit hooks are now cleared later during finalization to avoid missing events.
  • bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (CVE-2020-15523).
  • Core and Builtins:
  • bpo-41247: Always cache the running loop holder when running asyncio.set_running_loop.
  • bpo-41252: Fix incorrect refcounting in _ssl.c’s _servername_callback().
  • bpo-41218: Python 3.8.3 had a regression where compiling with ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension with CO_COROUTINE. Now only list comprehension making use of async/await will tagged as so.
  • bpo-41175: Guard against a NULL pointer dereference within bytearrayobject triggered by the bytearray() + bytearray() operation.
  • bpo-39960: The “hackcheck” that prevents sneaking around a type’s __setattr__() by calling the superclass method was rewritten to allow C implemented heap types.
  • Library:
  • bpo-41235: Fix the error handling in ssl.SSLContext.load_dh_params().
  • bpo-41193: The write_history() atexit function of the readline completer now ignores any OSError to ignore error if the filesystem is read-only, instead of only ignoring FileNotFoundError and PermissionError.
  • bpo-41043: Fixed the use of glob() in the stdlib: literal part of the path is now always correctly escaped.
  • bpo-39384: Fixed email.contentmanager to allow set_content() to set a null string.
  • IDLE:
  • bpo-37765: Add keywords to module name completion list. Rewrite Completions section of IDLE doc.
  • bpo-41152: The encoding of stdin, stdout and stderr in IDLE is now always UTF-8.

New in Python 3.8.4 RC 1 (Jul 20, 2020)

  • Security:
  • bpo-41004: The __hash__() methods of ipaddress.IPv4Interface and ipaddress.IPv6Interface incorrectly generated constant hash values of 32 and 128 respectively. This resulted in always causing hash collisions. The fix uses hash() to generate hash values for the tuple of (address, mask length, network address).
  • bpo-39073: Disallow CR or LF in email.headerregistry.Address arguments to guard against header injection attacks.
  • Core and Builtins:
  • bpo-41094: Fix decoding errors with audit when open files with non-ASCII names on non-UTF-8 locale.
  • bpo-41056: Fixes a reference to deallocated stack space during startup when constructing sys.path involving a relative symlink when code was supplied via -c. (discovered via Coverity)
  • bpo-35975: Stefan Behnel reported that cf_feature_version is used even when PyCF_ONLY_AST is not set. This is against the intention and against the documented behavior, so it’s been fixed.
  • bpo-40957: Fix refleak in _Py_fopen_obj() when PySys_Audit() fails
  • bpo-40870: Raise ValueError when validating custom AST’s where the constants True, False and None are used within a ast.Name node.
  • bpo-40826: Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception and pass the Python thread state when checking if there is a pending signal.
  • bpo-40824: Unexpected errors in calling the __iter__ method are no longer masked by TypeError in the in operator and functions contains(), indexOf() and countOf() of the operator module.
  • bpo-40663: Correctly generate annotations where parentheses are omitted but required (e.g: Type[(str, int, *other))].
  • Library:
  • bpo-41138: Fixed the trace module CLI for Python source files with non-UTF-8 encoding.
  • bpo-31938: Fix default-value signatures of several functions in the select module - by Anthony Sottile.
  • bpo-41068: Fixed reading files with non-ASCII names from ZIP archive directly after writing them.
  • bpo-41058: pdb.find_function() now correctly determines the source file encoding.
  • bpo-41056: Fix a NULL pointer dereference within the ssl module during a MemoryError in the keylog callback. (discovered by Coverity)
  • bpo-41048: mimetypes.read_mime_types() function reads the rule file using UTF-8 encoding, not the locale encoding. Patch by Srinivas Reddy Thatiparthy.
  • bpo-40448: ensurepip now disables the use of pip cache when installing the bundled versions of pip and setuptools. Patch by Krzysztof Konopko.
  • bpo-40855: The standard deviation and variance functions in the statistics module were ignoring their mu and xbar arguments.
  • bpo-40807: Stop codeop._maybe_compile, used by code.InteractiveInterpreter (and IDLE). from from emitting each warning three times.
  • bpo-40834: Fix truncate when sending str object with_xxsubinterpreters.channel_send.
  • bpo-38488: Update ensurepip to install pip 20.1.1 and setuptools 47.1.0.
  • bpo-40767: webbrowser now properly finds the default browser in pure Wayland systems by checking the WAYLAND_DISPLAY environment variable. Patch contributed by Jérémy Attali.
  • bpo-40795: ctypes module: If ctypes fails to convert the result of a callback or if a ctypes callback function raises an exception, sys.unraisablehook is now called with an exception set. Previously, the error was logged into stderr by PyErr_Print().
  • bpo-30008: Fix ssl code to be compatible with OpenSSL 1.1.x builds that use no-deprecated and --api=1.1.0.
  • bpo-40614: ast.parse() will not parse self documenting expressions in f-strings when passed feature_version is less than (3, 8).
  • bpo-40626: Add h5 file extension as MIME Type application/x-hdf5, as per HDF Group recommendation for HDF5 formatted data files. Patch contributed by Mark Schwab.
  • bpo-25872: linecache could crash with a KeyError when accessed from multiple threads. Fix by Michael Graczyk.
  • bpo-40597: If text content lines are longer than policy.max_line_length, always use a content-encoding to make sure they are wrapped.
  • bpo-40515: The ssl and hashlib modules now actively check that OpenSSL is build with thread support. Python 3.7.0 made thread support mandatory and no longer works safely with a no-thread builds.
  • bpo-13097: ctypes now raises an ArgumentError when a callback is invoked with more than 1024 arguments.
  • bpo-40457: The ssl module now support OpenSSL builds without TLS 1.0 and 1.1 methods.
  • bpo-39830: Add zipfile.Path to __all__ in the zipfile module.
  • bpo-40025: Raise TypeError when _generate_next_value_ is defined after members. Patch by Ethan Onstott.
  • bpo-39244: Fixed multiprocessing.context.get_all_start_methods to properly return the default method first on macOS.
  • bpo-39040: Fix parsing of invalid mime headers parameters by collapsing whitespace between encoded words in a bare-quote-string.
  • bpo-35714: struct.error is now raised if there is a null character in a struct format string.
  • bpo-36290: AST nodes are now raising TypeError on conflicting keyword arguments. Patch contributed by Rémi Lapeyre.
  • bpo-29620: assertWarns() no longer raises a RuntimeException when accessing a module’s __warningregistry__ causes importation of a new module, or when a new module is imported in another thread. Patch by Kernc.
  • bpo-34226: Fix cgi.parse_multipart without content_length. Patch by Roger Duran
  • Tests:
  • bpo-41085: Fix integer overflow in the array.array.index() method on 64-bit Windows for index larger than 2**31.
  • bpo-38377: On Linux, skip tests using multiprocessing if the current user cannot create a file in /dev/shm/ directory. Add the skip_if_broken_multiprocessing_synchronize() function to the test.support module.
  • bpo-41009: Fix use of support.require_{linux|mac|freebsd}_version() decorators as class decorator.
  • bpo-41003: Fix test_copyreg when numpy is installed: test.pickletester now saves/restores warnings filters when importing numpy, to ignore filters installed by numpy.
  • bpo-40964: Disable remote imaplib tests, host cyrus.andrew.cmu.edu is blocking incoming connections.
  • bpo-40055: distutils.tests now saves/restores warnings filters to leave them unchanged. Importing tests imports docutils which imports pkg_resources which adds a warnings filter.
  • bpo-34401: Make test_gdb properly run on HP-UX. Patch by Michael Osipov.
  • Build:
  • bpo-40204: Pin Sphinx version to 2.3.1 in Doc/Makefile.
  • bpo-40653: Move _dirnameW out of HAVE_SYMLINK to fix a potential compiling issue.
  • Windows:
  • bpo-41074: Fixed support of non-ASCII names in functions msilib.OpenDatabase() and msilib.init_database() and non-ASCII SQL in method msilib.Database.OpenView().
  • bpo-40164: Updates Windows OpenSSL to 1.1.1g
  • bpo-39631: Changes the registered MIME type for .py files on Windows to text/x-python instead of text/plain.
  • bpo-40677: Manually define IO_REPARSE_TAG_APPEXECLINK in case some old Windows SDK doesn’t have it.
  • bpo-40650: Include winsock2.h in pytime.c for timeval.
  • bpo-39148: Add IPv6 support to asyncio datagram endpoints in ProactorEventLoop. Change the raised exception for unknown address families to ValueError as it’s not coming from Windows API.
  • macOS:
  • bpo-39580: Avoid opening Finder window if running installer from the command line. Patch contributed by Rick Heil.
  • bpo-41100: Fix configure error when building on macOS 11. Note that the current Python release was released shortly after the first developer preview of macOS 11 (Big Sur); there are other known issues with building and running on the developer preview. Big Sur is expected to be fully supported in a future bugfix release of Python 3.8.x and with 3.9.0.
  • bpo-41005: fixed an XDG settings issue not allowing macos to open browser in webbrowser.py
  • bpo-40741: Update macOS installer to use SQLite 3.32.2.
  • IDLE:
  • bpo-41144: Make Open Module open a special module such as os.path.
  • bpo-39885: Make context menu Cut and Copy work again when right-clicking within a selection.
  • bpo-40723: Make test_idle pass when run after import.
  • Tools/Demos:
  • bpo-40479: Update multissltest helper to test with latest OpenSSL 1.0.2, 1.1.0, 1.1.1, and 3.0.0-alpha.
  • bpo-40163: Fix multissltest tool. OpenSSL has changed download URL for old releases. The multissltest tool now tries to download from current and old download URLs.

New in Python 3.8.3 (May 15, 2020)

  • Core and Builtins:
  • bpo-40527: Fix command line argument parsing: no longer write errors multiple times into stderr.
  • bpo-40417: Fix imp module deprecation warning when PyImport_ReloadModule is called. Patch by Robert Rouhani.
  • bpo-39562: The constant values of future flags in the __future__ module are updated in order to prevent collision with compiler flags. Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing with CO_FUTURE_DIVISION.
  • Library:
  • bpo-40559: Fix possible memory leak in the C implementation of asyncio.Task.
  • bpo-40355: Improve error reporting in ast.literal_eval() in the presence of malformed ast.Dict nodes instead of silently ignoring any non-conforming elements. Patch by Curtis Bucher.
  • bpo-40459: platform.win32_ver() now produces correct ptype strings instead of empty strings.
  • bpo-40398: typing.get_args() now always returns an empty tuple for special generic aliases.
  • Documentation:
  • bpo-40561: Provide docstrings for webbrowser open functions.
  • bpo-39435: Fix an incorrect signature for pickle.loads() in the docs
  • C API:
  • bpo-40412: Nullify inittab_copy during finalization, preventing future interpreter initializations in an embedded situation from crashing. Patch by Gregory Szorc.

New in Python 3.8.2 (Apr 7, 2020)

  • Core and Builtins:
  • bpo-39382: Fix a use-after-free in the single inheritance path of issubclass(), when the __bases__ of an object has a single reference, and so does its first item. Patch by Yonatan Goldschmidt.
  • bpo-39427: Document all possibilities for the -X options in the command line help section. Patch by Pablo Galindo.
  • Library:
  • bpo-39649: Remove obsolete check for __args__ in bdb.Bdb.format_stack_entry.
  • bpo-39681: Fix a regression where the C pickle module wouldn’t allow unpickling from a file-like object that doesn’t expose a readinto() method.
  • bpo-39546: Fix a regression in ArgumentParser where allow_abbrev=False was ignored for long options that used a prefix character other than “-“.
  • bpo-39432: Implement PEP-489 algorithm for non-ascii “PyInit_…” symbol names in distutils to make it export the correct init symbol also on Windows.
  • Documentation:
  • bpo-17422: The language reference now specifies restrictions on class namespaces. Adapted from a patch by Ethan Furman.
  • bpo-39572: Updated documentation of total flag of TypeDict.
  • bpo-39654: In pyclbr doc, update ‘class’ to ‘module’ where appropriate and add readmodule comment. Patch by Hakan Çelik.
  • IDLE:
  • bpo-39663: Add tests for pyparse find_good_parse_start().

New in Python 3.8.1 (Dec 20, 2019)

  • Core and Builtins:
  • bpo-39080: Fix the value of end_col_offset for Starred Expression AST nodes when they are among the elements in the args attribute of Call AST nodes.
  • bpo-39031: When parsing an “elif” node, lineno and col_offset of the node now point to the “elif” keyword and not to its condition, making it consistent with the “if” node. Patch by Lysandros Nikolaou.
  • bpo-39008: PySys_Audit() now requires Py_ssize_t to be used for size arguments in the format string, regardless of whethen PY_SSIZE_T_CLEAN was defined at include time.
  • Library:
  • bpo-39022: Update importliib.metadata to include improvements from importlib_metadata 1.3 including better serialization of EntryPoints and improved documentation for custom finders.
  • bpo-38811: Fix an unhandled exception in pathlib when os.link() is missing. Patch by Toke Høiland-Jørgensen.
  • bpo-36406: Handle namespace packages in doctest. Patch by Karthikeyan Singaravelan.
  • Tests:
  • bpo-38546: Multiprocessing and concurrent.futures tests now stop the resource tracker process when tests complete.
  • macOS:
  • bpo-38295: Prevent failure of test_relative_path in test_py_compile on macOS Catalina.
  • IDLE:
  • bpo-38944: Excape key now closes IDLE completion windows. Patch by Johnny Najera.
  • bpo-38943: Fix IDLE autocomplete windows not always appearing on some systems. Patch by Johnny Najera.

New in Python 3.8.1 RC 1 (Dec 20, 2019)

  • Security:
  • bpo-38945: Newline characters have been escaped when performing uu encoding to prevent them from overflowing into to content section of the encoded file. This prevents malicious or accidental modification of data during the decoding process.
  • bpo-37228: Due to significant security concerns, the reuse_address parameter of asyncio.loop.create_datagram_endpoint() is no longer supported. This is because of the behavior of SO_REUSEADDR in UDP. For more details, see the documentation for loop.create_datagram_endpoint(). (Contributed by Kyle Stanley, Antoine Pitrou, and Yury Selivanov in bpo-37228.)
  • bpo-38722: runpy now uses io.open_code() to open code files. Patch by Jason Killen.
  • bpo-38804: Fixes a ReDoS vulnerability in http.cookiejar. Patch by Ben Caller.
  • bpo-38622: Add additional audit events for the ctypes module.
  • bpo-38418: Fixes audit event for os.system() to be named os.system.
  • Core and Builtins:
  • bpo-38673: In REPL mode, don’t switch to PS2 if the line starts with comment or whitespace. Based on work by Batuhan Taşkaya.
  • bpo-38922: Calling replace on a code object now raises the code.__new__ audit event.
  • bpo-38920: Add audit hooks for when sys.excepthook() and sys.unraisablehook() are invoked
  • bpo-38892: Improve documentation for audit events table and functions.
  • bpo-38707: MainThread.native_id is now correctly reset in child processes spawned using multiprocessing.Process, instead of retaining the parent’s value.
  • bpo-38640: Fixed a bug in the compiler that was causing to raise in the presence of break statements and continue statements inside always false while loops. Patch by Pablo Galindo.
  • bpo-38535: Fixed line numbers and column offsets for AST nodes for calls without arguments in decorators.
  • bpo-38525: Fix a segmentation fault when using reverse iterators of empty dict objects. Patch by Dong-hee Na and Inada Naoki.
  • bpo-35409: Ignore GeneratorExit exceptions when throwing an exception into the aclose coroutine of an asynchronous generator.
  • Library:
  • bpo-39006: Fix asyncio when the ssl module is missing: only check for ssl.SSLSocket instance if the ssl module is available.
  • bpo-38708: Fix a potential IndexError in email parser when parsing an empty msg-id.
  • bpo-38698: Add a new InvalidMessageID token to email parser to represent invalid Message-ID headers. Also, add defects when there is remaining value after parsing the header.
  • bpo-38979: Return class from ContextVar.__class_getitem__ to simplify subclassing.
  • bpo-38986: Make repr of C accelerated TaskWakeupMethWrapper the same as of pure Python version.
  • bpo-38529: Drop too noisy asyncio warning about deletion of a stream without explicit .close() call.
  • bpo-38634: The readline module now detects if Python is linked to libedit at runtime on all platforms. Previously, the check was only done on macOS.
  • bpo-33684: Fix json.tool failed to read a JSON file with non-ASCII characters when locale encoding is not UTF-8.
  • bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id
  • parse_message_id() was improperly using a token defined inside an exception handler, which was raising UnboundLocalError on parsing an invalid value. Patch by Claudiu Popa.
  • bpo-26730: Fix SpooledTemporaryFile.rollover() might corrupt the file when it is in text mode. Patch by Serhiy Storchaka.
  • bpo-38668: Calling func:shutil.copytree to copy a directory tree from one directory to another subdirectory resulted in an endless loop and a RecursionError. A fix was added to consume an iterator and create the list of the entries to be copied, avoiding the recursion for newly created directories. Patch by Bruno P. Kinoshita.
  • bpo-37838: typing.get_type_hints() properly handles functions decorated with functools.wraps().
  • bpo-38859: AsyncMock now returns StopAsyncIteration on the exaustion of a side_effects iterable. Since PEP-479 its Impossible to raise a StopIteration exception from a coroutine.
  • bpo-38857: AsyncMock fix for return values that are awaitable types. This also covers side_effect iterable values that happend to be awaitable, and wraps callables that return an awaitable type. Before these awaitables were being awaited instead of being returned as is.
  • bpo-38821: Fix unhandled exceptions in argparse when internationalizing error messages for arguments with nargs set to special (non-integer) values. Patch by Federico Bond.
  • bpo-38820: Make Python compatible with OpenSSL 3.0.0. ssl.SSLSocket.getpeercert() no longer returns IPv6 addresses with a trailing new line.
  • bpo-38807: Update TypeError messages for os.path.join() to include os.PathLike objects as acceptable input types.
  • bpo-38785: Prevent asyncio from crashing if parent __init__ is not called from a constructor of object derived from asyncio.Future.
  • bpo-38723: pdb now uses io.open_code() to trigger auditing events.
  • bpo-27805: Allow opening pipes and other non-seekable files in append mode with open().
  • bpo-38686: Added support for multiple qop values in urllib.request.AbstractDigestAuthHandler.
  • bpo-38334: Fixed seeking backward on an encrypted zipfile.ZipExtFile.
  • bpo-34679: asynci.ProactorEventLoop.close() now only calls signal.set_wakeup_fd() in the main thread.
  • bpo-31202: The case the result of pathlib.WindowsPath.glob() matches now the case of the pattern for literal parts.
  • bpo-38521: Fixed erroneous equality comparison in statistics.NormalDist().
  • bpo-38478: Fixed a bug in inspect.signature.bind() that was causing it to fail when handling a keyword argument with same name as positional-only parameter. Patch by Pablo Galindo.
  • bpo-33604: Fixed hmac.new and hmac.HMAC to raise TypeError instead of ValueError when the digestmod parameter, now required in 3.8, is omitted. Also clarified the hmac module documentation and docstrings.
  • bpo-38422: Clarify docstrings of pathlib suffix(es)
  • bpo-36993: Improve error reporting for corrupt zip files with bad zip64 extra data. Patch by Daniel Hillier.
  • bpo-36820: Break cycle generated when saving an exception in socket.py, codeop.py and dyld.py as they keep alive not only the exception but user objects through the __traceback__ attribute. Patch by Mario Corchero.
  • bpo-34776: Fix dataclasses to support forward references in type annotations
  • bpo-33348: lib2to3 now recognizes expressions after * and ** like in f(*[] or []).
  • bpo-27657: Fix urllib.parse.urlparse() with numeric paths. A string like “path:80” is no longer parsed as a path but as a scheme (“path”) and a path (“80”).
  • Documentation:
  • bpo-38816: Provides more details about the interaction between fork() and CPython’s runtime, focusing just on the C-API. This includes cautions about where fork() should and shouldn’t be called.
  • bpo-38351: Modernize email examples from %-formatting to f-strings.
  • bpo-38778: Document the fact that RuntimeError is raised if os.fork() is called in a subinterpreter.
  • bpo-38592: Add Brazilian Portuguese to the language switcher at Python Documentation website.
  • Tests:
  • bpo-38547: Fix test_pty: if the process is the session leader, closing the master file descriptor raises a SIGHUP signal: simply ignore SIGHUP when running the tests.
  • bpo-38992: Fix a test for math.fsum() that was failing due to constant folding.
  • bpo-38965: Fix test_faulthandler on GCC 10. Use the “volatile” keyword in faulthandler._stack_overflow() to prevent tail call optimization on any compiler, rather than relying on compiler specific pragma.
  • bpo-38875: test_capi: trashcan tests now require the test “cpu” resource.
  • bpo-38841: Skip asyncio test_create_datagram_endpoint_existing_sock_unix on platforms lacking a functional bind() for named unix domain sockets.
  • bpo-38669: Raise TypeError when passing target as a string with unittest.mock.patch.object().
  • bpo-35998: Fix a race condition in test_asyncio.test_start_tls_server_1(). Previously, there was a race condition between the test main() function which replaces the protocol and the test ServerProto protocol which sends ANSWER once it gets HELLO. Now, only the test main() function is responsible to send data, ServerProto no longer sends data.
  • Build:
  • bpo-37404: asyncio now raises TyperError when calling incompatible methods with an ssl.SSLSocket socket. Patch by Ido Michael.
  • bpo-38809: On Windows, build scripts will now recognize and use python.exe from an active virtual env.
  • bpo-38684: Fix _hashlib build when Blake2 is disabled, but OpenSSL supports it.
  • bpo-37415: Fix stdatomic.h header check for ICC compiler: the ICC implementation lacks atomic_uintptr_t type which is needed by Python.
  • macOS:
  • bpo-37931: Fixed a crash on OSX dynamic builds that occurred when re-initializing the posix module after a Py_Finalize if the environment had changed since the previous import posix. Patch by Benoît Hudson.
  • IDLE:
  • bpo-38862: ‘Strip Trailing Whitespace’ on the Format menu removes extra newlines at the end of non-shell files.
  • bpo-26353: Stop adding newline when saving an IDLE shell window.
  • bpo-38636: Fix IDLE Format menu tab toggle and file indent width. These functions (default shortcuts Alt-T and Alt-U) were mistakenly disabled in 3.7.5 and 3.8.0.
  • bpo-4630: Add an option to toggle IDLE’s cursor blink for shell, editor, and output windows. See Settings, General, Window Preferences, Cursor Blink. Patch by Zachary Spytz.
  • bpo-38598: Do not try to compile IDLE shell or output windows
  • C API:
  • bpo-37633: Re-export some function compatibility wrappers for macros in pythonrun.h.
  • bpo-38540: Fixed possible leak in PyArg_Parse() and similar functions for format units "es#" and "et#" when the macro PY_SSIZE_T_CLEAN is not defined.
  • bpo-36389: The _PyObject_CheckConsistency() function is now also available in release mode. For example, it can be used to debug a crash in the visit_decref() function of the GC.

New in Python 3.8.0 (Oct 15, 2019)

  • Core and Builtins:
  • bpo-38469: Fixed a bug where the scope of named expressions was not being resolved correctly in the presence of the global keyword. Patch by Pablo Galindo.
  • bpo-38379: When cyclic garbage collection (gc) runs finalizers that resurrect unreachable objects, the current gc run ends, without collecting any cyclic trash. However, the statistics reported by collect() and get_stats() claimed that all cyclic trash found was collected, and that the resurrected objects were collected. Changed the stats to report that none were collected.
  • Library:
  • bpo-38449: Revert GH-15522, which introduces a regression in mimetypes.guess_type() due to improper handling of filenames as urls.
  • bpo-38431: Fix __repr__ method for dataclasses.InitVar to support typing objects, patch by Samuel Colvin.
  • bpo-38109: Add missing stat.S_IFDOOR, stat.S_IFPORT, stat.S_IFWHT, stat.S_ISDOOR(), stat.S_ISPORT(), and stat.S_ISWHT() values to the Python implementation of stat.
  • bpo-38405: Nested subclasses of typing.NamedTuple are now pickleable.
  • bpo-38332: Prevent KeyError thrown by _encoded_words.decode() when given an encoded-word with invalid content-type encoding from propagating all the way to email.message.get().
  • bpo-38341: Add smtplib.SMTPNotSupportedError to the smtplib exported names.
  • bpo-13153: OS native encoding is now used for converting between Python strings and Tcl objects. This allows to display, copy and paste to clipboard emoji and other non-BMP characters. Converting strings from Tcl to Python and back now never fails (except MemoryError).
  • Documentation:
  • bpo-38294: Add list of no-longer-escaped chars to re.escape documentation
  • Tests:
  • bpo-37531: On timeout, regrtest no longer attempts to call popen.communicate() again: it can hang until all child processes using stdout and stderr pipes completes. Kill the worker process and ignores its output. Change also the faulthandler timeout of the main process from 1 minute to 5 minutes, for Python slowest buildbots.
  • IDLE:
  • bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. It now escapes them with a backslash, as the regular Python interpreter. Added the errors field to the standard streams.
  • Tools/Demos:
  • bpo-38118: Update Valgrind suppression file to ignore a false alarm in PyUnicode_Decode() when using GCC builtin strcmp().
  • bpo-38347: pathfix.py: Assume all files that end on ‘.py’ are Python scripts when working recursively.
  • C API:
  • bpo-38395: Fix a crash in weakref.proxy objects due to incorrect lifetime management when calling some associated methods that may delete the last reference to object being referenced by the proxy. Patch by Pablo Galindo.

New in Python 3.7.4 (Jul 9, 2019)

  • Core and Builtins:
  • bpo-37500: Due to unintended side effects, revert the change introduced by bpo-1875 in 3.7.4rc1 to check for syntax errors in dead conditional code blocks.
  • Documentation:
  • bpo-37149: Replace the dead link to the Tkinter 8.5 reference by John Shipman, New Mexico Tech, with a link to the archive.org copy.

New in Python 3.7.4 RC 2 (Jul 9, 2019)

  • Security:
  • bpo-37463: ssl.match_hostname() no longer accepts IPv4 addresses with additional text after the address and only quad-dotted notation without trailing whitespaces. Some inet_aton() implementations ignore whitespace and all data after whitespace, e.g. ‘127.0.0.1 whatever’.
  • Core and Builtins:
  • bpo-24214: Improved support of the surrogatepass error handler in the UTF-8 and UTF-16 incremental decoders.
  • Library:
  • bpo-37440: http.client now enables TLS 1.3 post-handshake authentication for default context or if a cert_file is passed to HTTPSConnection.
  • bpo-37437: Update vendorized expat version to 2.2.7.
  • bpo-37428: SSLContext.post_handshake_auth = True no longer sets SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the option is documented as ignored for clients, OpenSSL implicitly enables cert chain validation when the flag is set.
  • bpo-32627: Fix compile error when _uuid headers conflicting included.
  • macOS:
  • bpo-34602: Avoid test suite failures on macOS by no longer calling resource.setrlimit to increase the process stack size limit at runtime. The runtime change is no longer needed since the interpreter is being built with a larger default stack size.

New in Python 3.7.4 RC 1 (Jul 9, 2019)

  • Security:
  • bpo-35907: CVE-2019-9948: Avoid file reading by disallowing local-file:// and local_file:// URL schemes in URLopener().open() and URLopener().retrieve() of urllib.request.
  • bpo-36742: Fixes mishandling of pre-normalization characters in urlsplit().
  • bpo-30458: Address CVE-2019-9740 by disallowing URL paths with embedded whitespace or control characters through into the underlying http client request. Such potentially malicious header injection URLs now cause an http.client.InvalidURL exception to be raised.
  • bpo-33529: Prevent fold function used in email header encoding from entering infinite loop when there are too many non-ASCII characters in a header.
  • bpo-35755: shutil.which() now uses os.confstr("CS_PATH") if available and if the PATH environment variable is not set. Remove also the current directory from posixpath.defpath. On Unix, shutil.which() and the subprocess module no longer search the executable in the current directory if the PATH environment variable is not set.
  • Core and Builtins:
  • bpo-37269: Fix a bug in the peephole optimizer that was not treating correctly constant conditions with binary operators. Patch by Pablo Galindo.
  • bpo-37219: Remove errorneous optimization for empty set differences.
  • bpo-26423: Fix possible overflow in wrap_lenfunc() when sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows).
  • bpo-36829: PyErr_WriteUnraisable() now displays the exception even if displaying the traceback failed. Moreover, hold a strong reference to sys.stderr while using it. Document that an exception must be set when calling PyErr_WriteUnraisable().
  • bpo-36907: Fix a crash when calling a C function with a keyword dict (f(**kwargs)) and changing the dict kwargs while that function is running.
  • bpo-36946: Fix possible signed integer overflow when handling slices.
  • bpo-27987: PyGC_Head structure is aligned to long double. This is needed to ensure GC-ed objects are aligned properly. Patch by Inada Naoki.
  • bpo-1875: A SyntaxError is now raised if a code blocks that will be optimized away (e.g. if conditions that are always false) contains syntax errors. Patch by Pablo Galindo. (Reverted in 3.7.4 final by bpo-37500.)
  • bpo-28866: Avoid caching attributes of classes which type defines mro() to avoid a hard cache invalidation problem.
  • bpo-27639: Correct return type for UserList slicing operations. Patch by Michael Blahay, Erick Cervantes, and vaultah
  • bpo-32849: Fix Python Initialization code on FreeBSD to detect properly when stdin file descriptor (fd 0) is invalid.
  • bpo-27987: pymalloc returns memory blocks aligned by 16 bytes, instead of 8 bytes, on 64-bit platforms to conform x86-64 ABI. Recent compilers assume this alignment more often. Patch by Inada Naoki.
  • bpo-36504: Fix signed integer overflow in _ctypes.c’s PyCArrayType_new().
  • bpo-20844: Fix running script with encoding cookie and LF line ending may fail on Windows.
  • bpo-24214: Fixed support of the surrogatepass error handler in the UTF-8 incremental decoder.
  • bpo-36459: Fix a possible double PyMem_FREE() due to tokenizer.c’s tok_nextc().
  • bpo-36433: Fixed TypeError message in classmethoddescr_call.
  • bpo-36430: Fix a possible reference leak in itertools.count().
  • bpo-36440: Include node names in ParserError messages, instead of numeric IDs. Patch by A. Skrobov.
  • bpo-36421: Fix a possible double decref in _ctypes.c’s PyCArrayType_new().
  • bpo-36256: Fix bug in parsermodule when parsing a state in a DFA that has two or more arcs with labels of the same type. Patch by Pablo Galindo.
  • bpo-36236: At Python initialization, the current directory is no longer prepended to sys.path if it has been removed.
  • bpo-36262: Fix an unlikely memory leak on conversion from string to float in the function _Py_dg_strtod() used by float(str), complex(str), pickle.load(), marshal.load(), etc.
  • bpo-36218: Fix a segfault occuring when sorting a list of heterogeneous values. Patch contributed by Rémi Lapeyre and Elliot Gorokhovsky.
  • bpo-36035: Added fix for broken symlinks in combination with pathlib
  • bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module. Patch by Zackery Spytz.
  • bpo-34408: Prevent a null pointer dereference and resource leakage in PyInterpreterState_New().
  • Library:
  • bpo-37280: Use threadpool for reading from file for sendfile fallback mode.
  • bpo-37279: Fix asyncio sendfile support when sendfile sends extra data in fallback mode.
  • bpo-19865: ctypes.create_unicode_buffer() now also supports non-BMP characters on platforms with 16-bit wchar_t (for example, Windows and AIX).
  • bpo-35922: Fix RobotFileParser.crawl_delay() and RobotFileParser.request_rate() to return None rather than raise AttributeError when no relevant rule is defined in the robots.txt file. Patch by Rémi Lapeyre.
  • bpo-36607: Eliminate RuntimeError raised by asyncio.all_tasks() if internal tasks weak set is changed by another thread during iteration.
  • bpo-36402: Fix a race condition at Python shutdown when waiting for threads. Wait until the Python thread state of all non-daemon threads get deleted (join all non-daemon threads), rather than just wait until non-daemon Python threads complete.
  • bpo-34886: Fix an unintended ValueError from subprocess.run() when checking for conflicting input and stdin or capture_output and stdout or stderr args when they were explicitly provided but with None values within a passed in **kwargs dict rather than as passed directly by name. Patch contributed by Rémi Lapeyre.
  • bpo-37173: The exception message for inspect.getfile() now correctly reports the passed class rather than the builtins module.
  • bpo-12639: msilib.Directory.start_component() no longer fails if keyfile is not None.
  • bpo-36520: Lengthy email headers with UTF-8 characters are now properly encoded when they are folded. Patch by Jeffrey Kintscher.
  • bpo-37054: Fix destructor _pyio.BytesIO and _pyio.TextIOWrapper: initialize their _buffer attribute as soon as possible (in the class body), because it’s used by __del__() which calls close().
  • bpo-30835: Fixed a bug in email parsing where a message with invalid bytes in content-transfer-encoding of a multipart message can cause an AttributeError. Patch by Andrew Donnellan.
  • bpo-37035: Don’t log OSError based exceptions if a fatal error has occurred in asyncio transport. Peer can generate almost any OSError, user cannot avoid these exceptions by fixing own code. Errors are still propagated to user code, it’s just logging them is pointless and pollute asyncio logs.
  • bpo-37008: Add support for calling next() with the mock resulting from unittest.mock.mock_open()
  • bpo-27737: Allow whitespace only header encoding in email.header - by Batuhan Taskaya
  • bpo-36969: PDB command args now display keyword only arguments. Patch contributed by Rémi Lapeyre.
  • bpo-36983: Add missing names to typing.__all__: ChainMap, ForwardRef, OrderedDict - by Anthony Sottile.
  • bpo-21315: Email headers containing RFC2047 encoded words are parsed despite the missing whitespace, and a defect registered. Also missing trailing whitespace after encoded words is now registered as a defect.
  • bpo-33524: Fix the folding of email header when the max_line_length is 0 or None and the header contains non-ascii characters. Contributed by Licht Takeuchi (@Licht-T).
  • bpo-24564: shutil.copystat() now ignores errno.EINVAL on os.setxattr() which may occur when copying files on filesystems without extended attributes support.
  • Original patch by Giampaolo Rodola, updated by Ying Wang.
  • bpo-36845: Added validation of integer prefixes to the construction of IP networks and interfaces in the ipaddress module.
  • bpo-35545: Fix asyncio discarding IPv6 scopes when ensuring hostname resolutions internally
  • bpo-35070: posix.getgrouplist() now works correctly when the user belongs to NGROUPS_MAX supplemental groups. Patch by Jeffrey Kintscher.
  • bpo-24538: In shutil.copystat(), first copy extended file attributes and then file permissions, since extended attributes can only be set on the destination while it is still writeable.
  • bpo-33110: Handle exceptions raised by functions added by concurrent.futures add_done_callback correctly when the Future has already completed.
  • bpo-26903: Limit max_workers in ProcessPoolExecutor to 61 to work around a WaitForMultipleObjects limitation.
  • bpo-36813: Fix QueueListener to call queue.task_done() upon stopping. Patch by Bar Harel.
  • bpo-36734: Fix compilation of faulthandler.c on HP-UX. Initialize stack_t current_stack to zero using memset().
  • bpo-29183: Fix double exceptions in wsgiref.handlers.BaseHandler by calling its close() method only when no exception is raised.
  • bpo-36650: The C version of functools.lru_cache() was treating calls with an empty **kwargs dictionary as being distinct from calls with no keywords at all. This did not result in an incorrect answer, but it did trigger an unexpected cache miss.
  • bpo-28552: Fix distutils.sysconfig if sys.executable is None or an empty string: use os.getcwd() to initialize project_base. Fix also the distutils build command: don’t use sys.executable if it is None or an empty string.
  • bpo-35755: shutil.which() and distutils.spawn.find_executable() now use os.confstr("CS_PATH") if available instead of os.defpath, if the PATH environment variable is not set. Moreover, don’t use os.confstr("CS_PATH") nor os.defpath if the PATH environment variable is set to an empty string.
  • bpo-36613: Fix asyncio wait() not removing callback if exception
  • bpo-36598: Fix isinstance check for Mock objects with spec when the code is executed under tracing. Patch by Karthikeyan Singaravelan.
  • bpo-36533: Reinitialize logging.Handler locks in forked child processes instead of attempting to acquire them all in the parent before forking only to be released in the child process. The acquire/release pattern was leading to deadlocks in code that has implemented any form of chained logging handlers that depend upon one another as the lock acquision order cannot be guaranteed.
  • bpo-36522: If debuglevel is set to >0 in http.client, print all values for headers with multiple values for the same header name. Patch by Matt Houglum.
  • bpo-36492: Arbitrary keyword arguments (even with names “self” and “func”) can now be passed to some functions which should accept arbitrary keyword arguments and pass them to other function (for example partialmethod(), TestCase.addCleanup() and Profile.runcall()) if the required arguments are passed as positional arguments.
  • bpo-36434: Errors during writing to a ZIP file no longer prevent to properly close it.
  • bpo-34745: Fix asyncio ssl memory issues caused by circular references
  • bpo-36321: collections.namedtuple() misspelled the name of an attribute. To be consistent with typing.NamedTuple, the attribute name should have been “_field_defaults” instead of “_fields_defaults”. For backwards compatibility, both spellings are now created. The misspelled version may be removed in the future.
  • bpo-36272: logging does not silently ignore RecursionError anymore. Patch contributed by Rémi Lapeyre.
  • bpo-36235: Fix CFLAGS in customize_compiler() of distutils.sysconfig: when the CFLAGS environment variable is defined, don’t override CFLAGS variable with the OPT variable anymore. Initial patch written by David Malcolm.
  • bpo-35125: Asyncio: Remove inner callback on outer cancellation in shield
  • bpo-35802: Clean up code which checked presence of os.stat / os.lstat / os.chmod which are always present. Patch by Anthony Sottile.
  • bpo-23078: Add support for classmethod() and staticmethod() to unittest.mock.create_autospec(). Initial patch by Felipe Ochoa.
  • bpo-35721: Fix asyncio.SelectorEventLoop.subprocess_exec() leaks file descriptors if Popen fails and called with stdin=subprocess.PIPE. Patch by Niklas Fiekas.
  • bpo-35726: QueueHandler.prepare() now makes a copy of the record before modifying and enqueueing it, to avoid affecting other handlers in the chain.
  • bpo-31855: unittest.mock.mock_open() results now respects the argument of read([size]). Patch contributed by Rémi Lapeyre.
  • bpo-35082: Don’t return deleted attributes when calling dir on a unittest.mock.Mock.
  • bpo-34547: wsgiref.handlers.BaseHandler now handles abrupt client connection terminations gracefully. Patch by Petter Strandmark.
  • bpo-34424: Fix serialization of messages containing encoded strings when the policy.linesep is set to a multi-character string. Patch by Jens Troeger.
  • bpo-33361: Fix a bug in codecs.StreamRecoder where seeking might leave old data in a buffer and break subsequent read calls. Patch by Ammar Askar.
  • bpo-31922: asyncio.AbstractEventLoop.create_datagram_endpoint(): Do not connect UDP socket when broadcast is allowed. This allows to receive replies after a UDP broadcast.
  • bpo-22102: Added support for ZIP files with disks set to 0. Such files are commonly created by builtin tools on Windows when use ZIP64 extension. Patch by Francisco Facioni.
  • bpo-27141: Added a __copy__() to collections.UserList and collections.UserDict in order to correctly implement shallow copying of the objects. Patch by Bar Harel.
  • bpo-31829: r, and x1a (end-of-file on Windows) are now escaped in protocol 0 pickles of Unicode strings. This allows to load them without loss from files open in text mode in Python 2.
  • bpo-31292: Fix setup.py check --restructuredtext for files containing include directives.
  • bpo-23395: _thread.interrupt_main() now avoids setting the Python error status if the SIGINT signal is ignored or not handled by Python.
  • Documentation:
  • bpo-34903: Documented that in datetime.datetime.strptime(), the leading zero in some two-digit formats is optional. Patch by Mike Gleen.
  • bpo-36984: Improve version added references in typing module - by Anthony Sottile.
  • bpo-36868: What’s new now mentions SSLContext.hostname_checks_common_name instead of SSLContext.host_flags.
  • bpo-36783: Added C API Documentation for Time_FromTimeAndFold and PyDateTime_FromDateAndTimeAndFold as per PEP 495. Patch by Edison Abahurire.
  • bpo-30840: Document relative imports
  • bpo-36523: Add docstring for io.IOBase.writelines().
  • bpo-36425: New documentation translation: Simplified Chinese.
  • bpo-36157: Added Documention for PyInterpreterState_Main().
  • bpo-36138: Improve documentation about converting datetime.timedelta to scalars.
  • bpo-22865: Add detail to the documentation on the pty.spawn function.
  • bpo-35581: @typing.type_check_only now allows type stubs to mark functions and classes not available during runtime.
  • bpo-35564: Explicitly set master_doc variable in conf.py for compliance with Sphinx 2.0
  • bpo-10536: Enhance the gettext docs. Patch by Éric Araujo
  • bpo-32995: Added the context variable in glossary.
  • bpo-33832: Add glossary entry for ‘magic method’.
  • bpo-33482: Make codecs.StreamRecoder.writelines take a list of bytes.
  • bpo-25735: Added documentation for func factorial to indicate that returns integer values
  • Tests:
  • bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1()
  • bpo-37153: test_venv.test_mutiprocessing() now explicitly calls pool.terminate() to wait until the pool completes.
  • bpo-37081: Test with OpenSSL 1.1.1c
  • bpo-36915: The main regrtest process now always removes all temporary directories of worker processes even if they crash or if they are killed on KeyboardInterrupt (CTRL+c).
  • bpo-36719: “python3 -m test -jN …” now continues the execution of next tests when a worker process crash (CHILD_ERROR state). Previously, the test suite stopped immediately. Use –failfast to stop at the first error.
  • bpo-36816: Update Lib/test/selfsigned_pythontestdotnet.pem to match self-signed.pythontest.net’s new TLS certificate.
  • bpo-35925: Skip httplib and nntplib networking tests when they would otherwise fail due to a modern OS or distro with a default OpenSSL policy of rejecting connections to servers with weak certificates.
  • bpo-36719: regrtest now always detects uncollectable objects. Previously, the check was only enabled by --findleaks. The check now also works with -jN/--multiprocess N. --findleaks becomes a deprecated alias to --fail-env-changed.
  • bpo-36725: When using mulitprocessing mode (-jN), regrtest now better reports errors if a worker process fails, and it exits immediately on a worker thread failure or when interrupted.
  • bpo-36454: Change test_time.test_monotonic() to test only the lower bound of elapsed time after a sleep command rather than the upper bound. This prevents unnecessary test failures on slow buildbots. Patch by Victor Stinner.
  • bpo-36629: Fix test_imap4_host_default_value() of test_imaplib: catch also errno.ENETUNREACH error.
  • bpo-36611: Fix test_sys.test_getallocatedblocks() when tracemalloc is enabled.
  • bpo-36560: Fix reference leak hunting in regrtest: compute also deltas (of reference count, allocated memory blocks, file descriptor count) during warmup, to ensure that everything is initialized before starting to hunt reference leaks.
  • bpo-36565: Fix reference hunting (python3 -m test -R 3:3) when Python has no built-in abc module.
  • bpo-36436: Fix _testcapi.pymem_buffer_overflow(): handle memory allocation failure.
  • Build:
  • bpo-36605: make tags and make TAGS now also parse Modules/_io/*.c and Modules/_io/*.h.
  • bpo-36508: python-config --ldflags no longer includes flags of the LINKFORSHARED variable. The LINKFORSHARED variable must only be used to build executables.
  • macOS:
  • bpo-35360: Update macOS installer to use SQLite 3.28.0.
  • bpo-34631: Updated OpenSSL to 1.1.1c in macOS installer.
  • bpo-36231: Support building Python on macOS without /usr/include installed. As of macOS 10.14, system header files are only available within an SDK provided by either the Command Line Tools or the Xcode app.
  • bpo-34602: Avoid failures setting macOS stack resource limit with resource.setrlimit. This reverts an earlier fix for bpo-18075 which forced a non-default stack size when building the interpreter executable on macOS.
  • IDLE:
  • bpo-37321: Both subprocess connection error messages now refer to the ‘Startup failure’ section of the IDLE doc.
  • bpo-37177: Properly ‘attach’ search dialogs to their main window so that they behave like other dialogs and do not get hidden behind their main window.
  • bpo-37039: Adjust “Zoom Height” to individual screens by momemtarily maximizing the window on first use with a particular screen. Changing screen settings may invalidate the saved height. While a window is maximized, “Zoom Height” has no effect.
  • bpo-35763: Make calltip reminder about ‘/’ meaning positional-only less obtrusive by only adding it when there is room on the first line.
  • bpo-5680: Add ‘Run… Customized’ to the Run menu to run a module with customized settings. Any ‘command line arguments’ entered are added to sys.argv. One can suppress the normal Shell main module restart.
  • bpo-35610: Replace now redundant .context_use_ps1 with .prompt_last_line. This finishes change started in bpo-31858.
  • bpo-37038: Make idlelib.run runnable; add test clause.
  • bpo-36958: Print any argument other than None or int passed to SystemExit or sys.exit().
  • bpo-13102: When saving a file, call os.fsync() so bits are flushed to e.g. USB drive.
  • bpo-36429: Fix starting IDLE with pyshell. Add idlelib.pyshell alias at top; remove pyshell alias at bottom. Remove obsolete __name__==’__main__’ command.
  • bpo-36405: Use dict unpacking in idlelib.
  • bpo-36396: Remove fgBg param of idlelib.config.GetHighlight(). This param was only used twice and changed the return type.
  • bpo-23205: For the grep module, add tests for findfiles, refactor findfiles to be a module-level function, and refactor findfiles to use os.walk.
  • bpo-23216: Add docstrings to IDLE search modules.
  • bpo-30348: Increase test coverage of idlelib.autocomplete by 30%.
  • bpo-32411: In browser.py, remove extraneous sorting by line number since dictionary was created in line number order.
  • Tools/Demos:
  • bpo-14546: Fix the argument handling in Tools/scripts/lll.py.
  • bpo-32217: Fix freeze script on Windows.
  • C API:
  • bpo-28805: The METH_FASTCALL calling convention has been documented.
  • bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask().
  • bpo-36389: Change the value of CLEANBYTE, DEADDYTE and FORBIDDENBYTE internal constants used by debug hooks on Python memory allocators (PyMem_SetupDebugHooks() function). Byte patterns 0xCB, 0xDB and 0xFB have been replaced with 0xCD, 0xDD and 0xFD to use the same values than Windows CRT debug malloc() and free().

New in Python 3.7.3 (Mar 26, 2019)

  • Security:
  • bpo-36216: Changes urlsplit() to raise ValueError when the URL contains characters that decompose under IDNA encoding (NFKC-normalization) into characters that affect how the URL is parsed.
  • bpo-35746: [CVE-2019-5010] Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL distribution points with empty DP or URI correctly. A malicious or buggy certificate can result into segfault. Vulnerability (TALOS-2018-0758) reported by Colin Read and Nicolas Edet of Cisco.
  • bpo-35121: Don’t send cookies of domain A without Domain attribute to domain B when domain A is a suffix match of domain B while using a cookiejar with http.cookiejar.DefaultCookiePolicy policy. Patch by Karthikeyan Singaravelan.
  • Core and Builtins:
  • bpo-35942: The error message emitted when returning invalid types from __fspath__ in interfaces that allow passing PathLike objects has been improved and now it does explain the origin of the error.
  • bpo-35992: Fix __class_getitem__() not being called on a class with a custom non-subscriptable metaclass.
  • bpo-35991: Fix a potential double free in Modules/_randommodule.c.
  • bpo-35961: Fix a crash in slice_richcompare(): use strong references rather than stolen references for the two temporary internal tuples.
  • bpo-31506: Clarify the errors reported when object.__new__ and object.__init__ receive more than one argument. Contributed by Sanyam Khurana.
  • bpo-35720: Fixed a minor memory leak in pymain_parse_cmdline_impl function in Modules/main.c
  • bpo-35623: Fix a crash when sorting very long lists. Patch by Stephan Hohe.
  • bpo-35214: clang Memory Sanitizer build instrumentation was added to work around false positives from posix, socket, time, test_io, and test_faulthandler.
  • bpo-35560: Fix an assertion error in format() in debug build for floating point formatting with “n” format, zero padding and small width. Release build is not impacted. Patch by Karthikeyan Singaravelan.
  • bpo-35552: Format characters %s and %V in PyUnicode_FromFormat() and %s in PyBytes_FromFormat() no longer read memory past the limit if precision is specified.
  • bpo-35504: Fix segfaults and SystemErrors when deleting certain attributes. Patch by Zackery Spytz.
  • bpo-33989: Fix a possible crash in list.sort() when sorting objects with ob_type->tp_richcompare == NULL. Patch by Zackery Spytz.
  • Library:
  • bpo-35931: The pdb debug command now gracefully handles all exceptions.
  • bpo-36251: Fix format strings used for stderrprinter and re.Match reprs. Patch by Stephan Hohe.
  • bpo-35807: Update ensurepip to install pip 19.0.3 and setuptools 40.8.0.
  • bpo-36179: Fix two unlikely reference leaks in _hashopenssl. The leaks only occur in out-of-memory cases.
  • bpo-35178: Ensure custom warnings.formatwarning() function can receive line as positional argument. Based on patch by Tashrif Billah.
  • bpo-36106: Resolve potential name clash with libm’s sinpi(). Patch by Dmitrii Pasechnik.
  • bpo-35512: unittest.mock.patch.dict() used as a decorator with string target resolves the target during function call instead of during decorator construction. Patch by Karthikeyan Singaravelan.
  • bpo-36091: Clean up reference to async generator in Lib/types. Patch by Henry Chen.
  • bpo-35899: Enum has been fixed to correctly handle empty strings and strings with non-Latin characters (ie. ‘α’, ‘א’) without crashing. Original patch contributed by Maxwell. Assisted by Stéphane Wirtel.
  • bpo-35918: Removed broken has_key method from multiprocessing.managers.SyncManager.dict. Contributed by Rémi Lapeyre.
  • bpo-35960: Fix dataclasses.field() throwing away empty mapping objects passed as metadata.
  • bpo-35847: RISC-V needed the CTYPES_PASS_BY_REF_HACK. Fixes ctypes Structure test_pass_by_value.
  • bpo-35780: Fix lru_cache() errors arising in recursive, reentrant, or multi-threaded code. These errors could result in orphan links and in the cache being trapped in a state with fewer than the specified maximum number of links. Fix handling of negative maxsize which should have been treated as zero. Fix errors in toggling the “full” status flag. Fix misordering of links when errors are encountered. Sync-up the C code and pure Python code for the space saving path in functions with a single positional argument. In this common case, the space overhead of an lru cache entry is reduced by almost half. Fix counting of cache misses. In error cases, the miss count was out of sync with the actual number of times the underlying user function was called.
  • bpo-23846: asyncio.ProactorEventLoop now catches and logs send errors when the self-pipe is full.
  • bpo-34323: asyncio: Enhance IocpProactor.close() log: wait 1 second before the first log, then log every second. Log also the number of seconds since close() was called.
  • bpo-34294: re module, fix wrong capturing groups in rare cases. re.search(), re.findall(), re.sub() and other functions that scan through string looking for a match, should reset capturing groups between two match attempts. Patch by Ma Lin.
  • bpo-35717: Fix KeyError exception raised when using enums and compile. Patch contributed by Rémi Lapeyre.
  • bpo-35699: Fixed detection of Visual Studio Build Tools 2017 in distutils
  • bpo-32710: Fix memory leaks in asyncio ProactorEventLoop on overlapped operation failure.
  • bpo-32710: Fix a memory leak in asyncio in the ProactorEventLoop when ReadFile() or WSASend() overlapped operation fail immediately: release the internal buffer.
  • bpo-35682: Fix asyncio.ProactorEventLoop.sendfile(): don’t attempt to set the result of an internal future if it’s already done.
  • bpo-35283: Add a pending deprecated warning for the threading.Thread.isAlive() method. Patch by Dong-hee Na.
  • bpo-35643: Fixed a SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py. Patch by Mickaël Schoentgen.
  • bpo-35615: weakref: Fix a RuntimeError when copying a WeakKeyDictionary or a WeakValueDictionary, due to some keys or values disappearing while iterating.
  • bpo-28503: The crypt module now internally uses the crypt_r() library function instead of crypt() when available.
  • bpo-35121: Don’t set cookie for a request when the request path is a prefix match of the cookie’s path attribute but doesn’t end with “/”. Patch by Karthikeyan Singaravelan.
  • bpo-35585: Speed-up building enums by value, e.g. http.HTTPStatus(200).
  • bpo-21478: Calls to a child function created with unittest.mock.create_autospec() should propagate to the parent. Patch by Karthikeyan Singaravelan.
  • bpo-35513: TextTestRunner of unittest.runner now uses time.perf_counter() rather than time.time() to measure the execution time of a test: time.time() can go backwards, whereas time.perf_counter() is monotonic.
  • bpo-35502: Fixed reference leaks in xml.etree.ElementTree.TreeBuilder in case of unfinished building of the tree (in particular when an error was raised during parsing XML).
  • bpo-31446: Copy command line that was passed to CreateProcessW since this function can change the content of the input buffer.
  • bpo-20239: Allow repeated assignment deletion of unittest.mock.Mock attributes. Patch by Pablo Galindo.
  • bpo-17185: Set __signature__ on mock for inspect to get signature. Patch by Karthikeyan Singaravelan.
  • bpo-10496: check_environ() of distutils.utils now catches KeyError on calling pwd.getpwuid(): don’t create the HOME environment variable in this case.
  • bpo-35066: Previously, calling the strftime() method on a datetime object with a trailing ‘%’ in the format string would result in an exception. However, this only occured when the datetime C module was being used; the python implementation did not match this behavior. Datetime is now PEP-399 compliant, and will not throw an exception on a trailing ‘%’.
  • bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff. Orignial patch by R. David Murray & Jairo Trad. Enhanced by Sanyam Khurana.
  • bpo-35198: Fix C++ extension compilation on AIX
  • bpo-28441: On Cygwin and MinGW, ensure that sys.executable always includes the full filename in the path, including the .exe suffix (unless it is a symbolic link).
  • bpo-34572: Fix C implementation of pickle.loads to use importlib’s locking mechanisms, and thereby avoid using partially-loaded modules. Patch by Tim Burgess.
  • bpo-33687: Fix the call to os.chmod() for uu.decode() if a mode is given or decoded. Patch by Timo Furrer.
  • bpo-32146: Document the interaction between frozen executables and the spawn and forkserver start methods in multiprocessing.
  • Documentation:
  • bpo-36083: Fix formatting of –check-hash-based-pycs options in the manpage Synopsis.
  • bpo-34764: Improve example of iter() with 2nd sentinel argument.
  • bpo-21314: A new entry was added to the Core Language Section of the Programming FAQ, which explaines the usage of slash(/) in the signature of a function. Patch by Lysandros Nikolaou
  • bpo-22062: Update documentation and docstrings for pathlib. Original patch by Mike Short.
  • Tests:
  • bpo-36234: test_posix.PosixUidGidTests: add tests for invalid uid/gid type (str). Initial patch written by David Malcolm.
  • bpo-29571: Fix test_re.test_locale_flag(): use locale.getpreferredencoding() rather than locale.getlocale() to get the locale encoding. With some locales, locale.getlocale() returns the wrong encoding. On Windows, set temporarily the LC_CTYPE locale to the user preferred encoding to ensure that it uses the ANSI code page, to be consistent with locale.getpreferredencoding().
  • bpo-36123: Fix race condition in test_socket.
  • bpo-27313: Avoid test_ttk_guionly ComboboxTest failure with macOS Cocoa Tk.
  • bpo-36019: Add test.support.TEST_HTTP_URL and replace references of http://www.example.com by this new constant. Contributed by Stéphane Wirtel.
  • bpo-36037: Fix test_ssl for strict OpenSSL configuration like RHEL8 strict crypto policy. Use older TLS version for minimum TLS version of the server SSL context if needed, to test TLS version older than default minimum TLS version.
  • bpo-35505: Make test_imap4_host_default_value independent on whether the local IMAP server is running.
  • bpo-35917: multiprocessing: provide unit tests for SyncManager and SharedMemoryManager classes + all the shareable types which are supposed to be supported by them. (patch by Giampaolo Rodola)
  • bpo-35772: Fix sparse file tests of test_tarfile on ppc64 with the tmpfs filesystem. Fix the function testing if the filesystem supports sparse files: create a file which contains data and “holes”, instead of creating a file which contains no data. tmpfs effective block size is a page size (tmpfs lives in the page cache). RHEL uses 64 KiB pages on aarch64, ppc64, ppc64le, only s390x and x86_64 use 4 KiB pages, whereas the test punch holes of 4 KiB.
  • bpo-35045: Make ssl tests less strict and also accept TLSv1 as system default. The changes unbreaks test_min_max_version on Fedora 29.
  • bpo-31731: Fix a race condition in check_interrupted_write() of test_io: create directly the thread with SIGALRM signal blocked, rather than blocking the signal later from the thread. Previously, it was possible that the thread gets the signal before the signal is blocked.
  • bpo-35424: Fix test_multiprocessing_main_handling: use multiprocessing.Pool with a context manager and then explicitly join the pool.
  • bpo-35519: Rename test.bisect module to test.bisect_cmd to avoid conflict with bisect module when running directly a test like ./python Lib/test/test_xmlrpc.py.
  • bpo-35513: Replace time.time() with time.monotonic() in tests to measure time delta.
  • bpo-34279: test.support.run_unittest() no longer raise TestDidNotRun if the test result contains skipped tests. The exception is now only raised if no test have been run and no test have been skipped.
  • bpo-35412: Add testcase to test_future4: check unicode literal.
  • bpo-26704: Added test demonstrating double-patching of an instance method. Patch by Anthony Sottile.
  • Build:
  • bpo-34691: The _contextvars module is now built into the core Python library on Windows.
  • bpo-35683: Improved Azure Pipelines build steps and now verifying layouts correctly
  • bpo-35642: Remove asynciomodule.c from pythoncore.vcxproj
  • bpo-35550: Fix incorrect Solaris #ifdef checks to look for __sun && __SVR4 instead of sun when compiling.
  • IDLE:
  • bpo-36176: Fix IDLE autocomplete & calltip popup colors. Prevent conflicts with Linux dark themes (and slightly darken calltip background).
  • bpo-36152: Remove colorizer.ColorDelegator.close_when_done and the corresponding argument of .close(). In IDLE, both have always been None or False since 2007.
  • bpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. Patch by Kevin Walzer.
  • bpo-24310: IDLE – Document settings dialog font tab sample.
  • bpo-36096: Refactor class variables to instance variables in colorizer.
  • bpo-35833: Revise IDLE doc for control codes sent to Shell. Add a code example block.
  • bpo-35770: IDLE macosx deletes Options => Configure IDLE. It previously deleted Window => Zoom Height by mistake. (Zoom Height is now on the Options menu). On Mac, the settings dialog is accessed via Preferences on the IDLE menu.
  • bpo-35769: Change IDLE’s new file name from ‘Untitled’ to ‘untitled’
  • bpo-35689: Add docstrings and unittests for colorizer.py.
  • bpo-35660: Fix imports in idlelib.window.
  • bpo-35641: Proper format calltip when the function has no docstring.
  • bpo-33987: Use ttk Frame for ttk widgets.
  • bpo-34055: Fix erroneous ‘smart’ indents and newlines in IDLE Shell.
  • bpo-35591: Find Selection now works when selection not found.
  • bpo-35196: Speed up squeezer line counting.
  • bpo-35598: Update config_key: use PEP 8 names and ttk widgets, make some objects global, and add tests.
  • bpo-28097: Add Previous/Next History entries to Shell menu.
  • bpo-35208: Squeezer now properly counts wrapped lines before newlines.
  • bpo-35555: Gray out Code Context menu entry when it’s not applicable.
  • bpo-35521: Document the IDLE editor code context feature. Add some internal references within the IDLE doc.
  • bpo-22703: The Code Context menu label now toggles between Show/Hide Code Context. The Zoom Height menu now toggles between Zoom/Restore Height. Zoom Height has moved from the Window menu to the Options menu.
  • Tools/Demos:
  • bpo-35132: Fix py-list and py-bt commands of python-gdb.py on gdb7.
  • C API¶:
  • bpo-33817: Fixed _PyBytes_Resize() for empty bytes objects.

New in Python 3.7.2 (Dec 27, 2018)

  • Library:
  • bpo-31715: Associate .mjs file extension with application/javascript MIME Type.
  • Build:
  • bpo-35499: make profile-opt no longer replaces CFLAGS_NODIST with CFLAGS. It now adds profile-guided optimization (PGO) flags to CFLAGS_NODIST: existing CFLAGS_NODIST flags are kept.
  • bpo-35257: Avoid leaking the linker flags from Link Time Optimizations (LTO) into distutils when compiling C extensions.
  • C API:
  • bpo-35259: Conditionally declare Py_FinalizeEx() (new in 3.6) based on Py_LIMITED_API. Patch by Arthur Neufeld.

New in Python 3.7.2 Release Candidate 1 (Dec 27, 2018)

  • Security:
  • bpo-34812: The -I command line option (run Python in isolated mode) is now also copied by the multiprocessing and distutils modules when spawning child processes. Previously, only -E and -s options (enabled by -I) were copied.
  • bpo-34791: The xml.sax and xml.dom.domreg no longer use environment variables to override parser implementations when sys.flags.ignore_environment is set by -E or -I arguments.
  • Core and Builtins:
  • bpo-35444: Fixed error handling in pickling methods when fail to look up builtin “getattr”.
  • bpo-35436: Fix various issues with memory allocation error handling. Patch by Zackery Spytz.
  • bpo-35357: Internal attributes’ names of unittest.mock._Call and unittest.mock.MagicProxy (name, parent & from_kall) are now prefixed with _mock_ in order to prevent clashes with widely used object attributes. Fixed minor typo in test function name.
  • bpo-35372: Fixed the code page decoder for input longer than 2 GiB containing undecodable bytes.
  • bpo-35336: Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C locale if the LC_CTYPE locale is “C”.
  • bpo-33954: For str.format(), float.__format__() and complex.__format__() methods for non-ASCII decimal point when using the “n” formatter.
  • bpo-35269: Fix a possible segfault involving a newly-created coroutine. Patch by Zackery Spytz.
  • bpo-35214: Fixed an out of bounds memory access when parsing a truncated unicode escape sequence at the end of a string such as 'N'. It would read one byte beyond the end of the memory allocation.
  • bpo-35214: The interpreter and extension modules have had annotations added so that they work properly under clang’s Memory Sanitizer. A new configure flag –with-memory-sanitizer has been added to make test builds of this nature easier to perform.
  • bpo-35193: Fix an off by one error in the bytecode peephole optimizer where it could read bytes beyond the end of bounds of an array when removing unreachable code. This bug was present in every release of Python 3.6 and 3.7 until now.
  • bpo-29341: Clarify in the docstrings of os methods that path-like objects are also accepted as input parameters.
  • bpo-35050: socket: Fix off-by-one bug in length check for AF_ALG name and type.
  • bpo-34974: bytes and bytearray constructors no longer convert unexpected exceptions (e.g. MemoryError and KeyboardInterrupt) to TypeError.
  • bpo-34973: Fixed crash in bytes() when the list argument is mutated while it is iterated.
  • bpo-34824: Fix a possible null pointer dereference in Modules/_ssl.c. Patch by Zackery Spytz.
  • bpo-1621: Do not assume signed integer overflow behavior (C undefined behavior) when performing set hash table resizing.
  • Library:
  • bpo-35052: Fix xml.dom.minidom cloneNode() on a document with an entity: pass the correct arguments to the user data handler of an entity.
  • bpo-35330: When a Mock instance was used to wrap an object, if side_effect is used in one of the mocks of it methods, don’t call the original implementation and return the result of using the side effect the same way that it is done with return_value.
  • bpo-34172: Revert the fix for this issue previously released in 3.7.1 pending further investigation: Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly.
  • bpo-10496: posixpath.expanduser() now returns the input path unchanged if the HOME environment variable is not set and the current user has no home directory (if the current user identifier doesn’t exist in the password database). This change fix the site module if the current user doesn’t exist in the password database (if the user has no home directory).
  • bpo-35310: Fix a bug in select.select() where, in some cases, the file descriptor sequences were returned unmodified after a signal interruption, even though the file descriptors might not be ready yet. select.select() will now always return empty lists if a timeout has occurred. Patch by Oran Avraham.
  • bpo-35380: Enable TCP_NODELAY on Windows for proactor asyncio event loop.
  • bpo-35341: Add generic version of collections.OrderedDict to the typing module. Patch by Ismo Toijala.
  • bpo-35371: Fixed possible crash in os.utime() on Windows when pass incorrect arguments.
  • bpo-27903: Fix ResourceWarning in platform.dist() on SuSE and Caldera OpenLinux. Patch by Ville Skyttä.
  • bpo-35308: Fix regression in webbrowser where default browsers may be preferred over browsers in the BROWSER environment variable.
  • bpo-28604: locale.localeconv() now sets temporarily the LC_CTYPE locale to the LC_MONETARY locale if the two locales are different and monetary strings are non-ASCII. This temporary change affects other threads.
  • bpo-35277: Update ensurepip to install pip 18.1 and setuptools 40.6.2.
  • bpo-35226: Recursively check arguments when testing for equality of unittest.mock.call objects and add note that tracking of parameters used to create ancestors of mocks in mock_calls is not possible.
  • bpo-29564: The warnings module now suggests to enable tracemalloc if the source is specified, the tracemalloc module is available, but tracemalloc is not tracing memory allocations.
  • bpo-35189: Modify the following fnctl function to retry if interrupted by a signal (EINTR): flock, lockf, fnctl
  • bpo-35062: Fix incorrect parsing of _io.IncrementalNewlineDecoder’s translate argument.
  • bpo-35079: Improve difflib.SequenceManager.get_matching_blocks doc by adding ‘non-overlapping’ and changing ‘!=’ to ‘

New in Python 3.7.1 (Oct 21, 2018)

  • Library:
  • bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks()

New in Python 3.7.0 (Jul 2, 2018)

  • Library:
  • bpo-33851: Fix ast.get_docstring() for a node that lacks a docstring.
  • C API:
  • bpo-33932: Calling Py_Initialize() twice does nothing, instead of failing with a fatal error: restore the Python 3.6 behaviour.

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 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
  • macOS:
  • bpo-33184: Update macOS installer build 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)

  • Security:
  • bpo-33136: Harden ssl module against LibreSSL CVE-2018-8970. X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new test ensures that NULL bytes are not allowed.
  • bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows
  • bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic backtracking. These regexes formed potential DOS vectors (REDOS). They have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch by Jamie Davis.
  • Core and Builtins:
  • bpo-33053: When using the -m switch, sys.path[0] is now explicitly expanded as the starting working directory, rather than being left as the empty path (which allows imports from the current working directory at the time of the import)
  • bpo-33018: Improve consistency of errors raised by issubclass() when called with a non-class and an abstract base class as the first and second arguments, respectively. Patch by Josh Bronson.
  • bpo-33041: Fixed jumping when the function contains an async for loop.
  • bpo-33026: Fixed jumping out of “with” block by setting f_lineno.
  • bpo-33005: Fix a crash on fork when using a custom memory allocator (ex: using PYTHONMALLOC env var). _PyGILState_Reinit() and _PyInterpreterState_Enable() now use the default RAW memory allocator to allocate a new interpreters mutex on fork.
  • bpo-17288: Prevent jumps from ‘return’ and ‘exception’ trace events.
  • bpo-32836: Don’t use temporary variables in cases of list/dict/set comprehensions
  • Library:
  • bpo-33141: Have Field objects pass through __set_name__ to their default values, if they have their own __set_name__.
  • bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false boolean value. Note iid=0 and iid=False would be same. Patch by Garvit Khatri.
  • bpo-32873: Treat type variables and special typing forms as immutable by copy and pickle. This fixes several minor issues and inconsistencies, and improves backwards compatibility with Python 3.6.
  • bpo-33134: When computing dataclass’s __hash__, use the lookup table to contain the function which returns the __hash__ value. This is an improvement over looking up a string, and then testing that string to see what to do.
  • bpo-33127: The ssl module now compiles with LibreSSL 2.7.1.
  • bpo-32505: Raise TypeError if a member variable of a dataclass is of type Field, but doesn’t have a type annotation.
  • bpo-33078: Fix the failure on OSX caused by the tests relying on sem_getvalue
  • bpo-33116: Add ‘Field’ to dataclasses.__all__.
  • bpo-32896: Fix an error where subclassing a dataclass with a field that uses a default_factory would generate an incorrect class.
  • bpo-33100: Dataclasses: If a field has a default value that’s a MemberDescriptorType, then it’s from that field being in __slots__, not an actual default value.
  • bpo-32953: If a non-dataclass inherits from a frozen dataclass, allow attributes to be added to the derived class. Only attributes from the frozen dataclass cannot be assigned to. Require all dataclasses in a hierarchy to be either all frozen or all non-frozen.
  • bpo-33061: Add missing NoReturn to __all__ in typing.py
  • bpo-33078: Fix the size handling in multiprocessing.Queue when a pickling error occurs.
  • bpo-33064: lib2to3 now properly supports trailing commas after *args and **kwargs in function signatures.
  • bpo-33056: FIX properly close leaking fds in concurrent.futures.ProcessPoolExecutor.
  • bpo-33021: Release the GIL during fstat() calls, avoiding hang of all threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch by Nir Soffer.
  • bpo-31804: Avoid failing in multiprocessing.Process if the standard streams are closed or None at exit.
  • bpo-33037: Skip sending/receiving data after SSL transport closing.
  • bpo-27683: Fix a regression in ipaddress that result of hosts() is empty when the network is constructed by a tuple containing an integer mask and only 1 bit left for addresses.
  • bpo-32999: Fix C implemetation of ABC.__subclasscheck__(cls, subclass) crashed when subclass is not a type object.
  • bpo-33009: Fix inspect.signature() for single-parameter partialmethods.
  • bpo-32969: Expose several missing constants in zlib and fix corresponding documentation.
  • bpo-32056: Improved exceptions raised for invalid number of channels and sample width when read an audio file in modules aifc, wave and sunau.
  • bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in subprocess if another low descriptor is closed.
  • bpo-32857: In tkinter, after_cancel(None) now raises a ValueError instead of canceling the first scheduled function. Patch by Cheryl Sabella.
  • bpo-31639: http.server now exposes a ThreadedHTTPServer class and uses it when the module is run with -m to cope with web browsers pre-opening sockets.
  • bpo-27645: sqlite3.Connection now exposes a backup method, if the underlying SQLite library is at version 3.6.11 or higher. Patch by Lele Gaifax.
  • Documentation:
  • bpo-33126: Document PyBuffer_ToContiguous().
  • bpo-27212: Modify documentation for the islice() recipe to consume initial values up to the start index.
  • bpo-28247: Update zipapp documentation to describe how to make standalone applications.
  • bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and Berker Peksag.
  • bpo-27428: Update documentation to clarify that WindowsRegistryFinder implements MetaPathFinder. (Patch by Himanshu Lakhara)
  • Tests:
  • bpo-32872: Avoid regrtest compatibility issue with namespace packages.
  • bpo-32517: Fix failing test_asyncio on macOS 10.12.2+ due to transport of KqueueSelector loop was not being closed.
  • bpo-19417: Add test_bdb.py.
  • Build:
  • bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1.
  • macOS:
  • bpo-32726: Build and link with private copy of Tcl/Tk 8.6 for the macOS 10.6+ installer. The 10.9+ installer variant already does this. This means that the Python 3.7 provided by the python.org macOS installers no longer need or use any external versions of Tcl/Tk, either system-provided or user- installed, such as ActiveTcl.
  • IDLE:
  • bpo-32984: Set __file__ while running a startup file. Like Python, IDLE optionally runs one startup file in the Shell window before presenting the first interactive input prompt. For IDLE, -s runs a file named in environmental variable IDLESTARTUP or PYTHONSTARTUP; -r file runs file. Python sets __file__ to the startup file name before running the file and unsets it before the first prompt. IDLE now does the same when run normally, without the -n option.
  • bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse.
  • Tools/Demos:
  • bpo-32885: Add an -n flag for Tools/scripts/pathfix.py to disbale automatic backup creation (files with ~ suffix).
  • C API:
  • bpo-33042: Embedding applications may once again call PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to calling Py_Initialize.
  • bpo-32374: Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL, and add a sanity check

New in Python 3.6.5 (Mar 29, 2018)

  • Tests:
  • bpo-32872: Avoid regrtest compatibility issue with namespace packages.
  • Build:
  • bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1.

New in Python 3.6.5 RC 1 (Mar 15, 2018)

  • 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 based on a proposal by Raymond Hettinger and 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.
  • 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.

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

  • Security:
  • bpo-28414: The ssl module now allows users to perform their own IDN en/decoding when using SNI.
  • Core and Builtins:
  • bpo-32889: Update Valgrind suppression list to account for the rename of Py_ADDRESS_IN_RANG to address_in_range.
  • bpo-31356: Remove the new API added in bpo-31356 (gc.ensure_disabled() context manager).
  • bpo-32305: For namespace packages, ensure that both __file__ and __spec__.origin are set to None.
  • bpo-32303: Make sure __spec__.loader matches __loader__ for namespace packages.
  • bpo-32711: Fix the warning messages for Python/ast_unparse.c. Patch by Stéphane Wirtel
  • bpo-32583: Fix possible crashing in builtin Unicode decoders caused by write out-of- bound errors when using customized decode error handlers.
  • Library:
  • bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen classes, and also disallow inheriting non-frozen from frozen classes. This restriction will be relaxed at a future date.
  • bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch by Joffrey Fuhrer.
  • bpo-32951: Direct instantiation of SSLSocket and SSLObject objects is now prohibited. The constructors were never documented, tested, or designed as public constructors. Users were suppose to use ssl.wrap_socket() or SSLContext.
  • bpo-32929: Remove the tri-state parameter “hash”, and add the boolean “unsafe_hash”. If unsafe_hash is True, add a __hash__ function, but if a __hash__ exists, raise TypeError. If unsafe_hash is False, add a __hash__ based on the values of eq= and frozen=. The unsafe_hash=False behavior is the same as the old hash=None behavior. unsafe_hash=False is the default, just as hash=None used to be.
  • bpo-32947: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3 for future compatibility with OpenSSL 1.1.1.
  • bpo-30622: The ssl module now detects missing NPN support in LibreSSL.
  • bpo-32922: dbm.open() now encodes filename with the filesystem encoding rather than default encoding.
  • bpo-32859: In os.dup2, don’t check every call whether the dup3 syscall exists or not.
  • bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes.
  • bpo-25988: Emit a DeprecationWarning when using or importing an ABC directly from collections rather than from collections.abc.
  • bpo-21060: Rewrite confusing message from setup.py upload from “No dist file created in earlier command” to the more helpful “Must create and upload files in one command”.
  • bpo-32852: Make sure sys.argv remains as a list when running trace.
  • bpo-31333: _abc module is added. It is a speedup module with C implementations for various functions and methods in abc. Creating an ABC subclass and calling isinstance or issubclass with an ABC subclass are up to 1.5x faster. In addition, this makes Python start-up up to 10% faster.
  • Note that the new implementation hides internal registry and caches, previously accessible via private attributes _abc_registry, _abc_cache, and _abc_negative_cache. There are three debugging helper methods that can be used instead _dump_registry, _abc_registry_clear, and _abc_caches_clear.
  • bpo-32841: Fixed asyncio.Condition issue which silently ignored cancellation after notifying and cancelling a conditional lock. Patch by Bar Harel.
  • bpo-32819: ssl.match_hostname() has been simplified and no longer depends on re and ipaddress module for wildcard and IP addresses. Error reporting for invalid wildcards has been improved.
  • bpo-32394: socket: Remove TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version Windows during run-time.
  • bpo-31787: Fixed refleaks of __init__() methods in various modules. (Contributed by Oren Milman)
  • bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when only the last field is quoted. Patch by Jake Davis.
  • bpo-32792: collections.ChainMap() preserves the order of the underlying mappings.
  • bpo-32775: fnmatch.translate() no longer produces patterns which contain set operations. Sets starting with ‘[‘ or containing ‘–’, ‘&&’, ‘~~’ or ‘||’ will be interpreted differently in regular expressions in future versions. Currently they emit warnings. fnmatch.translate() now avoids producing patterns containing such sets by accident.
  • bpo-32622: Implement native fast sendfile for Windows proactor event loop.
  • bpo-32777: Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4.
  • bpo-32647: The ctypes module used to depend on indirect linking for dlopen. The shared extension is now explicitly linked against libdl on platforms with dl.
  • bpo-32741: Implement asyncio.TimerHandle.when() method.
  • bpo-32691: Use mod_spec.parent when running modules with pdb
  • bpo-32734: Fixed asyncio.Lock() safety issue which allowed acquiring and locking the same lock multiple times, without it being free. Patch by Bar Harel.
  • bpo-32727: Do not include name field in SMTP envelope from address. Patch by Stéphane Wirtel
  • bpo-31453: Add TLSVersion constants and SSLContext.maximum_version / minimum_version attributes. The new API wraps OpenSSL 1.1 https://www.open ssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html feature.
  • bpo-24334: Internal implementation details of ssl module were cleaned up. The SSLSocket has one less layer of indirection. Owner and session information are now handled by the SSLSocket and SSLObject constructor. Channel binding implementation has been simplified.
  • bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND chunk is not found. Patch by Zackery Spytz.
  • bpo-32585: Add Ttk spinbox widget to tkinter.ttk. Patch by Alan D Moore.
  • bpo-32221: Various functions returning tuple containig IPv6 addresses now omit %scope part since the same information is already encoded in scopeid tuple item. Especially this speeds up socket.recvfrom() when it receives multicast packet since useless resolving of network interface name is omitted.
  • bpo-30693: The TarFile class now recurses directories in a reproducible way.
  • bpo-30693: The ZipFile class now recurses directories in a reproducible way.
  • Documentation:
  • bpo-28124: The ssl module function ssl.wrap_socket() has been de- emphasized and deprecated in favor of the more secure and efficient SSLContext.wrap_socket() method.
  • bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy.
  • bpo-32436: Add documentation for the contextvars module (PEP 567).
  • bpo-32800: Update link to w3c doc for xml default namespaces.
  • bpo-11015: Update test.support documentation.
  • bpo-8722: Document __getattr__() behavior when property get() method raises AttributeError.
  • bpo-32614: Modify RE examples in documentation to use raw strings to prevent DeprecationWarning and add text to REGEX HOWTO to highlight the deprecation.
  • bpo-31972: Improve docstrings for pathlib.PurePath subclasses.
  • Tests:
  • bpo-31809: Add tests to verify connection with secp ECDH curves.
  • Build:
  • bpo-32898: Fix the python debug build when using COUNT_ALLOCS.
  • macOS:
  • bpo-32901: Update macOS 10.9+ installer to Tcl/Tk 8.6.8.
  • IDLE:
  • bpo-32916: Change str to code in pyparse.
  • bpo-32905: Remove unused code in pyparse module.
  • bpo-32874: Add tests for pyparse.
  • bpo-32837: Using the system and place-dependent default encoding for open() is a bad idea for IDLE’s system and location-independent files.
  • bpo-32826: Add “encoding=utf-8” to open() in IDLE’s test_help_about. GUI test test_file_buttons() only looks at initial ascii-only lines, but failed on systems where open() defaults to ‘ascii’ because readline() internally reads and decodes far enough ahead to encounter a non-ascii character in CREDITS.txt.
  • bpo-32765: Update configdialog General tab docstring to add new widgets to the widget list.
  • Tools/Demos:
  • bpo-32222: Fix pygettext not extracting docstrings for functions with type annotated arguments. Patch by Toby Harradine.

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

  • Core and Builtins:
  • bpo-32703: Fix coroutine’s ResourceWarning when there’s an active error set when it’s being finalized.
  • bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step over (next command) native coroutines. Patch by Pablo Galindo.
  • bpo-28685: Optimize list.sort() and sorted() by using type specialized comparisons when possible.
  • bpo-32685: Improve suggestion when the Python 2 form of print statement is either present on the same line as the header of a compound statement or else terminated by a semi-colon instead of a newline. Patch by Nitish Chandra.
  • bpo-32697: Python now explicitly preserves the definition order of keyword-only parameters. It’s always preserved their order, but this behavior was never guaranteed before; this behavior is now guaranteed and tested.
  • bpo-32690: The locals() dictionary now displays in the lexical order that variables were defined. Previously, the order was reversed.
  • bpo-32677: Add .isascii() method to str, bytes and bytearray. It can be used to test that string contains only ASCII characters.
  • bpo-32670: Enforce PEP 479 for all code.
  • This means that manually raising a StopIteration exception from a generator is prohibited for all code, regardless of whether ‘from __future__ import generator_stop’ was used or not.
  • bpo-32591: Added built-in support for tracking the origin of coroutine objects; see sys.set_coroutine_origin_tracking_depth and CoroutineType.cr_origin. This replaces the asyncio debug mode’s use of coroutine wrapping for native coroutine objects.
  • bpo-31368: Expose preadv and pwritev system calls in the os module. Patch by Pablo Galindo:
  • bpo-32544: hasattr(obj, name) and getattr(obj, name, default) are about 4 times faster than before when name is not found and obj doesn’t override __getattr__ or __getattribute__.
  • bpo-26163: Improved frozenset() hash to create more distinct hash values when faced with datasets containing many similar values.
  • bpo-32550: Remove the STORE_ANNOTATION bytecode.
  • bpo-20104: Expose posix_spawn as a low level API in the os module.
  • bpo-24340: Fixed estimation of the code stack size.
  • bpo-32436: Implement PEP 567 Context Variables.
  • bpo-18533: repr() on a dict containing its own values() or items() no longer raises RecursionError; OrderedDict similarly. Instead, use ..., as for other recursive structures. Patch by Ben North.
  • bpo-20891: Py_Initialize() now creates the GIL. The GIL is no longer created “on demand” to fix a race condition when PyGILState_Ensure() is called in a non- Python thread.
  • bpo-32028: Leading whitespace is now correctly ignored when generating suggestions for converting Py2 print statements to Py3 builtin print function calls. Patch by Sanyam Khurana.
  • bpo-31356: Add a new contextmanager to the gc module that temporarily disables the GC and restores the previous state. The implementation is done in C to assure atomicity and speed.
  • bpo-31179: Make dict.copy() up to 5.5 times faster.
  • bpo-31113: Get rid of recursion in the compiler for normal control flow.
  • Library:
  • bpo-25988: Deprecate exposing the contents of collections.abc in the regular collections module.
  • bpo-31429: The default cipher suite selection of the ssl module now uses a blacklist approach rather than a hard-coded whitelist. Python no longer re-enables ciphers that have been blocked by OpenSSL security update. Default cipher suite selection can be configured on compile time.
  • bpo-30306: contextlib.contextmanager now releases the arguments passed to the underlying generator as soon as the context manager is entered. Previously it would keep them alive for as long as the context manager was alive, even when not being used as a function decorator. Patch by Martin Teichmann.
  • bpo-21417: Added support for setting the compression level for zipfile.ZipFile.
  • bpo-32251: Implement asyncio.BufferedProtocol (provisional API).
  • bpo-32513: In dataclasses, allow easier overriding of dunder methods without specifying decorator parameters.
  • bpo-32660: termios makes available FIONREAD, FIONCLEX, FIOCLEX, FIOASYNC and FIONBIO also under Solaris/derivatives.
  • bpo-27931: Fix email address header parsing error when the username is an empty quoted string. Patch by Xiang Zhang.
  • bpo-32659: Under Solaris and derivatives, os.stat_result provides a st_fstype attribute.
  • bpo-32662: Implement Server.start_serving(), Server.serve_forever(), and Server.is_serving() methods. Add ‘start_serving’ keyword parameter to loop.create_server() and loop.create_unix_server().
  • bpo-32391: Implement asyncio.StreamWriter.wait_closed() and asyncio.StreamWriter.is_closing() methods:
  • bpo-32643: Make Task._step, Task._wakeup and Future._schedule_callbacks methods private.
  • bpo-32630: Refactor decimal module to use contextvars to store decimal context.
  • bpo-32622: Add asyncio.AbstractEventLoop.sendfile() method.
  • bpo-32304: distutils’ upload command no longer corrupts tar files ending with a CR byte, and no longer tries to convert CR to CRLF in any of the upload text fields.
  • bpo-32502: uuid.uuid1 no longer raises an exception if a 64-bit hardware address is encountered.
  • bpo-32596: concurrent.futures imports ThreadPoolExecutor and ProcessPoolExecutor lazily (using PEP 562). It makes import asyncio about 15% faster because asyncio uses only ThreadPoolExecutor by default.
  • bpo-31801: Add _ignore_ to Enum so temporary variables can be used during class construction without being turned into members.
  • bpo-32576: Use queue.SimpleQueue() in places where it can be invoked from a weakref callback.
  • bpo-32574: Fix memory leak in asyncio.Queue, when the queue has limited size and it is full, the cancelation of queue.put() can cause a memory leak. Patch by: José Melero.
  • bpo-32521: The nis module is now compatible with new libnsl and headers location.
  • bpo-32467: collections.abc.ValuesView now inherits from collections.abc.Collection.
  • bpo-32473: Improve ABCMeta._dump_registry() output readability:
  • bpo-32102: New argument capture_output for subprocess.run:
  • bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and library in nis module.
  • bpo-32493: UUID module fixes build for FreeBSD/OpenBSD:
  • bpo-32503: Pickling with protocol 4 no longer creates too small frames.
  • bpo-29237: Create enum for pstats sorting options:
  • bpo-32454: Add close(fd) function to the socket module.
  • bpo-25942: The subprocess module is now more graceful when handling a Ctrl-C KeyboardInterrupt during subprocess.call, subprocess.run, or a Popen context manager. It now waits a short amount of time for the child (presumed to have also gotten the SIGINT) to exit, before continuing the KeyboardInterrupt exception handling. This still includes a SIGKILL in the call() and run() APIs, but at least the child had a chance first.
  • bpo-32433: The hmac module now has hmac.digest(), which provides an optimized HMAC digest.
  • bpo-28134: Sockets now auto-detect family, type and protocol from file descriptor by default.
  • bpo-32404: Fix bug where datetime.datetime.fromtimestamp() did not call __new__ in datetime.datetime subclasses.
  • bpo-32403: Improved speed of datetime.date and datetime.datetime alternate constructors.
  • bpo-32228: Ensure that truncate() preserves the file position (as reported by tell()) after writes longer than the buffer size.
  • bpo-32410: Implement loop.sock_sendfile for asyncio event loop.
  • bpo-22908: Added seek and tell to the ZipExtFile class. This only works if the file object used to open the zipfile is seekable.
  • bpo-32373: Add socket.getblocking() method.
  • bpo-32248: Add importlib.resources and importlib.abc.ResourceReader as the unified API for reading resources contained within packages. Loaders wishing to support resource reading must implement the get_resource_reader() method. File- based and zipimport-based loaders both implement these APIs. importlib.abc.ResourceLoader is deprecated in favor of these new APIs.
  • bpo-32320: collections.namedtuple() now supports default values.
  • bpo-29302: Add contextlib.AsyncExitStack. Patch by Alexander Mohr and Ilya Kulakov.
  • bpo-31961: The args argument of subprocess.Popen can now be a path-like object. If args is given as a sequence, it’s first element can now be a path-like object as well.
  • bpo-31900: The locale.localeconv() function now sets temporarily the LC_CTYPE locale to the LC_NUMERIC locale to decode decimal_point and thousands_sep byte strings if they are non-ASCII or longer than 1 byte, and the LC_NUMERIC locale is different than the LC_CTYPE locale. This temporary change affects other threads.
  • Same change for the str.format() method when formatting a number (int, float, float and subclasses) with the n type (ex: '{:n}'.format(1234)).
  • bpo-31853: Use super().method instead of socket.method in SSLSocket. They were there most likely for legacy reasons.
  • bpo-31399: The ssl module now uses OpenSSL’s X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. Subject common name fallback can be disabled with SSLContext.hostname_checks_common_name.
  • bpo-14976: Add a queue.SimpleQueue class, an unbounded FIFO queue with a reentrant C implementation of put().
  • Documentation:
  • bpo-32724: Add references to some commands in the documentation of Pdb. Patch by Stéphane Wirtel
  • bpo-32649: Complete the C API documentation, profiling and tracing part with the newly added per-opcode events.
  • bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile and their C-API counterparts regarding which type of events are received in each function. Patch by Pablo Galindo Salgado.
  • Tests:
  • bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built.
  • bpo-28414: Add test cases for IDNA 2003 and 2008 host names. IDNA 2003 internationalized host names are working since bpo-31399 has landed. IDNA 2008 are still broken.
  • bpo-32604: Add a new “_xxsubinterpreters” extension module that exposes the existing subinterpreter C-API and a new cross-interpreter data sharing mechanism. The module is primarily intended for more thorough testing of the existing subinterpreter support.
  • bpo-32602: Add test certs and test for ECDSA cert and EC/RSA dual mode.
  • bpo-32549: On Travis CI, Python now Compiles and uses a local copy of OpenSSL 1.1.0g for testing.
  • Build:
  • bpo-32635: Fix segfault of the crypt module when libxcrypt is provided instead of libcrypt at the system.
  • bpo-32598: Use autoconf to detect OpenSSL libs, headers and supported features. The ax_check_openssl M4 macro uses pkg-config to locate OpenSSL and falls back to manual search.
  • bpo-32593: Drop support of FreeBSD 9 and older.
  • bpo-29708: If the SOURCE_DATE_EPOCH environment variable is set, py_compile will always create hash-based .pyc files.
  • macOS:
  • bpo-32726: Provide an additional, more modern macOS installer variant that supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied third-party libraries to OpenSSL 1.1.0g and to SQLite 3.22.0. The 10.9+ installer now links with and supplies its own copy of Tcl/Tk 8.6.
  • bpo-28440: No longer add /Library/Python/3.x/site-packages to sys.path for macOS framework builds to avoid future conflicts.
  • C API:
  • bpo-32681: Fix uninitialized variable ‘res’ in the C implementation of os.dup2. Patch by Stéphane Wirtel
  • bpo-10381: Add C API access to the datetime.timezone constructor and datetime.timzone.UTC singleton.

New in Python 3.7.0 Alpha 4 (Jan 10, 2018)

  • Core and Builtins:
  • bpo-31975: The default warning filter list now starts with a “default::DeprecationWarning:__main__” entry, so deprecation warnings are once again shown by default in single-file scripts and at the interactive prompt.
  • bpo-32226: __class_getitem__ is now an automatic class method.
  • bpo-32399: Add AIX uuid library support for RFC4122 using uuid_create() in libc.a
  • bpo-32390: Fix the compilation failure on AIX after the f_fsid field has been added to the object returned by os.statvfs() (bpo-32143). Original patch by Michael Felt.
  • bpo-32379: Make MRO computation faster when a class inherits from a single base.
  • bpo-32259: The error message of a TypeError raised when unpack non- iterable is now more specific.
  • bpo-27169: The __debug__ constant is now optimized out at compile time. This fixes also bpo-22091.
  • bpo-32329: The -R option now turns on hash randomization when the PYTHONHASHSEED environment variable is set to 0. Previously, the option was ignored. Moreover, sys.flags.hash_randomization is now properly set to 0 when hash randomization is turned off by PYTHONHASHSEED=0.
  • bpo-30416: The optimizer is now protected from spending much time doing complex calculations and consuming much memory for creating large constants in constant folding. Increased limits for constants that can be produced in constant folding.
  • bpo-32282: Fix an unnecessary ifdef in the include of VersionHelpers.h in socketmodule on Windows.
  • bpo-30579: Implement TracebackType.__new__ to allow Python-level creation of traceback objects, and make TracebackType.tb_next mutable.
  • bpo-32260: Don’t byte swap the input keys to the SipHash algorithm on big- endian platforms. This should ensure siphash gives consistent results across platforms.
  • bpo-31506: Improve the error message logic for object.__new__ and object.__init__. Patch by Sanyam Khurana.
  • bpo-20361: -b and -bb now inject 'default::BytesWarning' and error::BytesWarning entries into sys.warnoptions, ensuring that they take precedence over any other warning filters configured via the -W option or the PYTHONWARNINGS environment variable.
  • bpo-32230: -X dev now injects a 'default' entry into sys.warnoptions, ensuring that it behaves identically to actually passing -Wdefault at the command line.
  • bpo-29240: Add a new UTF-8 mode: implementation of the PEP 540.
  • bpo-32226: PEP 560: Add support for __mro_entries__ and __class_getitem__. Implemented by Ivan Levkivskyi.
  • bpo-32225: PEP 562: Add support for module __getattr__ and __dir__. Implemented by Ivan Levkivskyi.
  • bpo-31901: The atexit module now has its callback stored per interpreter.
  • bpo-31650: Implement PEP 552 (Deterministic pycs). Python now supports invalidating bytecode cache files bashed on a source content hash rather than source last-modified time.
  • bpo-29469: Move constant folding from bytecode layer to AST layer. Original patch by Eugene Toder.
  • Library:
  • bpo-32506: Now that dict is defined as keeping insertion order, drop OrderedDict and just use plain dict.
  • bpo-32279: Add params to dataclasses.make_dataclasses(): init, repr, eq, order, hash, and frozen. Pass them through to dataclass().
  • bpo-32278: Make type information optional on dataclasses.make_dataclass(). If omitted, the string ‘typing.Any’ is used.
  • bpo-32499: Add dataclasses.is_dataclass(obj), which returns True if obj is a dataclass or an instance of one.
  • bpo-32468: Improve frame repr() to mention filename, code name and current line number.
  • bpo-23749: asyncio: Implement loop.start_tls()
  • bpo-32441: Return the new file descriptor (i.e., the second argument) from os.dup2. Previously, None was always returned.
  • bpo-32422: functools.lru_cache uses less memory (3 words for each cached key) and takes about 1/3 time for cyclic GC.
  • bpo-31721: Prevent Python crash from happening when Future._log_traceback is set to True manually. Now it can only be set to False, or a ValueError is raised.
  • bpo-32415: asyncio: Add Task.get_loop() and Future.get_loop()
  • bpo-26133: Don’t unsubscribe signals in asyncio UNIX event loop on interpreter shutdown.
  • bpo-32363: Make asyncio.Task.set_exception() and set_result() raise NotImplementedError. Task._step() and Future.__await__() raise proper exceptions when they are in an invalid state, instead of raising an AssertionError.
  • bpo-32357: Optimize asyncio.iscoroutine() and loop.create_task() for non- native coroutines (e.g. async/await compiled with Cython).
  • ‘loop.create_task(python_coroutine)’ used to be 20% faster than ‘loop.create_task(cython_coroutine)’. Now, the latter is as fast.
  • bpo-32356: asyncio.transport.resume_reading() and pause_reading() are now idempotent. New transport.is_reading() method is added.
  • bpo-32355: Optimize asyncio.gather(); now up to 15% faster.
  • bpo-32351: Use fastpath in asyncio.sleep if delay

New in Python 3.6.4 (Dec 19, 2017)

  • There were no new code changes in version 3.6.4 since v3.6.4rc1.

New in Python 3.7.0 Alpha 2 (Oct 17, 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(). Patch by Oren Milman.
  • bpo-31592: Fixed an assertion failure in Python parser in case of a bad unicodedata.normalize(). Patch by Oren Milman.
  • bpo-31588: Raise a TypeError with a helpful error message when class creation fails due to a metaclass with a bad __prepare__() method. Patch by Oren Milman.
  • 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. Patch by Oren Milman.
  • 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. Patch by Oren Milman.
  • 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. Patch by Oren Milman.
  • bpo-31478: Fix an assertion failure in _random.Random.seed() in case the argument has a bad __abs__() method. Patch by Oren Milman.
  • bpo-31336: Speed up class creation by 10-20% by reducing the overhead in the necessary special method lookups. Patch by Stefan Behnel.
  • 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. Based on a patch from Armin Rigo.
  • bpo-31315: Fix an assertion failure in imp.create_dynamic(), when spec.name is not a string. Patch by Oren Milman.
  • bpo-31311: Fix a crash in the __setstate__() method of ctypes._CData, in case of a bad __dict__. Patch by Oren Milman.
  • bpo-31293: Fix crashes in true division and multiplication of a timedelta object by a float with a bad as_integer_ratio() method. Patch by Oren Milman.
  • 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. Patch by Oren Milman.
  • 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. Patch by Oren Milman.
  • 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.
  • 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

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)

  • Major new features:
  • PEP 468, Preserving Keyword Argument Order
  • PEP 487, Simpler customization 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
  • PEP 529, Change Windows filesystem encoding to UTF-8
  • PEP 530, Asynchronous Comprehensions
  • Further details on this release are available at https://docs.python.org/3.7/whatsnew/changelog.html#python-3-7-0-alpha-1.

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 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 Łukasz 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_sslbpo-31346: Prefer PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER protocols for SSLContext.bpo-25674: Remove sha256.tbs-internet.com ssl testbpo-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 _testembedbpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line arguments.bpo-28683: Fix the tests that bind() a unix socket and raise PermissionError on Android for a non-root user.bpo-26936: Fix the test_socket failures on Android - getservbyname(), getservbyport() and getaddrinfo() are broken on some Android API levels.bpo-28666: Now test.support.rmtree is able to remove unwritable or unreadable directories.bpo-23839: Various caches now are cleared before running every test file.bpo-26944: Fix test_posix for Android where ‘id -G’ is entirely wrong or missing the effective gid.bpo-28409: regrtest: fix the parser of command line arguments.bpo-28217: Adds _testconsole module to test console input.bpo-26939: Add the support.setswitchinterval() function to fix test_functools hanging on the Android armv7 qemu emulator.
  • Build:
  • bpo-31354: Allow –with-lto to be used on all builds, not just make profile-opt.
  • bpo-31370: Remove support for building –without-threads.
  • This option is not really useful anymore in the 21st century. Removing lots of conditional paths allows us to simplify the code base, including in difficult to maintain low-level internal code.
  • bpo-31341: Per PEP 11, support for the IRIX operating system was removed.
  • bpo-30854: Fix compile error when compiling –without-threads. Patch by Masayuki Yamamoto.
  • bpo-30687: Locate msbuild.exe on Windows when building rather than vcvarsall.bat
  • bpo-20210: Support the disabled marker in Setup files. Extension modules listed after this marker are not built at all, neither by the Makefile nor by setup.py.
  • 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

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

  • Major new features:
  • PEP 468, Preserving Keyword Argument Order
  • PEP 487, Simpler customization 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
  • PEP 529, Change Windows filesystem encoding to UTF-8
  • PEP 530, Asynchronous Comprehensions

New in Python 3.6.2 (Jul 17, 2017)

  • No changes since release candidate 2.

New in Python 3.6.2 RC 2 (Jul 10, 2017)

  • PEP 468, Preserving Keyword Argument Order
  • PEP 487, Simpler customization 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
  • PEP 529, Change Windows filesystem encoding to UTF-8
  • PEP 530, Asynchronous Comprehensions

New in Python 3.6.2 RC 1 (Jun 19, 2017)

  • Major new features:
  • PEP 468, Preserving Keyword Argument Order
  • PEP 487, Simpler customization 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
  • PEP 529, Change Windows filesystem encoding to UTF-8
  • PEP 530, Asynchronous Comprehensions

New in Python 3.6.1 (Mar 22, 2017)

  • Core and Built-ins:
  • 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.
  • Build:
  • bpo-27593: fix format of git information used in sys.version
  • Fix incompatible comment in python.h

New in Python 3.6.1 RC 1 (Mar 5, 2017)

  • Core and Builtins:
  • bpo-28893: Set correct __cause__ for errors about invalid awaitables returned from __aiter__ and __anext__.
  • 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-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k.
  • 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-29438: Fixed use-after-free problem in key sharing dict.
  • 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-28932: Do not include 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-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-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-28731: Optimize _PyDict_NewPresized() to create correct size dict. Improve speed of dict literal with constant keys up to 30%.
  • Extension Modules:
  • bpo-29169: Update zlib to 1.2.11.
  • Library:
  • bpo-29623: Allow use of path-like object as a single argument in ConfigParser.read(). Patch by David Ellis.
  • 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-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-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-28556: Various updates to typing module: typing.Counter, typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa.
  • bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python 3.6.0: check minimum and maximum years.
  • bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when used with a rare combination of multiprocessing and custom codecs.
  • 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-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-29316: Restore the provisional status of typing module, add corresponding note to documentation. Patch by Ivan L.
  • bpo-29219: Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances.
  • bpo-29011: Fix an important omission by adding Deque to the typing module.
  • 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-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-29203: functools.lru_cache() now respects PEP 468 and preserves the order of keyword arguments. f(a=1, b=2) is now cached separately from f(b=2, a=1) since both calls could potentially give different results.
  • bpo-15812: inspect.getframeinfo() now correctly shows the first line of a context. Patch by Sam Breese.
  • bpo-29094: Offsets in a ZIP file created with extern file object and modes “w” and “x” now are relative to the start of the file.
  • bpo-29085: Allow random.Random.seed() to use high quality OS randomness rather than the pid and time.
  • bpo-29061: Fixed bug in secrets.randbelow() which would hang when given a negative input. Patch by Brendan Donegan.
  • 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-29119: Fix weakrefs in the pure python version of collections.OrderedDict move_to_end() method. Contributed by Andra Bogildea.
  • 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.
  • Issue 28923: Remove editor artifacts from Tix.py.
  • bpo-29055: Neaten-up empty population error on random.choice() by suppressing the upstream exception.
  • 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-28779: multiprocessing.set_forkserver_preload() would crash the forkserver process if a preloaded module instantiated some multiprocessing objects such as locks.
  • bpo-28847: dbm.dumb now supports reading read-only files and no longer writes the index file when it is not changed.
  • 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.
  • C API:
  • bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if Py_LIMITED_API is not set or set to the value between 0x03050400 and 0x03060000 (not including) or 0x03060100 or higher.
  • bpo-29083: Fixed the declaration of some public API functions. PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and Py_BuildValue() were not available in limited API of version < 3.3 when PY_SSIZE_T_CLEAN is defined.
  • bpo-29058: All stable API extensions added after Python 3.2 are now available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of the minimum Python version supporting this API.
  • Documentation:
  • 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.
  • Tests:
  • bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip some tests of select.poll when running on macOS due to unresolved issues with the underlying system poll function on some macOS versions.
  • bpo-29571: to match the behaviour of the re.LOCALE flag, test_re.test_locale_flag now uses locale.getpreferredencoding(False) to determine the candidate encoding for the test regex (allowing it to correctly skip the test when the default locale encoding is a multi-byte encoding)
  • bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line arguments.
  • bpo-28683: Fix the tests that bind() a unix socket and raise PermissionError on Android for a non-root user.
  • bpo-26939: Add the support.setswitchinterval() function to fix test_functools hanging on the Android armv7 qemu emulator.
  • Build:
  • bpo-27593: sys.version and the platform module python_build(), python_branch(), and python_revision() functions now use git information rather than hg when building from a repo.
  • bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k.
  • bpo-26851: Set Android compilation and link flags.
  • bpo-28768: Fix implicit declaration of function _setmode. Patch by Masayuki Yamamoto
  • bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat
  • bpo-23903: Added missed names to PC/python3.def.
  • bpo-28762: lockf() is available on Android API level 24, but the F_LOCK macro is not defined in android-ndk-r13.
  • bpo-28538: Fix the compilation error that occurs because if_nameindex() is available on Android API level 24, but the if_nameindex structure is not defined.
  • bpo-20211: Do not add the directory for installing C header files and the directory for installing object code libraries to the cross compilation search paths. Original patch by Thomas Petazzoni.
  • bpo-28849: Do not define sys.implementation._multiarch on Android.

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.
  • 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 RC 2 (Dec 17, 2016)

  • Core and Built-ins:
  • Issue #28147: Fix a memory leak in split-table dictionaries: setattr() must not convert combined table into split table. Patch written by INADA Naoki.
  • Issue #28990: Fix asynchio SSL hanging if connection is closed before handshake is completed. (Patch by HoHo-Ho)
  • Tools/Demos:
  • Issue #28770: Fix python-gdb.py for fastcalls.
  • Build:
  • Issue #28898: Prevent gdb build errors due to HAVE_LONG_LONG redefinition.

New in Python 3.6.0 RC 1 (Dec 7, 2016)

  • Core and Built-ins:
  • Issue #23722: Rather than silently producing a class that doesn’t support zero-argument super() in methods, failing to pass the new __classcell__ namespace entry up to type.__new__ now results in a DeprecationWarning and a class that supports zero-argument super().
  • Issue #28797: Modifying the class __dict__ inside the __set_name__ method of a descriptor that is used inside that class no longer prevents calling the __set_name__ method of other descriptors.
  • Issue #28782: Fix a bug in the implementation yield from when checking if the next instruction is YIELD_FROM. Regression introduced by WORDCODE (issue #26647).
  • Library:
  • Issue #27030: Unknown escapes in re.sub() replacement template are allowed again. But they still are deprecated and will be disabled in 3.7.
  • Issue #28835: Fix a regression introduced in warnings.catch_warnings(): call warnings.showwarning() if it was overriden inside the context manager.
  • Issue #27172: To assist with upgrades from 2.7, the previously documented deprecation of inspect.getfullargspec() has been reversed. This decision may be revisited again after the Python 2.7 branch is no longer officially supported.
  • Issue #24142: Reading a corrupt config file left configparser in an invalid state. Original patch by Florian Höch.
  • Issue #28843: Fix asyncio C Task to handle exceptions __traceback__.
  • C API:
  • Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
  • Documentation:
  • Issue #23722: The data model reference and the porting section in the What’s New guide now cover the additional __classcell__ handling needed for custom metaclasses to fully support PEP 487 and zero-argument super().
  • Tools/Demos:
  • Issue #28023: Fix python-gdb.py didn’t support new dict implementation.

New in Python 3.6.0 Beta 4 (Nov 22, 2016)

  • Core and Built-ins:
  • Issue #28532: Show sys.version when -V option is supplied twice.
  • Issue #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.
  • Issue #28746: Fix the set_inheritable() file descriptor method on platforms that do not have the ioctl FIOCLEX and FIONCLEX commands.
  • Issue #26920: Fix not getting the locale’s charset upon initializing the interpreter, on platforms that do not have langinfo.
  • Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X when decode astral characters. Patch by Xiang Zhang.
  • Issue #19398: Extra slash no longer added to sys.path components in case of empty compile-time PYTHONPATH components.
  • Issue #28665: Improve speed of the STORE_DEREF opcode by 40%.
  • Issue #28583: PyDict_SetDefault didn’t combine split table when needed. Patch by Xiang Zhang.
  • Issue #27243: Change PendingDeprecationWarning -> DeprecationWarning. As it was agreed in the issue, __aiter__ returning an awaitable should result in PendingDeprecationWarning in 3.5 and in DeprecationWarning in 3.6.
  • Issue #26182: Fix a refleak in code that raises DeprecationWarning.
  • Issue #28721: Fix asynchronous generators aclose() and athrow() to handle StopAsyncIteration propagation properly.
  • Library:
  • Issue #28752: Restored the __reduce__() methods of datetime objects.
  • Issue #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 issue #18383: don’t duplicate warning filters when the warnings module is reloaded (thing usually only done in unit tests).
  • Issue #20572: The subprocess.Popen.wait method’s undocumented endtime parameter now raises a DeprecationWarning.
  • Issue #25659: In ctypes, prevent a crash calling the from_buffer() and from_buffer_copy() methods on abstract classes like Array.
  • Issue #19717: Makes Path.resolve() succeed on paths that do not exist. Patch by Vajrasky Kok
  • Issue #28563: Fixed possible DoS and arbitrary code execution when handle plural form selections in the gettext module. The expression parser now supports exact syntax supported by GNU gettext.
  • Issue #28387: Fixed possible crash in _io.TextIOWrapper deallocator when the garbage collector is invoked in other thread. Based on patch by Sebastian Cufre.
  • Issue #28600: Optimize loop.call_soon.
  • Issue #28613: Fix get_event_loop() return the current loop if called from coroutines/callbacks.
  • Issue #28634: Fix asyncio.isfuture() to support unittest.Mock.
  • Issue #26081: Fix refleak in _asyncio.Future.__iter__().throw.
  • Issue #28639: Fix inspect.isawaitable to always return bool Patch by Justin Mayfield.
  • Issue #28652: Make loop methods reject socket kinds they do not support.
  • Issue #28653: Fix a refleak in functools.lru_cache.
  • Issue #28703: Fix asyncio.iscoroutinefunction to handle Mock objects.
  • Issue #28704: Fix create_unix_server to support Path-like objects (PEP 519).
  • Issue #28720: Add collections.abc.AsyncGenerator.
  • Documentation:
  • Issue #28513: Documented command-line interface of zipfile.
  • Tests:
  • Issue #28666: Now test.support.rmtree is able to remove unwritable or unreadable directories.
  • Issue #23839: Various caches now are cleared before running every test file.
  • Build:
  • Issue #10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and Michael Haubenwallner.
  • Issue #26359: Rename –with-optimiations to –enable-optimizations.
  • Issue #28676: Prevent missing ‘getentropy’ declaration warning on macOS. Patch by Gareth Rees.

New in Python 3.6.0 Beta 3 (Nov 1, 2016)

  • Core and Builtins:
  • Issue #28128: Deprecation warning for invalid str and byte escape sequences now prints better information about where the error occurs. Patch by Serhiy Storchaka and Eric Smith.
  • Issue #28509: dict.update() no longer allocate unnecessary large memory.
  • Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug build.
  • Issue #28517: Fixed of-by-one error in the peephole optimizer that caused keeping unreachable code.
  • Issue #28214: Improved exception reporting for problematic __set_name__ attributes.
  • Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception loss in PyTraceBack_Here().
  • Issue #28471: Fix “Python memory allocator called without holding the GIL” crash in socket.setblocking.
  • Library:
  • Issue #27517: LZMA compressor and decompressor no longer raise exceptions if given empty data twice. Patch by Benjamin Fogle.
  • Issue #28549: Fixed segfault in curses’s addch() with ncurses6.
  • Issue #28449: tarfile.open() with mode “r” or “r:” now tries to open a tar file with compression before trying to open it without compression. Otherwise it had 50% chance failed with ignore_zeros=True.
  • Issue #23262: The webbrowser module now supports Firefox 36+ and derived browsers. Based on patch by Oleg Broytman.
  • Issue #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.
  • Issue #18844: The various ways of specifing weights for random.choices() now produce the same result sequences.
  • Issue #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.
  • Issue #20491: The textwrap.TextWrapper class now honors non-breaking spaces. Based on patch by Kaarle Ritvanen.
  • Issue #28353: os.fwalk() no longer fails on broken links.
  • Issue #28430: Fix iterator of C implemented asyncio.Future doesn’t accept non-None value is passed to it.send(val).
  • Issue #27025: Generated names for Tkinter widgets now start by the ”!” prefix for readability (was “`”).
  • Issue #25464: Fixed HList.header_exists() in tkinter.tix module by addin a workaround to Tix library bug.
  • Issue #28488: shutil.make_archive() no longer adds entry ”./” to ZIP archive.
  • Issue #25953: re.sub() now raises an error for invalid numerical group reference in replacement template even if the pattern is not found in the string. Error message for invalid group reference now includes the group index and the position of the reference. Based on patch by SilentGhost.
  • Issue #18219: Optimize csv.DictWriter for large number of columns. Patch by Mariatta Wijaya.
  • Issue #28448: Fix C implemented asyncio.Future didn’t work on Windows.
  • Issue #28480: Fix error building socket module when multithreading is disabled.
  • Issue #24452: Make webbrowser support Chrome on Mac OS X.
  • Issue #20766: Fix references leaked by pdb in the handling of SIGINT handlers.
  • Issue #28492: Fix how StopIteration exception is raised in _asyncio.Future.
  • Issue #28500: Fix asyncio to handle async gens GC from another thread.
  • Issue #26923: Fix asyncio.Gather to refuse being cancelled once all children are done. Patch by Johannes Ebke.
  • Issue #26796: Don’t configure the number of workers for default threadpool executor. Initial patch by Hans Lawrenz.
  • Issue #28544: Implement asyncio.Task in C.
  • Build:
  • Issue #28444: Fix missing extensions modules when cross compiling.
  • Issue #28208: Update Windows build and OS X installers to use SQLite 3.14.2.
  • Issue #28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
  • Tests:
  • Issue #26944: Fix test_posix for Android where ‘id -G’ is entirely wrong or missing the effective gid.
  • Issue #28409: regrtest: fix the parser of command line arguments.

New in Python 3.6.0 Beta 2 (Oct 11, 2016)

  • NEW SYNTAX FEATURES:
  • A global or nonlocal statement must now textually appear before the first use of the affected name in the same scope. Previously this was a SyntaxWarning.
  • 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
  • STANDARD LIBRARY IMPROVEMENTS:
  • Security improvements:
  • 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.
  • hashlib and ssl now support OpenSSL 1.1.0.
  • The default settings and feature set of the ssl have been improved.
  • The hashlib module has got support for BLAKE2, SHA-3 and SHAKE hash algorithms and scrypt() key derivation function.
  • New built-in features:
  • PEP 520: Preserving Class Attribute Definition Order
  • PEP 468: Preserving Keyword Argument Order
  • A complete list of PEP’s implemented in Python 3.6:
  • PEP 468, Preserving Keyword Argument Order
  • PEP 487, Simpler customization of class creation
  • PEP 495, Local Time Disambiguation
  • PEP 498, Formatted string literals
  • 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 Beta 1 (Sep 13, 2016)

  • Core and Builtins:
  • Issue #23722: The __class__ cell used by zero-argument super() is now initialized from type.__new__ rather than __build_class__, so class methods relying on that will now work correctly when called from metaclass methods during class creation. Patch by Martin Teichmann.
  • Issue #25221: Fix corrupted result from PyLong_FromLong(0) when Python is compiled with NSMALLPOSINTS = 0.
  • Issue #27080: Implement formatting support for PEP 515. Initial patch by Chris Angelico.
  • Issue #27199: In tarfile, expose copyfileobj bufsize to improve throughput. Patch by Jason Fried.
  • Issue #27948: In f-strings, only allow backslashes inside the braces (where the expressions are). This is a breaking change from the 3.6 alpha releases, where backslashes are allowed anywhere in an f-string. Also, require that expressions inside f-strings be enclosed within literal braces, and not escapes like f'x7b"hi"x7d'.
  • Issue #28046: Remove platform-specific directories from sys.path.
  • Issue #28071: Add early-out for differencing from an empty set.
  • Issue #25758: Prevents zipimport from unnecessarily encoding a filename (patch by Eryk Sun)
  • Issue #25856: The __module__ attribute of extension classes and functions now is interned. This leads to more compact pickle data with protocol 4.
  • Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more efficient bytecode. Patch by Demur Rumed, design by Serhiy Storchaka, reviewed by Serhiy Storchaka and Victor Stinner.
  • Issue #26331: Implement tokenizing support for PEP 515. Patch by Georg Brandl.
  • Issue #27999: Make "global after use" a SyntaxError, and ditto for nonlocal. Patch by Ivan Levkivskyi.
  • Issue #28003: Implement PEP 525 -- Asynchronous Generators.
  • Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations. Patch by Ivan Levkivskyi.
  • Issue #26058: Add a new private version to the builtin dict type, incremented at each dictionary creation and at each dictionary change. Implementation of the PEP 509.
  • Issue #27364: A backslash-character pair that is not a valid escape sequence now generates a DeprecationWarning. Patch by Emanuel Barry.
  • Issue #27350: `dict` implementation is changed like PyPy. It is more compact and preserves insertion order. (Concept developed by Raymond Hettinger and patch by Inada Naoki.)
  • Issue #27911: Remove unnecessary error checks in ``exec_builtin_or_dynamic()``.
  • Issue #27078: Added BUILD_STRING opcode. Optimized f-strings evaluation.
  • Issue #17884: Python now requires systems with inttypes.h and stdint.h
  • Issue #27961: Require platforms to support ``long long``. Python hasn't compiled without ``long long`` for years, so this is basically a formality.
  • Issue #27355: Removed support for Windows CE. It was never finished, and Windows CE is no longer a relevant platform for Python.
  • Implement PEP 523.
  • Issue #27870: A left shift of zero by a large integer no longer attempts to allocate large amounts of memory.
  • Issue #25402: In int-to-decimal-string conversion, improve the estimate of the intermediate memory required, and remove an unnecessarily strict overflow check. Patch by Serhiy Storchaka.
  • Issue #27214: In long_invert, be more careful about modifying object returned by long_add, and remove an unnecessary check for small longs. Thanks Oren Milman for analysis and patch.
  • Issue #27506: Support passing the bytes/bytearray.translate() "delete" argument by keyword.
  • Issue #27812: Properly clear out a generator's frame's backreference to the generator to prevent crashes in frame.clear().
  • Issue #27811: Fix a crash when a coroutine that has not been awaited is finalized with warnings-as-errors enabled.
  • Issue #27587: Fix another issue found by PVS-Studio: Null pointer check after use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes.
  • Issue #27792: The modulo operation applied to ``bool`` and other ``int`` subclasses now always returns an ``int``. Previously the return type depended on the input values. Patch by Xiang Zhang.
  • Issue #26984: int() now always returns an instance of exact int.
  • Issue #25604: Fix a minor bug in integer true division; this bug could potentially have caused off-by-one-ulp results on platforms with unreliable ldexp implementations.
  • Issue #24254: Make class definition namespace ordered by default.
  • Issue #27662: Fix an overflow check in ``List_New``: the original code was checking against ``Py_SIZE_MAX`` instead of the correct upper bound of ``Py_SSIZE_T_MAX``. Patch by Xiang Zhang.
  • Issue #27782: Multi-phase extension module import now correctly allows the ``m_methods`` field to be used to add module level functions to instances of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
  • Issue #27936: The round() function accepted a second None argument for some types but not for others. Fixed the inconsistency by accepting None for all numeric types.
  • Issue #27487: Warn if a submodule argument to "python -m" or runpy.run_module() is found in sys.modules after parent packages are imported, but before the submodule is executed.
  • Issue #27157: Make only type() itself accept the one-argument form. Patch by Eryk Sun and Emanuel Barry.
  • Issue #27558: Fix a SystemError in the implementation of "raise" statement. In a brand new thread, raise a RuntimeError since there is no active exception to reraise. Patch written by Xiang Zhang.
  • Issue #28008: Implement PEP 530 -- asynchronous comprehensions.
  • Library:
  • Issue #28037: Use sqlite3_get_autocommit() instead of setting Connection->inTransaction manually.
  • Issue #25283: Attributes tm_gmtoff and tm_zone are now available on all platforms in the return values of time.localtime() and time.gmtime().
  • Issue #24454: Regular expression match object groups are now accessible using __getitem__. "mo[x]" is equivalent to "mo.group(x)".
  • Issue #10740: sqlite3 no longer implicitly commit an open transaction before DDL statements.
  • Issue #17941: Add a *module* parameter to collections.namedtuple().
  • Issue #22493: Inline flags now should be used only at the start of the regular expression. Deprecation warning is emitted if uses them in the middle of the regular expression.
  • Issue #26885: xmlrpc now supports unmarshalling additional data types used by Apache XML-RPC implementation for numerics and None.
  • Issue #28070: Fixed parsing inline verbose flag in regular expressions.
  • Issue #19500: Add client-side SSL session resumption to the ssl module.
  • Issue #28022: Deprecate ssl-related arguments in favor of SSLContext. The deprecation include manual creation of SSLSocket and certfile/keyfile (or similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib.
  • Issue #28043: SSLContext has improved default settings: OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_COMPRESSION, OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE, OP_SINGLE_ECDH_USE and HIGH ciphers without MD5.
  • Issue #24693: Changed some RuntimeError's in the zipfile module to more appropriate types. Improved some error messages and debugging output.
  • Issue #17909: ``json.load`` and ``json.loads`` now support binary input encoded as UTF-8, UTF-16 or UTF-32. Patch by Serhiy Storchaka.
  • Issue #27137: the pure Python fallback implementation of ``functools.partial`` now matches the behaviour of its accelerated C counterpart for subclassing, pickling and text representation purposes. Patch by Emanuel Barry and Serhiy Storchaka.
  • Issue #28019: itertools.count() no longer rounds non-integer step in range between 1.0 and 2.0 to 1.
  • Issue #18401: Pdb now supports the 'readrc' keyword argument to control whether .pdbrc files should be read. Patch by Martin Matusiak and Sam Kimbrel.
  • Issue #25969: Update the lib2to3 grammar to handle the unpacking generalizations added in 3.5.
  • Issue #14977: mailcap now respects the order of the lines in the mailcap files ("first match"), as required by RFC 1542. Patch by Michael Lazar.
  • Issue #28025: Convert all ssl module constants to IntEnum and IntFlags. SSLContext properties now return flags and enums.
  • Issue #433028: Added support of modifier spans in regular expressions.
  • Issue #24594: Validates persist parameter when opening MSI database
  • Issue #17582: xml.etree.ElementTree nows preserves whitespaces in attributes (Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.)
  • Issue #28047: Fixed calculation of line length used for the base64 CTE in the new email policies.
  • Issue #27576: Fix call order in OrderedDict.__init__().
  • email.generator.DecodedGenerator now supports the policy keyword.
  • Issue #28027: Remove undocumented modules from ``Lib/plat-*``: IN, CDROM, DLFCN, TYPES, CDIO, and STROPTS.
  • Issue #27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by Claude Paroz.
  • Issue #24277: The new email API is no longer provisional, and the docs have been reorganized and rewritten to emphasize the new API.
  • Issue #22450: urllib now includes an "Accept: */*" header among the default headers. This makes the results of REST API requests more consistent and predictable especially when proxy servers are involved.
  • lib2to3.pgen3.driver.load_grammar() now creates a stable cache file between runs given the same Grammar.txt input regardless of the hash randomization setting.
  • Issue #28005: Allow ImportErrors in encoding implementation to propagate.
  • Issue #26667: Support path-like objects in importlib.util.
  • Issue #27570: Avoid zero-length memcpy() etc calls with null source pointers in the "ctypes" and "array" modules.
  • Issue #22233: Break email header lines *only* on the RFC specified CR and LF characters, not on arbitrary unicode line breaks. This also fixes a bug in HTTP header parsing.
  • Issue 27331: The email.mime classes now all accept an optional policy keyword.
  • Issue 27988: Fix email iter_attachments incorrect mutation of payload list.
  • Issue #16113: Add SHA-3 and SHAKE support to hashlib module.
  • Eliminate a tautological-pointer-compare warning in _scproxy.c.
  • Issue #27776: The :func:`os.urandom` function does now block on Linux 3.17 and newer until the system urandom entropy pool is initialized to increase the security. This change is part of the :pep:`524`.
  • Issue #27778: Expose the Linux ``getrandom()`` syscall as a new :func:`os.getrandom` function. This change is part of the :pep:`524`.
  • Issue #27691: Fix ssl module's parsing of GEN_RID subject alternative name fields in X.509 certs.
  • Issue #18844: Add random.choices().
  • Issue #25761: Improved error reporting about truncated pickle data in C implementation of unpickler. UnpicklingError is now raised instead of AttributeError and ValueError in some cases.
  • Issue #26798: Add BLAKE2 (blake2b and blake2s) to hashlib.
  • Issue #26032: Optimized globbing in pathlib by using os.scandir(); it is now about 1.5--4 times faster.
  • Issue #25596: Optimized glob() and iglob() functions in the glob module; they are now about 3--6 times faster.
  • Issue #27928: Add scrypt (password-based key derivation function) to hashlib module (requires OpenSSL 1.1.0).
  • Issue #27850: Remove 3DES from ssl module's default cipher list to counter measure sweet32 attack (CVE-2016-2183).
  • Issue #27766: Add ChaCha20 Poly1305 to ssl module's default ciper list. (Required OpenSSL 1.1.0 or LibreSSL).
  • Issue #25387: Check return value of winsound.MessageBeep.
  • Issue #27866: Add SSLContext.get_ciphers() method to get a list of all enabled ciphers.
  • Issue #27744: Add AF_ALG (Linux Kernel crypto) to socket module.
  • Issue #26470: Port ssl and hashlib module to OpenSSL 1.1.0.
  • Issue #11620: Fix support for SND_MEMORY in winsound.PlaySound. Based on a patch by Tim Lesher.
  • Issue #11734: Add support for IEEE 754 half-precision floats to the struct module. Based on a patch by Eli Stevens.
  • Issue #27919: Deprecated ``extra_path`` distribution option in distutils packaging.
  • Issue #23229: Add new ``cmath`` constants: ``cmath.inf`` and ``cmath.nan`` to match ``math.inf`` and ``math.nan``, and also ``cmath.infj`` and ``cmath.nanj`` to match the format used by complex repr.
  • Issue #27842: The csv.DictReader now returns rows of type OrderedDict. (Contributed by Steve Holden.)
  • Remove support for passing a file descriptor to os.access. It never worked but previously didn't raise.
  • Issue #12885: Fix error when distutils encounters symlink.
  • Issue #27881: Fixed possible bugs when setting sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang.
  • Issue #27861: Fixed a crash in sqlite3.Connection.cursor() when a factory creates not a cursor. Patch by Xiang Zhang.
  • Issue #19884: Avoid spurious output on OS X with Gnu Readline.
  • Issue #27706: Restore deterministic behavior of random.Random().seed() for string seeds using seeding version 1. Allows sequences of calls to random() to exactly match those obtained in Python 2. Patch by Nofar Schnider.
  • Issue #10513: Fix a regression in Connection.commit(). Statements should not be reset after a commit.
  • Issue #12319: Chunked transfer encoding support added to http.client.HTTPConnection requests. The urllib.request.AbstractHTTPHandler class does not enforce a Content-Length header any more. If a HTTP request has a file or iterable body, but no Content-Length header, the library now falls back to use chunked transfer- encoding.
  • A new version of typing.py from https://github.com/python/typing: - Collection (only for 3.6) (Issue #27598) - Add FrozenSet to __all__ (upstream #261) - fix crash in _get_type_vars() (upstream #259) - Remove the dict constraint in ForwardRef._eval_type (upstream #252)
  • Issue #27832: Make ``_normalize`` parameter to ``Fraction`` constuctor keyword-only, so that ``Fraction(2, 3, 4)`` now raises ``TypeError``.
  • Issue #27539: Fix unnormalised ``Fraction.__pow__`` result in the case of negative exponent and negative base.
  • Issue #21718: cursor.description is now available for queries using CTEs.
  • Issue #27819: In distutils sdists, simply produce the "gztar" (gzipped tar format) distributions on all platforms unless "formats" is supplied.
  • Issue #2466: posixpath.ismount now correctly recognizes mount points which the user does not have permission to access.
  • Issue #9998: On Linux, ctypes.util.find_library now looks in LD_LIBRARY_PATH for shared libraries.
  • Issue #27573: exit message for code.interact is now configurable.
  • Issue #27930: Improved behaviour of logging.handlers.QueueListener. Thanks to Paulo Andrade and Petr Viktorin for the analysis and patch.
  • Issue #6766: Distributed reference counting added to multiprocessing to support nesting of shared values / proxy objects.
  • Issue #21201: Improves readability of multiprocessing error message. Thanks to Wojciech Walczak for patch.
  • asyncio: Add set_protocol / get_protocol to Transports.
  • Issue #27456: asyncio: Set TCP_NODELAY by default.
  • IDLE:
  • Issue #15308: Add 'interrupt execution' (^C) to Shell menu. Patch by Roger Serwy, updated by Bayard Randel.
  • Issue #27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
  • Issue #27891: Consistently group and sort imports within idlelib modules.
  • Issue #17642: add larger font sizes for classroom projection.
  • Add version to title of IDLE help window.
  • Issue #25564: In section on IDLE -- console differences, mention that using exec means that __builtins__ is defined for each statement.
  • Issue #27821: Fix 3.6.0a3 regression that prevented custom key sets from being selected when no custom theme was defined.
  • C API:
  • Issue #26900: Excluded underscored names and other private API from limited API.
  • Issue #26027: Add support for path-like objects in PyUnicode_FSConverter() & PyUnicode_FSDecoder().
  • Tests:
  • Issue #27427: Additional tests for the math module. Patch by Francisco Couzo.
  • Issue #27953: Skip math and cmath tests that fail on OS X 10.4 due to a poor libm implementation of tan.
  • Issue #26040: Improve test_math and test_cmath coverage and rigour. Patch by Jeff Allen.
  • Issue #27787: Call gc.collect() before checking each test for "dangling threads", since the dangling threads are weak references.
  • Build:
  • Issue #27566: Fix clean target in freeze makefile (patch by Lisa Roach)
  • Issue #27705: Update message in validate_ucrtbase.py
  • Issue #27976: Deprecate building _ctypes with the bundled copy of libffi on non-OSX UNIX platforms.
  • Issue #27983: Cause lack of llvm-profdata tool when using clang as required for PGO linking to be a configure time error rather than make time when --with-optimizations is enabled. Also improve our ability to find the llvm-profdata tool on MacOS and some Linuxes.
  • Issue #21590: Support for DTrace and SystemTap probes.
  • Issue #26307: The profile-opt build now applys PGO to the built-in modules.
  • Issue #26539: Add the --with-optimizations flag to turn on LTO and PGO build support when available.
  • Issue #27917: Set platform triplets for Android builds.
  • Issue #25825: Update references to the $(LIBPL) installation path on AIX. This path was changed in 3.2a4.
  • Update OS X installer to use SQLite 3.14.1 and XZ 5.2.2.
  • Issue #21122: Fix LTO builds on OS X.
  • Issue #17128: Build OS X installer with a private copy of OpenSSL. Also provide a sample Install Certificates command script to install a set of root certificates from the third-party certifi module.
  • Tools/Demos:
  • Issue #27952: Get Tools/scripts/fixcid.py working with Python 3 and the current "re" module, avoid invalid Python backslash escapes, and fix a bug parsing escaped C quote signs.

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)

  • Core and Built-ins:
  • Issue #27473: Fixed possible integer overflow in bytes and bytearray concatenations. Patch by Xiang Zhang.
  • Issue #23034: The output of a special Python build with defined COUNT_ALLOCS, SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by default. It can be re-enabled using the “-X showalloccount” option. It now outputs to stderr instead of stdout.
  • Issue #27443: __length_hint__() of bytearray iterators no longer return a negative integer for a resized bytearray.
  • Issue #27007: The fromhex() class methods of bytes and bytearray subclasses now return an instance of corresponding subclass.
  • Library:
  • Issue #23804: Fix SSL zero-length recv() calls to not block and not raise an error about unclean EOF.
  • Issue #27466: Change time format returned by http.cookie.time2netscape, confirming the netscape cookie format and making it consistent with documentation.
  • Issue #21708: Deprecated dbm.dumb behavior that differs from common dbm behavior: creating a database in ‘r’ and ‘w’ modes and modifying a database in ‘r’ mode.
  • Issue #26721: Change the socketserver.StreamRequestHandler.wfile attribute to implement BufferedIOBase. In particular, the write() method no longer does partial writes.
  • Issue #22115: Added methods trace_add, trace_remove and trace_info in the tkinter.Variable class. They replace old methods trace_variable, trace, trace_vdelete and trace_vinfo that use obsolete Tcl commands and might not work in future versions of Tcl. Fixed old tracing methods: trace_vdelete() with wrong mode no longer break tracing, trace_vinfo() now always returns a list of pairs of strings, tracing in the “u” mode now works.
  • Issue #26243: Only the level argument to zlib.compress() is keyword argument now. The first argument is positional-only.
  • Issue #27038: Expose the DirEntry type as os.DirEntry. Code patch by Jelle Zijlstra.
  • Issue #27186: Update os.fspath()/PyOS_FSPath() to check the return value of __fspath__() to be either str or bytes.
  • Issue #18726: All optional parameters of the dump(), dumps(), load() and loads() functions and JSONEncoder and JSONDecoder class constructors in the json module are now keyword-only.
  • Issue #27319: Methods selection_set(), selection_add(), selection_remove() and selection_toggle() of ttk.TreeView now allow passing multiple items as multiple arguments instead of passing them as a tuple. Deprecated undocumented ability of calling the selection() method with arguments.
  • Issue #27079: Fixed curses.ascii functions isblank(), iscntrl() and ispunct().
  • Issue #27294: Numerical state in the repr for Tkinter event objects is now represented as a compination of known flags.
  • Issue #27177: Match objects in the re module now support index-like objects as group indices. Based on patches by Jeroen Demeyer and Xiang Zhang.
  • Issue #26754: Some functions (compile() etc) accepted a filename argument encoded as an iterable of integers. Now only strings and byte-like objects are accepted.
  • Issue #26536: socket.ioctl now supports SIO_LOOPBACK_FAST_PATH. Patch by Daniel Stokes.
  • Issue #27048: Prevents distutils failing on Windows when environment variables contain non-ASCII characters
  • Issue #27330: Fixed possible leaks in the ctypes module.
  • Issue #27238: Got rid of bare excepts in the turtle module. Original patch by Jelle Zijlstra.
  • Issue #27122: When an exception is raised within the context being managed by a contextlib.ExitStack() and one of the exit stack generators catches and raises it in a chain, do not re-raise the original exception when exiting, let the new chained one through. This avoids the PEP 479 bug described in issue25782.
  • Issue #27278: Fix os.urandom() implementation using getrandom() on Linux. Truncate size to INT_MAX and loop until we collected enough random bytes, instead of casting a directly Py_ssize_t to int.
  • Issue #16864: sqlite3.Cursor.lastrowid now supports REPLACE statement. Initial patch by Alex LordThorsen.
  • Issue #26386: Fixed ttk.TreeView selection operations with item id’s containing spaces.
  • Issue #8637: Honor a pager set by the env var MANPAGER (in preference to one set by the env var PAGER).
  • Issue #22636: Avoid shell injection problems with ctypes.util.find_library().
  • Issue #16182: Fix various functions in the “readline” module to use the locale encoding, and fix get_begidx() and get_endidx() to return code point indexes.
  • IDLE:
  • Issue #27477: IDLE search dialogs now use ttk widgets.
  • Issue #27173: Add ‘IDLE Modern Unix’ to the built-in key sets. Make the default key set depend on the platform. Add tests for the changes to the config module.
  • Issue #27452: make command line “idle-test> python test_help.py” work. __file__ is relative when python is started in the file’s directory.
  • Issue #27452: add line counter and crc to IDLE configHandler test dump.
  • Issue #27380: IDLE: add query.py with base Query dialog and ttk widgets. Module had subclasses SectionName, ModuleName, and HelpSource, which are used to get information from users by configdialog and file =>Load Module. Each subclass has itw own validity checks. Using ModuleName allows users to edit bad module names instead of starting over. Add tests and delete the two files combined into the new one.
  • Issue #27372: Test_idle no longer changes the locale.
  • Issue #27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names.
  • Issue #27245: IDLE: Cleanly delete custom themes and key bindings. Previously, when IDLE was started from a console or by import, a cascade of warnings was emitted. Patch by Serhiy Storchaka.
  • Issue #24137: Run IDLE, test_idle, and htest with tkinter default root disabled. Fix code and tests that fail with this restriction. Fix htests to not create a second and redundant root and mainloop.
  • Issue #27310: Fix IDLE.app failure to launch on OS X due to vestigial import.
  • C API:
  • Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded as an iterable of integers. Now only strings and byte-like objects are accepted.
  • Build:
  • Issue #27442: Expose the Android API level that python was built against, in sysconfig.get_config_vars() as ‘ANDROID_API_LEVEL’.
  • Issue #27434: The interpreter that runs the cross-build, found in PATH, must now be of the same feature version (e.g. 3.6) as the source being built.
  • Issue #26930: Update Windows builds to use OpenSSL 1.0.2h.
  • Issue #23968: Rename the platform directory from plat-$(MACHDEP) to plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install the platform specifc _sysconfigdata module into the platform directory and rename it to include the ABIFLAGS.
  • Don’t use largefile support for GNU/Hurd.
  • Tools/Demos:
  • Issue #27332: Fixed the type of the first argument of module-level functions generated by Argument Clinic. Patch by Petr Viktorin.
  • Issue #27418: Fixed Tools/importbench/importbench.py.
  • Documentation:
  • Issue #27285: Update documentation to reflect the deprecation of pyvenv and normalize on the term “virtual environment”. Patch by Steve Piercy.
  • Tests:
  • Issue #27027: Added test.support.is_android that is True when this is an Android build.

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.

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.
  • 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.2 RC 1 (Jun 13, 2016)

  • Core and Builtins:
  • 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 #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 #25455: Fixed crashes in repr of recursive ElementTree.Element and functools.partial objects.
  • 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 Michał 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 1 (May 17, 2016)

  • Core and Builtins:
  • Issue #26991: Fix possible refleak when creating a function with annotations.
  • Issue #27039: Fixed bytearray.remove() for values greater than 127. Based on patch by Joe Jevnik.
  • Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses.
  • Issue #27005: Optimized the float.fromhex() class method for exact float. It is now 2 times faster.
  • Issue #18531: Single var-keyword argument of dict subtype was passed unscathed to the C-defined function. Now it is converted to exact dict.
  • 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 #26249: Memory functions of the PyMem_Malloc() domain (PYMEM_DOMAIN_MEM) now use the pymalloc allocator rather than system malloc(). Applications calling PyMem_Malloc() without holding the GIL can now crash: use PYTHONMALLOC=debug environment variable to validate the usage of memory allocators in your application.
  • Issue #26802: Optimize function calls only using unpacking like func(*tuple) (no other positional argument, no keyword): avoid copying the tuple. Patch written by Joe Jevnik.
  • 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 #26574: Optimize bytes.replace(b'', b'.') and bytearray.replace(b'', b'.'). Patch written by Josh Snider.
  • 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 #19711: Add tests for reloading namespace packages.
  • Issue #21099: Switch applicable importlib tests to use PEP 451 API.
  • Issue #26563: Debug hooks on Python memory allocators now raise a fatal error if functions of the PyMem_Malloc() family are called without holding the GIL.
  • Issue #26564: On error, the debug hooks on Python memory allocators now use the tracemalloc module to get the traceback where a memory block was allocated.
  • Issue #26558: The debug hooks on Python memory allocator PyObject_Malloc() now detect when functions are called without holding the GIL.
  • Issue #26516: Add PYTHONMALLOC environment variable to set the Python memory allocators and/or install debug hooks.
  • Issue #26516: The PyMem_SetupDebugHooks() function can now also be used on Python compiled in release mode.
  • Issue #26516: The PYTHONMALLOCSTATS environment variable can now also be used on Python compiled in release mode. It now has no effect if set to an empty string.
  • Issue #26516: In debug mode, debug hooks are now also installed on Python memory allocators when Python is configured without pymalloc.
  • Issue #26464: Fix str.translate() when string is ASCII and first replacements removes character, but next replacement uses a non-ASCII character or a string longer than 1 character. Regression introduced in Python 3.5.0.
  • Issue #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 #26136: Upgrade the warning when a generator raises StopIteration from PendingDeprecationWarning to DeprecationWarning. Patch by Anish Shah.
  • Issue #26204: The compiler now ignores all constant statements: bytes, str, int, float, complex, name constants (None, False, True), Ellipsis and ast.Constant; not only str and int. For example, 1.0 is now ignored in def f(): 1.0.
  • Issue #4806: Avoid masking the original TypeError exception when using star (*) unpacking in function calls. Based on patch by Hagen Fürstenau and Daniel Urban.
  • Issue #26146: Add a new kind of AST node: ast.Constant. It can be used by external AST optimizers, but the compiler does not emit directly such node.
  • Issue #23601: Sped-up allocation of dict key objects by using Python’s small object allocator. (Contributed by Julian Taylor.)
  • Issue #18018: Import raises ImportError instead of SystemError if a relative import is attempted without a known parent package.
  • 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 #26107: The format of the co_lnotab attribute of code objects changes to support negative line number delta.
  • 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 #25791: If __package__ != __spec__.parent or if neither __package__ or __spec__ are defined then ImportWarning is raised.
  • Issue #25731: Fix set and deleting __new__ on a class.
  • 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 #5319: New Py_FinalizeEx() API allowing Python to set an exit status of 120 on failure to flush buffered streams.
  • Issue #25485: telnetlib.Telnet is now a context manager.
  • 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 #25630: Fix a possible segfault during argument parsing in functions that accept filesystem paths.
  • Issue #23564: Fixed a partially broken sanity check in the _posixsubprocess internals regarding how fds_to_pass were passed to the child. The bug had no actual impact as subprocess.py already avoided it.
  • Issue #25388: Fixed tokenizer crash when processing undecodable source code with a null byte.
  • Issue #25462: The hash of the key now is calculated only once in most operations in C implementation of OrderedDict.
  • Issue #22995: Default implementation of __reduce__ and __reduce_ex__ now rejects builtin types with not defined __new__.
  • Issue #24802: Avoid buffer overreads when int(), float(), compile(), exec() and eval() are passed bytes-like objects. These objects are not necessarily terminated by a null byte, but the functions assumed they were.
  • Issue #25555: Fix parser and AST: fill lineno and col_offset of “arg” node when compiling AST from Python objects.
  • Issue #24726: Fixed a crash and leaking NULL in repr() of OrderedDict that was mutated by direct calls of dict methods.
  • Issue #25449: Iterating OrderedDict with keys with unstable hash now raises KeyError in C implementations as well as in Python implementation.
  • Issue #25395: Fixed crash when highly nested OrderedDict structures were garbage collected.
  • Issue #25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now between 2x and 3.5x faster.
  • Issue #25399: Optimize bytearray % args using the new private _PyBytesWriter API. Formatting is now between 2.5 and 5 times faster.
  • Issue #25274: sys.setrecursionlimit() now raises a RecursionError if the new recursion limit is too low depending at the current recursion depth. Modify also the “lower-water mark” formula to make it monotonic. This mark is used to decide when the overflowed flag of the thread state is reset.
  • Issue #24402: Fix input() to prompt to the redirected stdout when sys.stdout.fileno() fails.
  • Issue #25349: Optimize bytes % args using the new private _PyBytesWriter API. Formatting is now up to 2 times faster.
  • Issue #24806: Prevent builtin types that are not allowed to be subclassed from being subclassed through multiple inheritance.
  • Issue #25301: The UTF-8 decoder is now up to 15 times as fast for error handlers: ignore, replace and surrogateescape.
  • Issue #24848: Fixed a number of bugs in UTF-7 decoding of misformed data.
  • Issue #25267: The UTF-8 encoder is now up to 75 times as fast for error handlers: ignore, replace, surrogateescape, surrogatepass. Patch co-written with Serhiy Storchaka.
  • Issue #25280: Import trace messages emitted in verbose (-v) mode are no longer formatted twice.
  • Issue #25227: Optimize ASCII and latin1 encoders with the surrogateescape error handler: the encoders are now up to 3 times as fast. Initial patch written by Serhiy Storchaka.
  • Issue #25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom() function instead of the getentropy() function. The getentropy() function is blocking to generate very good quality entropy, os.urandom() doesn’t need such high-quality entropy.
  • Issue #9232: Modify Python’s grammar to allow trailing commas in the argument list of a function declaration. For example, “def f(*, a = 3,): pass” is now legal. Patch from Mark Dickinson.
  • Issue #24965: Implement PEP 498 “Literal String Interpolation”. This allows you to embed expressions inside f-strings, which are converted to normal strings at run time. Given x=3, then f’value={x}’ == ‘value=3’. Patch by Eric V. Smith.
  • 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 #26288: Optimize PyLong_AsDouble.
  • Issues #26289 and #26315: Optimize floor and modulo division for single-digit longs. Microbenchmarks show 2-2.5x improvement. Built-in ‘divmod’ function is now also ~10% faster.
  • Issue #25887: Raise a RuntimeError when a coroutine object is awaited more than once.
  • Library:
  • Issue #27031: Removed dummy methods in Tkinter widget classes: tk_menuBar() and tk_bindForTraversal().
  • 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 #27033: The default value of the decode_data parameter for smtpd.SMTPChannel and smtpd.SMTPServer constructors is changed to False.
  • Issue #27034: Removed deprecated class asynchat.fifo.
  • Issue #26870: Added readline.set_auto_history(), which can stop entries being automatically added to the history list. Based on patch by Tyler Crompton.
  • Issue #26039: zipfile.ZipFile.open() can now be used to write data into a ZIP file, as well as for extracting data. Patch by Thomas Kluyver.
  • Issue #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 #26002: Use bisect in statistics.median instead of a linear search. Patch by Upendra Kuma.
  • Issue #25974: Make use of new Decimal.as_integer_ratio() method in statistics module. Patch by Stefan Krah.
  • Issue #26996: Add secrets module as described in PEP 506.
  • 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 #26915: The __contains__ methods in the collections ABCs now check for identity before checking equality. This better matches the behavior of the concrete classes, allows sensible handling of NaNs, and makes it easier to reason about container invariants.
  • 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 #24902: Print server URL on http.server startup. Initial patch by Felix Kaiser.
  • Issue #25788: fileinput.hook_encoded() now supports an “errors” argument for passing to open. Original patch by Joseph Hackman.
  • 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 #26782: Add STARTUPINFO to subprocess.__all__ on Windows.
  • Issue #26404: Add context manager to socketserver. Patch by Aviv Palivoda.
  • 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 #26585: Eliminate http.server._quote_html() and use html.escape(quote=False). Patch by Xiang Zhang.
  • Issue #26685: Raise OSError if closing a socket fails.
  • 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 #26587: the site module now allows .pth files to specify files to be added to sys.path (e.g. zip files).
  • Issue #25609: Introduce contextlib.AbstractContextManager and typing.ContextManager.
  • 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 #25951: Change SSLSocket.sendall() to return None, as explicitly documented for plain socket objects. Patch by Aviv Palivoda.
  • 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 #26676: Added missing XMLPullParser to ElementTree.__all__.
  • Issue #22854: Change BufferedReader.writable() and BufferedWriter.readable() to always return False.
  • Issue #26492: Exhausted iterator of array.array now conforms with the behavior of iterators of other mutable sequences: it lefts exhausted even if iterated array is extended.
  • Issue #26641: doctest.DocFileTest and doctest.testfile() now support packages (module splitted into multiple directories) for the package parameter.
  • 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 #26637: The importlib module now emits an ImportError rather than a TypeError if __import__() is tried during the Python shutdown process but sys.path is already cleared (set to None).
  • Issue #21925: warnings.formatwarning() now catches exceptions when calling linecache.getline() and tracemalloc.get_object_traceback() to be able to log ResourceWarning emitted late during the Python shutdown process.
  • Issue #23848: On Windows, faulthandler.enable() now also installs an exception handler to dump the traceback of all Python threads on any Windows exception, not only on UNIX signals (SIGSEGV, SIGFPE, SIGABRT).
  • Issue #26530: Add C functions _PyTraceMalloc_Track() and _PyTraceMalloc_Untrack() to track memory blocks using the tracemalloc module. Add _PyTraceMalloc_GetTraceback() to get the traceback of an object.
  • Issue #26588: The _tracemalloc now supports tracing memory allocations of multiple address spaces (domains).
  • Issue #24266: Ctrl+C during Readline history search now cancels the search mode when compiled with Readline 7.
  • Issue #26590: Implement a safe finalizer for the _socket.socket type. It now releases the GIL to close the socket.
  • Issue #18787: spwd.getspnam() now raises a PermissionError if the user doesn’t have privileges.
  • Issue #26560: Avoid potential ValueError in BaseHandler.start_response. Initial patch by Peter Inglesby.
  • Issue #26567: Add a new function PyErr_ResourceWarning() function to pass the destroyed object. Add a source attribute to warnings.WarningMessage. Add warnings._showwarnmsg() which uses tracemalloc to get the traceback where source object was allocated.
  • 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 #26323: Add Mock.assert_called() and Mock.assert_called_once() methods to unittest.mock. Patch written by Amit Saha.
  • 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 fileinput. The bufsize parameter is now deprecated and ignored.
  • Issue #19475: Added an optional argument timespec to the datetime isoformat() method to choose the precision of the time component.
  • Issue #2202: Fix UnboundLocalError in AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu Dupuy.
  • Issue #26167: Minimized overhead in copy.copy() and copy.deepcopy(). Optimized copying and deepcopying bytearrays, NotImplemented, slices, short lists, tuples, dicts, sets.
  • 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 #26482: Allowed pickling recursive dequeues.
  • Issue #26335: Make mmap.write() return the number of bytes written like other write methods. Patch by Jakub Stasiak.
  • Issue #26457: Fixed the subnets() methods in IP network classes for the case when resulting prefix length is equal to maximal prefix length. Based on patch by Xiang Zhang.
  • Issue #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 README.txt.
  • Issue #24879: help() and pydoc can now list named tuple fields in the order they were defined rather than alphabetically. The ordering is determined by the _fields attribute if present.
  • Issue #24874: Improve speed of itertools.cycle() and make its pickle more compact.
  • Fix crash in itertools.cycle.__setstate__() when the first argument wasn’t a list.
  • Issue #20059: urllib.parse raises ValueError on all invalid ports. Patch by Martin Panter.
  • Issue #24360: Improve __repr__ of argparse.Namespace() for invalid identifiers. Patch by Matthias Bussonnier.
  • Issue #23426: run_setup was broken in distutils. Patch from Alexander Belopolsky.
  • Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond.
  • Issue #2091: open() accepted a ‘U’ mode string containing ‘+’, but ‘U’ can only be used with ‘r’. Patch from Jeff Balogh and John O’Connor.
  • Issue #8585: improved tests for zipimporter2. Patch from Mark Lawrence.
  • Issue #18622: unittest.mock.mock_open().reset_mock would recurse infinitely. Patch from Nicola Palumbo and Laurent De Buyst.
  • Issue #24426: Fast searching optimization in regular expressions now works for patterns that starts with capturing groups. Fast searching optimization now can’t be disabled at compile time.
  • Issue #23661: unittest.mock side_effects can now be exceptions again. This was a regression vs Python 3.4. Patch from Ignacio Rossi
  • Issue #13248: Remove deprecated inspect.getmoduleinfo function.
  • Issue #25578: Fix (another) memory leak in SSLSocket.getpeercer().
  • Issue #25530: Disable the vulnerable SSLv3 protocol by default when creating ssl.SSLContext.
  • Issue #25569: Fix memory leak in SSLSocket.getpeercert().
  • Issue #25471: Sockets returned from accept() shouldn’t appear to be nonblocking.
  • Issue #25319: When threading.Event is reinitialized, the underlying condition should use a regular lock rather than a recursive lock.
  • Skip getaddrinfo if host is already resolved. Patch by A. Jesse Jiryu Davis.
  • Add asyncio.timeout() context manager.
  • Issue #26050: Add asyncio.StreamReader.readuntil() method. Patch by Марк Коренберг.
  • Issue #25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis.
  • Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls on current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis.
  • Issue #26848: Fix asyncio/subprocess.communicate() to handle empty input. Patch by Jack O’Connor.
  • Issue #27040: Add loop.get_exception_handler method
  • Issue #27041: asyncio: Add loop.create_future method
  • IDLE:
  • Issue 15348: Stop the debugger engine (normally in a user process) before closing the debugger window (running in the IDLE process). This prevents the RuntimeErrors that were being caught and ignored.
  • Issue #24455: Prevent IDLE from hanging when a) closing the shell while the debugger is active (15347); b) closing the debugger with the [X] button (15348); and c) activating the debugger when already active (24455). The patch by Mark Roseman does this by making two changes. 1. Suspend and resume the gui.interaction method with the tcl vwait mechanism intended for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow any existing interaction to terminate first.
  • Change ‘The program’ to ‘Your program’ in an IDLE ‘kill program?’ message to make it clearer that the program referred to is the currently running user program, not IDLE itself.
  • Issue #24750: Improve the appearance of the IDLE editor window status bar. Patch by Mark Roseman.
  • Issue #25313: Change the handling of new built-in text color themes to better address the compatibility problem introduced by the addition of IDLE Dark. Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
  • Issue #24782: Extension configuration is now a tab in the IDLE Preferences dialog rather than a separate dialog. The former tabs are now a sorted list. Patch by Mark Roseman.
  • Issue #22726: Re-activate the config dialog help button with some content about the other buttons and the new IDLE Dark theme.
  • Issue #24820: IDLE now has an ‘IDLE Dark’ built-in text color theme. It is more or less IDLE Classic inverted, with a cobalt blue background. Strings, comments, keywords, ... are still green, red, orange, ... . To use it with IDLEs released before November 2015, hit the ‘Save as New Custom Theme’ button and enter a new name, such as ‘Custom Dark’. The custom theme will work with any IDLE release, and can be modified.
  • Issue #25224: README.txt is now an idlelib index for IDLE developers and curious users. The previous user content is now in the IDLE doc chapter. ‘IDLE’ now means ‘Integrated Development and Learning Environment’.
  • Issue #24820: Users can now set breakpoint colors in Settings -> Custom Highlighting. Original patch by Mark Roseman.
  • Issue #24972: Inactive selection background now matches active selection background, as configured by users, on all systems. Found items are now always highlighted on Windows. Initial patch by Mark Roseman.
  • Issue #24570: Idle: make calltip and completion boxes appear on Macs affected by a tk regression. Initial patch by Mark Roseman.
  • Issue #24988: Idle ScrolledList context menus (used in debugger) now work on Mac Aqua. Patch by Mark Roseman.
  • Issue #24801: Make right-click for context menu work on Mac Aqua. Patch by Mark Roseman.
  • Issue #25173: Associate tkinter messageboxes with a specific widget. For Mac OSX, make them a ‘sheet’. Patch by Mark Roseman.
  • Issue #25198: Enhance the initial html viewer now used for Idle Help. * Properly indent fixed-pitch text (patch by Mark Roseman). * Give code snippet a very Sphinx-like light blueish-gray background. * Re-use initial width and height set by users for shell and editor. * When the Table of Contents (TOC) menu is used, put the section header at the top of the screen.
  • Issue #25225: Condense and rewrite Idle doc section on text colors.
  • Issue #21995: Explain some differences between IDLE and console Python.
  • Issue #22820: Explain need for print when running file from Idle editor.
  • Issue #25224: Doc: augment Idle feature list and no-subprocess section.
  • Issue #25219: Update doc for Idle command line options. Some were missing and notes were not correct.
  • Issue #24861: Most of idlelib is private and subject to change. Use idleib.idle.* to start Idle. See idlelib.__init__.__doc__.
  • Issue #25199: Idle: add synchronization comments for future maintainers.
  • Issue #16893: Replace help.txt with help.html for Idle doc display. The new idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks better than help.txt and will better document Idle as released. The tkinter html viewer that works for this file was written by Rose Roseman. The now unused EditorWindow.HelpDialog class and helt.txt file are deprecated.
  • Issue #24199: Deprecate unused idlelib.idlever with possible removal in 3.6.
  • Issue #24790: Remove extraneous code (which also create 2 & 3 conflicts).
  • Documentation:
  • Issue #26736: Used HTTPS for external links in the documentation if possible.
  • Issue #6953: Rework the Readline module documentation to group related functions together, and add more details such as what underlying Readline functions and variables are accessed.
  • Issue #23606: Adds note to ctypes documentation regarding cdll.msvcrt.
  • Issue #24952: Clarify the default size argument of stack_size() in the “threading” and “_thread” modules. Patch from Mattip.
  • Tests:
  • Issue #26295: When using “python3 -m test –testdir=TESTDIR”, regrtest doesn’t add “test.” prefix to test module names.
  • Issue #26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) was untested.
  • Issue #26015: Added new tests for pickling iterators of mutable sequences.
  • Issue #26325: Added test.support.check_no_resource_warning() to check that no ResourceWarning is emitted.
  • Issue #25940: Changed test_ssl to use its internal local server more. This avoids relying on svn.python.org, which recently changed root certificate.
  • Issue #25616: Tests for OrderedDict are extracted from test_collections into separate file test_ordered_dict.
  • Issue #25449: Added tests for OrderedDict subclasses.
  • Issue #25188: Add -P/–pgo to test.regrtest to suppress error output when running the test suite for the purposes of a PGO build. Initial patch by Alecsandru Patrascu.
  • Issue #22806: Add python -m test --list-tests command to list tests.
  • Issue #18174: python -m test --huntrleaks ... now also checks for leak of file descriptors. Patch written by Richard Oudkerk.
  • Issue #25260: Fix python -m test --coverage on Windows. Remove the list of ignored directories.
  • PCbuild\rt.bat now accepts an unlimited number of arguments to pass along to regrtest.py. Previously there was a limit of 9.
  • Issue #26583: Skip test_timestamp_overflow in test_import if bytecode files cannot be written.
  • Build:
  • Issue #26932: Fixed support of RTLD_* constants defined as enum values, not via macros (in particular on Android). Patch by Chi Hsuan Yen.
  • Issue #22359: Disable the rules for running _freeze_importlib and pgen when cross-compiling. The output of these programs is normally saved with the source code anyway, and is still regenerated when doing a native build. Patch by Xavier de Gaye.
  • Issue #21668: Link audioop, _datetime, _ctypes_test modules to libm, except on Mac OS X. Patch written by Chi Hsuan Yen.
  • Issue #25702: A –with-lto configure option has been added that will enable link time optimizations at build time during a make profile-opt. Some compilers and toolchains are known to not produce stable code when using LTO, be sure to test things thoroughly before relying on it. It can provide a few % speed up over profile-opt alone.
  • Issue #26624: Adds validation of ucrtbase[d].dll version with warning for old versions.
  • Issue #17603: Avoid error about nonexistant fileblocks.o file by using a lower-level check for st_blocks in struct stat.
  • Issue #26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern Thiel.
  • Issue #26465: Update Windows builds to use OpenSSL 1.0.2g.
  • Issue #25348: Added --pgo and --pgo-job arguments to PCbuild\build.bat for building with Profile-Guided Optimization. The old PCbuild\build_pgo.bat script is removed.
  • Issue #25827: Add support for building with ICC to configure, including a new --with-icc flag.
  • Issue #25696: Fix installation of Python on UNIX with make -j9.
  • Issue #24986: It is now possible to build Python on Windows without errors when external libraries are not available.
  • Issue #24421: Compile Modules/_math.c once, before building extensions. Previously it could fail to compile properly if the math and cmath builds were concurrent.
  • Issue #26465: Update OS X 10.5+ 32-bit-only installer to build and link with OpenSSL 1.0.2g.
  • Issue #26268: Update Windows builds to use OpenSSL 1.0.2f.
  • Issue #25136: Support Apple Xcode 7’s new textual SDK stub libraries.
  • Issue #24324: Do not enable unreachable code warnings when using gcc as the option does not work correctly in older versions of gcc and has been silently removed as of gcc-4.5.
  • Tools/Demos:
  • Issue #26799: Fix python-gdb.py: don’t get C types once when the Python code is loaded, but get C types on demand. The C types can change if python-gdb.py is loaded before the Python executable. Patch written by Thomas Ilsche.
  • Issue #26271: Fix the Freeze tool to properly use flags passed through configure. Patch by Daniel Shaulov.
  • Issue #26489: Add dictionary unpacking support to Tools/parser/unparse.py. Patch by Guo Ci Teo.
  • Issue #26316: Fix variable name typo in Argument Clinic.
  • Issue #25440: Fix output of python-config –extension-suffix.
  • Issue #25154: The pyvenv script has been deprecated in favour of python3 -m venv.
  • C API:
  • Issue #26312: SystemError is now raised in all programming bugs with using PyArg_ParseTupleAndKeywords(). RuntimeError did raised before in some programming bugs.
  • Issue #26198: ValueError is now raised instead of TypeError on buffer overflow in parsing “es#” and “et#” format units. SystemError is now raised instead of TypeError on programmical error in parsing format string.

New in Python 3.5.0 (Sep 14, 2015)

  • New syntax features:
  • PEP 492, coroutines with async and await syntax.
  • PEP 465, a new matrix multiplication operator: a @ b.
  • PEP 448, additional unpacking generalizations.
  • New library modules:
  • typing: PEP 484 – Type Hints.
  • zipapp: PEP 441 Improving Python ZIP Application Support.
  • New built-in features:
  • bytes % args, bytearray % args: PEP 461 – Adding % formatting to bytes and bytearray.
  • b'\xf0\x9f\x90\x8d'.hex(), bytearray(b'\xf0\x9f\x90\x8d').hex(), memoryview(b'\xf0\x9f\x90\x8d').hex(): issue 9951 - A hex method has been added to bytes, bytearray, and memoryview.
  • memoryview now supports tuple indexing (including multi-dimensional). (Contributed by Antoine Pitrou in issue 23632.)
  • Generators have a new gi_yieldfrom attribute, which returns the object being iterated by yield from expressions. (Contributed by Benno Leslie and Yury Selivanov in issue 24450.)
  • A new RecursionError exception is now raised when maximum recursion depth is reached. (Contributed by Georg Brandl in issue 19235.)
  • CPython implementation improvements:
  • When the LC_TYPE locale is the POSIX locale (C locale), sys.stdin and sys.stdout now use the surrogateescape error handler, instead of the strict error handler. (Contributed by Victor Stinner in issue 19977.)
  • .pyo files are no longer used and have been replaced by a more flexible scheme that includes the optimization level explicitly in .pyc name. (See PEP 488 overview.)
  • Builtin and extension modules are now initialized in a multi-phase process, which is similar to how Python modules are loaded. (See PEP 489 overview.)
  • Significant improvements in the standard library:
  • collections.OrderedDict is now implemented in C, which makes it 4 to 100 times faster.
  • ssl module gained support for Memory BIO, which decouples SSL protocol handling from network IO.
  • The new os.scandir() function provides a better and significantly faster way of directory traversal.
  • functools.lru_cache() has been mostly reimplemented in C, yielding much better performance.
  • The new subprocess.run() function provides a streamlined way to run subprocesses.
  • The traceback module has been significantly enhanced for improved performance and developer convenience.
  • Security improvements:
  • SSLv3 is now disabled throughout the standard library. It can still be enabled by instantiating a ssl.SSLContext manually. (See issue 22638 for more details; this change was backported to CPython 3.4 and 2.7.)
  • HTTP cookie parsing is now stricter, in order to protect against potential injection attacks. (Contributed by Antoine Pitrou in issue 22796.)

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

  • A last-minute bugfix release before 3.5.0 final, to fix a major regression found during the testing of Python 3.5.0rc3.

New in Python 3.5.0 RC 3 (Sep 8, 2015)

  • Core and Builtins:
  • Issue #24305: Prevent import subsystem stack frames from being counted by the warnings.warn(stacklevel=) parameter.
  • Issue #24912: Prevent __class__ assignment to immutable built-in objects.
  • Issue #24975: Fix AST compilation for PEP 448 syntax.
  • Library:
  • Issue #24917: time_strftime() buffer over-read.
  • Issue #23144: Make sure that HTMLParser.feed() returns all the data, even when convert_charrefs is True.
  • Issue #24748: To resolve a compatibility problem found with py2exe and pywin32, imp.load_dynamic() once again ignores previously loaded modules to support Python modules replacing themselves with extension modules. Patch by Petr Viktorin.
  • Issue #24635: Fixed a bug in typing.py where isinstance([], typing.Iterable) would return True once, then False on subsequent calls.
  • Issue #24989: Fixed buffer overread in BytesIO.readline() if a position is set beyond size. Based on patch by John Leitch.
  • Issue #24913: Fix overrun error in deque.index(). Found by John Leitch and Bryce Darling.

New in Python 3.5.0 RC 2 (Aug 25, 2015)

  • Core and Builtins:
  • Issue #21167: NAN operations are now handled correctly when python is compiled with ICC even if -fp-model strict is not specified.
  • Library:
  • Issue #24764: cgi.FieldStorage.read_multi() now ignores the Content-Length header in part headers. Patch written by Peter Landry and reviewed by Pierre Quentel.
  • Issue #24774: Fix docstring in http.server.test. Patch from Chiu-Hsiang Hsu.
  • Issue #21159: Improve message in configparser.InterpolationMissingOptionError. Patch from Łukasz Langa.
  • Issue #24847: Fixes tcltk installer layout of VC runtime DLL
  • Issue #24839: platform._syscmd_ver raises DeprecationWarning
  • Issue #24867: Fix Task.get_stack() for ‘async def’ coroutines
  • Documentation:
  • Issue #23725: Overhaul tempfile docs. Note deprecated status of mktemp. Patch from Zbigniew Jędrzejewski-Szmek.

New in Python 3.5.0 RC 1 (Aug 11, 2015)

  • Core and Builtins:
  • Issue #24667: Resize odict in all cases that the underlying dict resizes.
  • Library:
  • Issue #24824: Signatures of codecs.encode() and codecs.decode() now are compatible with pydoc.
  • Issue #24634: Importing uuid should not try to load libc on Windows
  • Issue #24798: _msvccompiler.py doesn’t properly support manifests
  • Issue #4395: Better testing and documentation of binary operators. Patch by Martin Panter.
  • Issue #23973: Update typing.py from GitHub repo.
  • Issue #23004: mock_open() now reads binary data correctly when the type of read_data is bytes. Initial patch by Aaron Hill.
  • Issue #23888: Handle fractional time in cookie expiry. Patch by ssh.
  • Issue #23652: Make it possible to compile the select module against the libc headers from the Linux Standard Base, which do not include some EPOLL macros. Patch by Matt Frank.
  • Issue #22932: Fix timezones in email.utils.formatdate. Patch from Dmitry Shachnev.
  • Issue #23779: imaplib raises TypeError if authenticator tries to abort. Patch from Craig Holmquist.
  • Issue #23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch written by Matthieu Gautier.
  • Issue #23254: Document how to close the TCPServer listening socket. Patch from Martin Panter.
  • Issue #19450: Update Windows and OS X installer builds to use SQLite 3.8.11.
  • Issue #17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella.
  • Issue #23812: Fix asyncio.Queue.get() to avoid loosing items on cancellation. Patch by Gustavo J. A. M. Carneiro.
  • Issue #24791: Fix grammar regression for call syntax: ‘g(*a or b)’.
  • Documentation:
  • Issue #24129: Clarify the reference documentation for name resolution. This includes removing the assumption that readers will be familiar with the name resolution scheme Python used prior to the introduction of lexical scoping for function namespaces. Patch by Ivan Levkivskyi.
  • Issue #20769: Improve reload() docs. Patch by Dorian Pula.
  • Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
  • Issue #24729: Correct IO tutorial to match implementation regarding encoding parameter to open function.
  • Tests:
  • Issue #24751: When running regrtest with the -w command line option, a test run is no longer marked as a failure if all tests succeed when re-run.

New in Python 3.5.0 Beta 3 (Jul 6, 2015)

  • Highlights:
  • PEP 448, additional unpacking generalizations
  • PEP 461, adding support for "%-formatting" for bytes and bytearray objects
  • PEP 465, a new operator (@) for matrix multiplication
  • PEP 471, os.scandir(), a faster alternative to os.walk()
  • PEP 475, adding support for automatic retries of interrupted system calls
  • PEP 479, change StopIteration handling inside generators
  • PEP 484, the typing module, a new standard for type annotations
  • PEP 486, making the Windows Python launcher aware of virtual environments
  • PEP 488, eliminating .pyo files
  • PEP 489, multi-phase extension module initialization
  • PEP 492, coroutines with async and await syntax

New in Python 3.5.0 Beta 2 (Jun 1, 2015)

  • Core and Built-ins:
  • Issue #24284: The startswith and endswith methods of the str class no longer return True when finding the empty string and the indexes are completely out of range.
  • Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(), PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly.
  • Issue #24328: Fix importing one character extension modules.
  • Issue #11205: In dictionary displays, evaluate the key before the value.
  • Issue #24285: Fixed regression that prevented importing extension modules from inside packages. Patch by Petr Viktorin.
  • Library:
  • Issue #5633: Fixed timeit when the statement is a string and the setup is not.
  • Issue #24326: Fixed audioop.ratecv() with non-default weightB argument. Original patch by David Moore.
  • Issue #16991: Add a C implementation of OrderedDict.
  • Issue #23934: Fix inspect.signature to fail correctly for builtin types lacking signature information. Initial patch by James Powell.

New in Python 3.5.0 Beta 1 (May 25, 2015)

  • New features and changes:
  • PEP 448, additional unpacking generalizations
  • PEP 461, adding support for "%-formatting" for bytes and bytearray objects
  • PEP 465, a new operator (@) for matrix multiplication
  • PEP 471, os.scandir(), a faster alternative to os.walk()
  • PEP 475, adding support for automatic retries of interrupted system calls
  • PEP 479, change StopIteration handling inside generators
  • PEP 484, the typing module, a new standard for type annotations
  • PEP 486, making the Windows Python launcher aware of virtual environments
  • PEP 488, eliminating .pyo files
  • PEP 489, multi-phase extension module initialization
  • PEP 492, coroutines with async and await syntax

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

  • Highlights:
  • PEP 461, adding support for "%-formatting" for bytes and bytearray objects
  • PEP 465, a new operator (@) for matrix multiplication
  • PEP 471, os.scandir()
  • PEP 475, adding support for automatic retries of interrupted system calls
  • PEP 486, making the Windows Python launcher aware of virtual environments
  • PEP 488, eliminating .pyo files
  • 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 9, 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(). Original patch by Mark Lawrence.
  • Issue #23521: Corrected pure python implementation of timedelta division.
  • Issue #21619: Popen objects no longer leave a zombie after exit in the with statement if the pipe was broken. Patch by Martin Panter.
  • Issue #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(). Patch by Nikolaus Rath.
  • 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. 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 #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. Patch by Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson.
  • 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. Original patch from Jason Yeo.
  • 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.

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.3 RC 1 (Feb 9, 2015)

  • Core and Builtins:
  • 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 #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 #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 #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 #22604: Fix assertion error in debug mode when dividing a complex number by (nan+0j).
  • Issue #22470: Fixed integer overflow issues in “backslashreplace”, “xmlcharrefreplace”, and “surrogatepass” error handlers.
  • 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 #23165: Perform overflow checks before allocating memory in the _Py_char2wchar function.
  • Library:
  • Issue #23399: pyvenv creates relative symlinks where possible.
  • Issue #23099: Closing io.BytesIO with exported buffer is rejected now to prevent corrupting exported buffer.
  • 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 #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 #23248: Update ssl error codes from latest OpenSSL git master.
  • Issue #23098: 64-bit dev_t is now supported in the os module.
  • 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.close() now clears its internal reference to the selector mapping to break a reference cycle. Initial patch written by Martin Richard.
  • 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 #20896, #22935: The ssl.get_server_certificate() function now uses the PROTOCOL_SSLv23 protocol by default, not PROTOCOL_SSLv3, for maximum compatibility and support platforms where PROTOCOL_SSLv3 support is disabled.
  • Issue #23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol version.
  • Issue #23132: Mitigate regression in speed and clarity in functools.total_ordering.
  • Issue #22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(), instead of reading /dev/urandom, to get pseudo-random bytes.
  • Issue #23112: Fix SimpleHTTPServer to correctly carry the query string and fragment when it redirects to add a trailing slash.
  • Issue #23093: In the io, module allow more operations to work on detached streams.
  • Issue #19104: pprint now produces evaluable output for wrapped strings.
  • Issue #23071: Added missing names to codecs.__all__. Patch by Martin Panter.
  • 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 #22959: In the constructor of http.client.HTTPSConnection, prefer the context’s check_hostname attribute over the check_hostname parameter.
  • Issue #16043: Add a default limit for the amount of data xmlrpclib.gzip_decode will return. This resolves CVE-2013-1753.
  • Issue #22966: Fix __pycache__ pyc file name clobber when pyc_compile is asked to compile a source file containing multiple dots in the source file name.
  • Issue #21971: Update turtledemo doc and add module to the index.
  • Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails. Original patch by Martin Panter.
  • Issue #22960: Add a context argument to xmlrpclib.ServerProxy constructor.
  • 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 #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 #22638: SSLv3 is now disabled throughout the standard library. It can still be enabled by instantiating a SSLContext manually.
  • Issue #22370: Windows detection in pathlib is now more robust.
  • Issue #22841: Reject coroutines in asyncio add_signal_handler(). Patch by Ludovic.Gasc.
  • 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 #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 Kalvā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 #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 #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 #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 #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 #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 #22641: In asyncio, the default SSL context for client connections is now created using ssl.create_default_context(), for stronger security.
  • 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 Gruszczyński and Claudiu Popa.
  • Issue #22462: Fix pyexpat’s creation of a dummy frame to make it appear in exception tracebacks.
  • 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 #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 #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 #22396: On 32-bit AIX platform, don’t expose os.posix_fadvise() nor os.posix_fallocate() because their prototypes in system headers are wrong.
  • Issue #22517: When a io.BufferedRWPair object is deallocated, clear its weakrefs.
  • Issue #22448: Improve canceled timer handles cleanup to prevent unbound memory usage. Patch by Joshua Moore-Oliva.
  • Issue #23009: Make sure selectors.EpollSelecrtor.select() works when no FD is registered.
  • 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 #23180: Rename IDLE “Windows” menu item to “Window”. Patch by Al Sweigart.
  • Tests:
  • Issue #23392: Added tests for marshal C API that works with FILE*.
  • 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 #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).
  • 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 #16537: Check whether self.extensions is empty in setup.py. Patch by Jonathan Hosmer.
  • Issue #18096: Fix library order returned by python-config.
  • Issue #17219: Add library build dir for Python extension cross-builds.
  • Issue #17128: Use private version of OpenSSL for 3.4.3 OS X 10.5+ installer.
  • C API:
  • Issue #22079: PyType_Ready() now checks that statically allocated type has no dynamically allocated bases.
  • Documentation:
  • Issue #19548: Update the codecs module documentation to better cover the distinction between text encodings and other codecs, together with other clarifications. Patch by Martin Panter.
  • Issue #22914: Update the Python 2/3 porting HOWTO to describe a more automated approach.
  • Issue #21514: The documentation of the json module now refers to new JSON RFC 7159 instead of obsoleted RFC 4627.
  • Tools/Demos:
  • Issue #22314: pydoc now works when the LINES environment variable is set.

New in Python 3.5.0 Alpha 1 (Feb 9, 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 Kalvā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 Gruszczyń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”. Patch by Al Sweigart.
  • 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

New in Python 3.4.2 (Oct 9, 2014)

  • Core and Builtins -Library:
  • 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 #22427: TemporaryDirectory no longer attempts to clean up twice when used in the with statement in generator.
  • 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 #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.

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 17, 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.4.0 RC 3 (Mar 10, 2014)

  • Changes:
  • 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.5 (Mar 10, 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 (Feb 24, 2014)

  • Core and Builtins:
  • 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)
  • 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 #20743: Fix a reference leak in test_tcl.
  • 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.
  • Tools/Demos:
  • Issue #20535: PYTHONWARNING no longer affects the run_tests.py script. Patch by Arfrever Frehtes Taifersar Arahesis.

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

  • Core and Builtins:
  • Issue #19255: The builtins module is restored to initial value before cleaning other modules. The sys and builtins modules are cleaned last.
  • Issue #20588: Make Python-ast.c C89 compliant.
  • Issue #20437: Fixed 22 potential bugs when deleting objects references.
  • Issue #20500: Displaying an exception at interpreter shutdown no longer risks triggering an assertion failure in PyObject_Str.
  • Issue #20538: UTF-7 incremental decoder produced inconsistent string when input was truncated in BASE64 section.
  • 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.
  • Issue #17162: Add PyType_GetSlot.
  • Issue #20162: Fix an alignment issue in the siphash24() hash function which caused a crash on PowerPC 64-bit (ppc64).
  • Library:
  • Issue #20530: The signatures for slot builtins have been updated to reflect the fact that they only accept positional-only arguments.
  • Issue #20517: Functions in the os module that accept two filenames now register both filenames in the exception on failure.
  • Issue #20563: The ipaddress module API is now considered stable.
  • 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 #20536: the statistics module now correctly handle Decimal instances with positive exponents
  • Issue #18805: the netmask/hostmask parsing in ipaddress now more reliably filters out illegal values and correctly allows any valid prefix length.
  • Issue #20481: For at least Python 3.4, the statistics module will require that all inputs for a single operation be of a single consistent type, or else a mixed of ints and a single other consistent type. This avoids some interoperability issues that arose with the previous approach of coercing to a suitable common type.
  • Issue #20478: the statistics module now treats collections.Counter inputs like any other iterable.
  • 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 #20531: Revert 3.4 version of fix for #19063, and apply the 3.3 version. That is, do not raise an error if unicode is passed to email.message.Message.set_payload.
  • Issue #20476: If a non-compat32 policy is used with any of the email parsers, EmailMessage is now used as the factory class. The factory class should really come from the policy; that will get fixed in 3.5.
  • 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 #20053: ensurepip (and hence venv) are no longer affected by the settings in the default pip configuration file.
  • 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.
  • tracemalloc: Fix slicing traces and fix slicing a traceback.
  • Issue #20354: Fix an alignment issue in the tracemalloc module on 64-bit platforms. Bug seen on 64-bit Linux when using “make profile-opt”.
  • Issue #17159: inspect.signature now accepts duck types of functions, which adds support for Cython functions. Initial patch by Stefan Behnel.
  • Issue #18801: Fix inspect.classify_class_attrs to correctly classify object.__new__ and object.__init__.
  • Fixed cmath.isinf’s name in its argument parsing code.
  • Issue #20311, #20452: poll and epoll now round the timeout away from zero, instead of rounding towards zero, in select and selectors modules: select.epoll.poll(), selectors.PollSelector.poll() and selectors.EpollSelector.poll(). For example, a timeout of one microsecond (1e-6) is now rounded to one millisecondi (1e-3), instead of being rounded to zero. However, the granularity property and asyncio’s resolution feature were removed again.
  • asyncio: Some refactoring; various fixes; add write flow control to unix pipes; Future.set_exception() instantiates the exception argument if it is a class; improved proactor pipe transport; support wait_for(f, None); don’t log broken/disconnected pipes; use ValueError instead of assert for forbidden subprocess_{shell,exec} arguments; added a convenience API for subprocess management; added StreamReader.at_eof(); properly handle duplicate coroutines/futures in gather(), wait(), as_completed(); use a bytearray for buffering in StreamReader; and more.
  • Issue #20288: fix handling of invalid numeric charrefs in HTMLParser.
  • Issue #20424: Python implementation of io.StringIO now supports lone surrogates.
  • Issue #20308: inspect.signature now works on classes without user-defined __init__ or __new__ methods.
  • Issue #20372: inspect.getfile (and a bunch of other inspect functions that use it) doesn’t crash with unexpected AttributeError on classes defined in C without __module__.
  • Issue #20356: inspect.signature formatting uses ‘/’ to separate positional-only parameters from others.
  • Issue #20223: inspect.signature now supports methods defined with functools.partialmethods.
  • Issue #19456: ntpath.join() now joins relative paths correctly when a drive is present.
  • Issue #19077: tempfile.TemporaryDirectory cleanup no longer fails when called during shutdown. Emitting resource warning in __del__ no longer fails. Original patch by Antoine Pitrou.
  • Issue #20394: Silence Coverity warning in audioop module.
  • 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.
  • Issue #20105: the codec exception chaining now correctly sets the traceback of the original exception as its __traceback__ attribute.
  • Issue #17481: inspect.getfullargspec() now uses inspect.signature() API.
  • Issue #15304: concurrent.futures.wait() can block forever even if Futures have completed. Patch by Glenn Langford.
  • Issue #14455: plistlib: fix serializing integers integers in the range of an unsigned long long but outside of the range of signed long long for binary plist files.
  • 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 #20532: Tests which use _testcapi now are 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+.
  • Tools/Demos:
  • Issue #20530: Argument Clinic’s signature format has been revised again. The new syntax is highly human readable while still preventing false positives. The syntax also extends Python syntax to denote “self” and positional-only parameters, allowing inspect.Signature objects to be totally accurate for all supported builtins in Python 3.4.
  • Issue #20456: Argument Clinic now observes the C preprocessor conditional compilation statements of the C files it parses. When a Clinic block is inside a conditional code, it adjusts its output to match, including automatically generating an empty methoddef macro.
  • Issue #20456: Cloned functions in Argument Clinic now use the correct name, not the name of the function they were cloned from, for text strings inside generated code.
  • Issue #20456: Fixed Argument Clinic’s test suite and “–converters” feature.
  • Issue #20456: Argument Clinic now allows specifying different names for a parameter in Python and C, using “as” on the parameter line.
  • Issue #20326: Argument Clinic now uses a simple, unique signature to annotate text signatures in docstrings, resulting in fewer false positives. “self” parameters are also explicitly marked, allowing inspect.Signature() to authoritatively detect (and skip) said parameters.
  • Issue #20326: Argument Clinic now generates separate checksums for the input and output sections of the block, allowing external tools to verify that the input has not changed (and thus the output is not out-of-date).
  • Build:
  • Issue #20465: Update SQLite shipped with OS X installer to 3.8.3.
  • C-API:
  • Issue #20517: Added new functions allowing OSError exceptions to reference two filenames instead of one: PyErr_SetFromErrnoWithFilenameObjects() and PyErr_SetExcFromWindowsErrWithFilenameObjects().
  • Documentation:
  • Issue #20488: Change wording to say importlib is the implementation of import instead of just an implementation.
  • Issue #6386: Clarify in the tutorial that specifying a symlink to execute means the directory containing the executed script and not the symlink is added to sys.path.

New in Python 3.3.4 (Feb 11, 2014)

  • Library:
  • Issue #20374: Fix build warnings of the readline module with libedit on Mac.

New in Python 3.3.4 RC 1 (Jan 27, 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.4.0 Beta (Jan 27, 2014)

  • Major new features and changes:
  • 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.3 RC 2 (Nov 12, 2013)

  • 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.4.0 Alpha 4 (Oct 22, 2013)

  • Core and Builtins:
  • Issue #19301: Give classes and functions that are explicitly marked global a global qualname.
  • Issue #19279: UTF-7 decoder no longer produces illegal strings.
  • Issue #16612: Add “Argument Clinic”, a compile-time preprocessor for C files to generate argument parsing code. (See PEP 436.)
  • Issue #18810: Shift stat calls in importlib.machinery.FileFinder such that the code is optimistic that if something exists in a directory named exactly like the possible package being searched for that it’s in actuality a directory.
  • Issue #18416: importlib.machinery.PathFinder now treats ‘’ as the cwd and importlib.machinery.FileFinder no longer special-cases ‘’ to ‘.’. This leads to modules imported from cwd to now possess an absolute file path for __file__ (this does not affect modules specified by path on the CLI but it does affect -m/runpy). It also allows FileFinder to be more consistent by not having an edge case.
  • Issue #4555: All exported C symbols are now prefixed with either “Py” or “_Py”.
  • Issue #19219: Speed up marshal.loads(), and make pyc files slightly (5% to 10%) smaller.
  • Issue #19221: Upgrade Unicode database to version 6.3.0.
  • Issue #16742: The result of the C callback PyOS_ReadlineFunctionPointer must now be a string allocated by PyMem_RawMalloc() or PyMem_RawRealloc() (or NULL if an error occurred), instead of a string allocated by PyMem_Malloc() or PyMem_Realloc().
  • Issue #19199: Remove PyThreadState.tick_counter field
  • Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at least one place so as to avoid regressions.
  • Issue #19087: Improve bytearray allocation in order to allow cheap popping of data at the front (slice deletion).
  • Issue #19014: memoryview.cast() is now allowed on zero-length views.
  • Issue #18690: memoryview is now automatically registered with collections.abc.Sequence
  • Issue #19078: memoryview now correctly supports the reversed builtin (Patch by Claudiu Popa)
  • Library:
  • Issue #8964: fix platform._sys_version to handle IronPython 2.6+. Patch by Martin Matusiak.
  • Issue #18958: Improve error message for json.load(s) while passing a string that starts with a UTF-8 BOM.
  • Issue #19307: Improve error message for json.load(s) while passing objects of the wrong type.
  • Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read by limiting the call to readline(). Original patch by Michał Jastrzębski and Giampaolo Rodola.
  • Issue #17087: Improved the repr for regular expression match objects.
  • Issue #18235: Fix the sysconfig variables LDSHARED and BLDSHARED under AIX. Patch by David Edelsohn.
  • Issue #18606: Add the new “statistics” module (PEP 450). Contributed by Steven D’Aprano.
  • Issue #12866: The audioop module now supports 24-bit samples.
  • Issue #19254: Provide an optimized Python implementation of pbkdf2_hmac.
  • Issues #19201, #19222, #19223: Add “x” mode (exclusive creation) in opening file to bz2, gzip and lzma modules. Patches by Tim Heaney and Vajrasky Kok.
  • Fix a reference count leak in _sre.
  • Issue #19262: Initial check in of the ‘asyncio’ package (a.k.a. Tulip, a.k.a. PEP 3156). There are no docs yet, and the PEP is slightly out of date with the code. This module will have provisional status in Python 3.4.
  • Issue #19276: Fixed the wave module on 64-bit big-endian platforms.
  • Issue #19266: Rename the new-in-3.4 contextlib.ignore context manager to contextlib.suppress in order to be more consistent with existing descriptions of that operation elsewhere in the language and standard library documentation (Patch by Zero Piraeus).
  • Issue #18891: Completed the new email package (provisional) API additions by adding new classes EmailMessage, MIMEPart, and ContentManager.
  • Issue #18281: Unused stat constants removed from tarfile.
  • Issue #18468: The re.split, re.findall, and re.sub functions and the group() and groups() methods of match object now always return a string or a bytes object.
  • Issue #18725: The textwrap module now supports truncating multiline text.
  • Issue #18776: atexit callbacks now display their full traceback when they raise an exception.
  • Issue #17827: Add the missing documentation for codecs.encode and codecs.decode.
  • Issue #19218: Rename collections.abc to _collections_abc in order to speed up interpreter start.
  • Issue #18582: Add ‘pbkdf2_hmac’ to the hashlib module. It implements PKCS#5 password-based key derivation functions with HMAC as pseudorandom function.
  • Issue #19131: The aifc module now correctly reads and writes sampwidth of compressed streams.
  • Issue #19209: Remove import of copyreg from the os module to speed up interpreter startup. stat_result and statvfs_result are now hard-coded to reside in the os module.
  • Issue #19205: Don’t import the ‘re’ module in site and sysconfig module to to speed up interpreter start.
  • Issue #9548: Add a minimal “_bootlocale” module that is imported by the _io module instead of the full locale module.
  • Issue #18764: remove the ‘print’ alias for the PDB ‘p’ command so that it no longer shadows the print function.
  • Issue #19158: a rare race in BoundedSemaphore could allow .release() too often.
  • Issue #15805: Add contextlib.redirect_stdout().
  • Issue #18716: Deprecate the formatter module.
  • Issue #18037: 2to3 now escapes ‘u’ and ‘U’ in native strings.
  • Issue #17839: base64.decodebytes and base64.encodebytes now accept any object that exports a 1 dimensional array of bytes (this means the same is now also true for base64_codec)
  • Issue #19132: The pprint module now supports compact mode.
  • Issue #19137: The pprint module now correctly formats instances of set and frozenset subclasses.
  • Issue #10042: functools.total_ordering now correctly handles NotImplemented being returned by the underlying comparison function (Patch by Katie Miller)
  • Issue #19092: contextlib.ExitStack now correctly reraises exceptions from the __exit__ callbacks of inner context managers (Patch by Hrvoje Nikšić)
  • Issue #12641: Avoid passing “-mno-cygwin” to the mingw32 compiler, except when necessary. Patch by Oscar Benjamin.
  • Issue #5845: In site.py, only load readline history from ~/.python_history if no history has been read already. This avoids double writes to the history file at shutdown.
  • Properly initialize all fields of a SSL object after allocation.
  • Issue #19095: SSLSocket.getpeercert() now raises ValueError when the SSL handshake hasn’t been done.
  • Issue #4366: Fix building extensions on all platforms when –enable-shared is used.
  • Issue #19030: Fixed inspect.getmembers and inspect.classify_class_attrs to attempt activating descriptors before falling back to a __dict__ search for faulty descriptors. inspect.classify_class_attrs no longer returns Attributes whose home class is None.
  • C API:
  • Issue #1772673: The type of char* arguments now changed to const char*.
  • Issue #16129: Added a Py_SetStandardStreamEncoding pre-initialization API to allow embedding applications like Blender to force a particular encoding and error handler for the standard IO streams (initial patch by Bastien Montagne)
  • Tests:
  • Issue #19275: Fix test_site on AMD64 Snow Leopard
  • Issue #14407: Fix unittest test discovery in test_concurrent_futures.
  • Issue #18919: Unified and extended tests for audio modules: aifc, sunau and wave.
  • Issue #18714: Added tests for pdb.find_function().
  • Documentation:
  • Issue #18758: Fixed and improved cross-references.
  • Issue #18972: Modernize email examples and use the argparse module in them.
  • Build:
  • Issue #19130: Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
  • Issue #15663: Update OS X 10.6+ installer to use Tcl/Tk 8.5.15.
  • Issue #14499: Fix several problems with OS X universal build support
  • Issue #19019: Change the OS X installer build script to use CFLAGS instead of OPT for special build options. By setting OPT, some compiler-specific options like -fwrapv were overridden and thus not used, which could result in broken interpreters when building with clang.

New in Python 3.4.0 Alpha 2 (Sep 9, 2013)

  • PEP 446, changing file descriptors to not be inherited by default in subprocesses

New in Python 3.4.0 Alpha 1 (Aug 5, 2013)

  • 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

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.1 RC 1 (Mar 26, 2013)

  • 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 (Sep 30, 2012)

  • New syntax features:
  • New yield from expression for generator delegation.
  • The u'unicode' syntax is accepted again for str objects.
  • New library modules:
  • faulthandler (helps debugging low-level crashes)
  • ipaddress (high-level objects representing IP addresses and masks)
  • lzma (compress data using the XZ / LZMA algorithm)
  • unittest.mock (replace parts of your system under test with mock objects)
  • venv (Python virtual environments, as in the popular virtualenv package)
  • New built-in features:
  • Reworked I/O exception hierarchy.
  • Implementation improvements:
  • Rewritten import machinery based on importlib.
  • More compact unicode strings.
  • More compact attribute dictionaries.
  • Significantly Improved Library Modules:
  • C Accelerator for the decimal module.
  • Better unicode handling in the email module (provisional).
  • Security improvements:
  • Hash randomization is switched on by default.

New in Python 3.3.0 RC 3 (Sep 25, 2012)

  • New syntax features:
  • New yield from expression for generator delegation.
  • The u'unicode' syntax is accepted again for str objects.
  • New library modules:
  • faulthandler (helps debugging low-level crashes)
  • ipaddress (high-level objects representing IP addresses and masks)
  • lzma (compress data using the XZ / LZMA algorithm)
  • unittest.mock (replace parts of your system under test with mock objects)
  • venv (Python virtual environments, as in the popular virtualenv package)
  • New built-in features:
  • Reworked I/O exception hierarchy.
  • Implementation improvements:
  • Rewritten import machinery based on importlib.
  • More compact unicode strings.
  • More compact attribute dictionaries.
  • Security improvements:
  • Hash randomization is switched on by default.

New in Python 3.3.0 RC 2 (Sep 12, 2012)

  • New syntax features:
  • New yield from expression for generator delegation.
  • The u'unicode' syntax is accepted again for str objects.
  • New library modules:
  • faulthandler (helps debugging low-level crashes)
  • ipaddress (high-level objects representing IP addresses and masks)
  • lzma (compress data using the XZ / LZMA algorithm)
  • venv (Python virtual environments, as in the popular virtualenv package)
  • New built-in features:
  • Reworked I/O exception hierarchy.
  • Implementation improvements:
  • Rewritten import machinery based on importlib.
  • More compact unicode strings.
  • More compact attribute dictionaries.
  • Security improvements:
  • Hash randomization is switched on by default.

New in Python 3.3.0 Beta 1 (Jun 27, 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 80x speedup for decimal-heavy applications
  • The import system (__import__) now 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 Alpha 4 (Jun 6, 2012)

  • New packaging infrastructure
  • PEP 3118: New memoryview implementation and buffer protocol documentation
  • PEP 393: Flexible String Representation
  • PEP 3151: Reworking the OS and IO exception hierarchy
  • PEP 380: Syntax for Delegating to a Subgenerator
  • PEP 409: Suppressing exception context
  • PEP 414: Explicit Unicode literals
  • PEP 3155: Qualified name for classes and functions
  • Using importlib as the Implementation of Import
  • New Email Package Features
  • Other Language Changes
  • A Finer-Grained Import Lock
  • New and Improved Modules
  • Optimizations
  • Build and C API Changes
  • Porting to Python 3.3

New in Python 3.2.3 (Apr 12, 2012)

  • Work around a problem building extension modules under Windows 14 by undefining ``small`` before use in the Python headers.

New in Python 3.2.3 RC2 (Mar 19, 2012)

  • Library:
  • Issue #6884: Fix long-standing bugs with MANIFEST.in parsing in distutils on Windows.
  • Extension Modules:
  • Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes in the hash table internal to the pyexpat module's copy of the expat library to avoid a denial of service due to hash collisions. Patch by David Malcolm with some modifications by the expat project.

New in Python 3.3.0 Alpha 1 (Mar 5, 2012)

  • Syntax for Delegating to a Subgenerator (yield from)
  • Flexible String Representation (doing away with the distinction between "wide" and "narrow" Unicode builds)
  • Suppressing Exception Context
  • Reworking the OS and IO exception hierarchy
  • The new "packaging" module, building upon the "distribute" and "distutils2" projects and deprecating "distutils"
  • The new "lzma" module with LZMA/XZ support
  • Qualified name for classes and functions
  • Explicit Unicode literals to help with porting
  • The new "faulthandler" module that helps diagnosing crashes
  • Wrappers for many more POSIX functions in the "os" and "signal" modules, as well as other useful functions such as "sendfile()"

New in Python 3.2.2 (Sep 5, 2011)

  • 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 RC1 (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 RC2 (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 Beta 1 (Dec 8, 2010)

  • 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
  • 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
  • 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 3.1.3 (Nov 29, 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. Patch by Sridhar Ratnakumar.
  • 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.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 3.1.1 (Aug 17, 2009)

  • Core and Builtins:
  • Issue #6707: dir() on an uninitialized module caused a crash.
  • Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
  • Issue #6573: set.union() stopped processing inputs if an instance of self occurred in the argument chain.
  • Issue #6070: On posix platforms import no longer copies the execute bit from the .py file to the .pyc file if it is set.
  • Issue #6428: Since Python 3.0, the __bool__ method must return a bool object, and not an int. Fix the corresponding error message, and the documentation.
  • Issue #6347: Include inttypes.h as well as stdint.h in pyport.h. This fixes a build failure on HP-UX: int32_t and uint32_t are defined in inttypes.h instead of stdint.h on that platform.
  • Issue #6373: Fixed a SystemError when encoding with the latin-1 codec and the 'surrogateescape' error handler, a string which contains unpaired surrogates.
  • C-API:
  • Issue #6624: yArg_ParseTuple with "s" format when parsing argument with NUL: Bogus TypeError detail string.
  • Issue #6405: Remove duplicate type declarations in descrobject.h.
  • The code flags for old __future__ features are now available again.
  • Library:
  • Issue #6106: telnetlib.Telnet.process_rawq doesn't handle default WILL/WONT DO/DONT correctly.
  • Issue #6126: Fixed pdb command-line usage.
  • Issue #6629: Fix a data corruption issue in the new I/O library, which could occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or "wb+" mode) after having buffered a certain amount of data for reading. This bug was not present in the pure Python implementation.
  • Issue #6622: Fix "local variable 'secret' referenced before assignment" bug in POP3.apop.
  • Issue #6637: defaultdict.copy() did not work when the default factory was left unspecified. Also, the eval/repr round-trip would fail when the default_factory was None.
  • Issue #2715: Remove remnants of Carbon.File from binhex module.
  • Issue #6595: The Decimal constructor now allows arbitrary Unicode decimal digits in input, as recommended by the standard. Previously it was restricted to accepting [0-9].
  • Issues #5155, #5313, #5331: multiprocessing.Process._bootstrap was unconditionally calling "os.close(sys.stdin.fileno())" resulting in file descriptor errors
  • Issue #1424152: Fix for http.client, urllib.request to support SSL while working through proxy. Original patch by Christopher Li, changes made by Senthil Kumaran
  • importlib.abc.PyLoader did not inherit from importlib.abc.ResourceLoader like the documentation said it did even though the code in PyLoader relied on the abstract method required by ResourceLoader.
  • Issue #6431: Make Fraction type return NotImplemented when it doesn't know how to handle a comparison without loss of precision. Also add correct handling of infinities and nans for comparisons with float.
  • Issue #6415: Fixed warnings.warn segfault on bad formatted string.
  • Issue #6358: The exit status of a command started with os.popen() was reported differently than it did with python 2.x.
  • Issue #6323: The pdb debugger did not exit when running a script with a syntax error.
  • Issue #3392: The subprocess communicate() method no longer fails in select() when file descriptors are large; communicate() now uses poll() when possible.
  • Issue #6369: Fix an RLE decompression bug in the binhex module.
  • Issue #6344: Fixed a crash of mmap.read() when passed a negative argument.
  • Issue #4005: Fixed a crash of pydoc when there was a zip file present in sys.path.
  • Extension Modules:
  • Fix a segfault in expat.
  • Issue #4509: array.array objects are no longer modified after an operation failing due to the resize restriction in-place when the object has exported buffers.
  • Build:
  • Issue 4601: 'make install' did not set the appropriate permissions on directories.
  • Issue 5390: Add uninstall icon independent of whether file extensions are installed.
  • Test:
  • Fix a test in importlib.test.source.test_abc_loader that was incorrectly testing when a .pyc file lacked an code object bytecode.

New in Python 3.1 (Jun 29, 2009)

  • Core and Builtins:
  • Issue #6334: Fix bug in range length calculation for ranges with large arguments.
  • Issue #6329: Fixed iteration for memoryview objects (it was being blocked because it wasn't recognized as a sequence).
  • Library:
  • Issue #6314: logging.basicConfig() performs extra checks on the "level" argument.
  • Issue #6274: Fixed possible file descriptors leak in subprocess.py
  • Accessing io.StringIO.buffer now raises an AttributeError instead of io.UnsupportedOperation.
  • Issue #6271: mmap tried to close invalid file handle (-1) when anonymous. (On Unix)
  • Issue #1202: zipfile module would cause a struct.error when attempting to store files with a CRC32 > 2**31-1.
  • Extension Modules
  • Issue #5590: Remove unused global variable in pyexpat extension.

New in Python 3.1 RC 2 (Jun 15, 2009)

  • Core and Builtins:
  • Fixed SystemError triggered by "range([], 1, -1)".
  • Issue #5924: On Windows, a large PYTHONPATH environment variable (more than 255 characters) would be completely ignored.
  • Issue #4547: When debugging a very large function, it was not always possible to update the lineno attribute of the current frame.
  • Issue #5330: C functions called with keyword arguments were not reported by the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
  • Library:
  • Issue #6258: Support AMD64 in bdist_msi.
  • Issue #6195: fixed doctest to no longer try to read 'source' data from binary files.
  • Issue #5262: Fixed bug in next rollover time computation in TimedRotatingFileHandler.
  • Issue #6217: The C implementation of io.TextIOWrapper didn't include the errors property. Additionally, the errors and encoding properties of StringIO are always None now.
  • Issue #6137: The pickle module now translates module names when loading or dumping pickles with a 2.x-compatible protocol, in order to make data sharing and migration easier. This behaviour can be disabled using the new `fix_imports` optional argument.
  • Removed the ipaddr module.
  • Issue #3613: base64.{encode,decode}string are now called base64.{encode,decode}bytes which reflects what type they accept and return.
  • The old names are still there as deprecated aliases.
  • Issue #5767: Remove sgmlop support from xmlrpc.client.
  • Issue #6150: Fix test_unicode on wide-unicode builds.
  • Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty parameters.
  • C-API:
  • Issue #5735: Python compiled with --with-pydebug should throw an ImportError when trying to import modules compiled without--with-pydebug, and vice-versa.
  • Build:
  • Issue #6154: Make sure the intl library is added to LIBS if needed. Also added LIBS to OS X framework builds.
  • Issue #5809: Specifying both --enable-framework and --enable-shared is an error. Configure now explicity tells you about this.

New in Python 3.1 Alpha 2 (Apr 16, 2009)

  • Core and Builtins:
  • Implement PEP 378, Format Specifier for Thousands Separator, for integers.
  • Issue #5666: Py_BuildValue's 'c' code should create byte strings.
  • Issue #5499: The 'c' code for argument parsing functions now only accepts a byte, and the 'C' code only accepts a unicode character.
  • Issue #1665206: Remove the last eager import in _warnings.c and make it lazy.
  • Fix a segfault when running test_exceptions with coverage, caused by insufficient checks in accessors of Exception.__context__.
  • Issue #5604: non-ASCII characters in module name passed to imp.find_module() were converted to UTF-8 while the path is converted to the default filesystem encoding, causing nonsense.
  • Issue #5126: str.isprintable() returned False for space characters.
  • Issue #4865: On MacOSX /Library/Python/2.7/site-packages is added to the end sys.path, for compatibility with the system install of Python.
  • Issue #4688: Add a heuristic so that tuples and dicts containing only untrackable objects are not tracked by the garbage collector. This can reduce the size of collections and therefore the garbage collection overhead on long-running programs, depending on their particular use of datatypes.
  • Issue #5512: Rewrite PyLong long division algorithm (x_divrem) to improve its performance. Long divisions and remainder operations are now between 50% and 150% faster.
  • Issue #4258: Make it possible to use base 2**30 instead of base 2**15 for the internal representation of integers, for performance reasons. Base 2**30 is enabled by default on 64-bit machines. Add --enable-big-digits option to configure, which overrides the default. Add sys.int_info structseq to provide information about the internal format.
  • Issue #4474: PyUnicode_FromWideChar now converts characters outside the BMP to surrogate pairs, on systems with sizeof(wchar_t) == 4 and sizeof(Py_UNICODE) == 2.
  • Issue #5237: Allow auto-numbered fields in str.format(). For example: '{} {}'.format(1, 2) == '1 2'.
  • Issue #5392: when a very low recursion limit was set, the interpreter would abort with a fatal error after the recursion limit was hit twice.
  • Issue #3845: In PyRun_SimpleFileExFlags avoid invalid memory access with short file names.
  • Py_DECREF: Add `do { ... } while (0)' to avoid compiler warnings.
  • Library:
  • Issue 2625: added missing items() call to the for loop in mailbox.MH.get_message().
  • Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat error substitutions from non-strict codec error callbacks in incrementalencoder and StreamWriter.
  • Issue #5656: Fix the coverage reporting when running the test suite with the -T argument.
  • Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
  • Issue #5624: Fix the _winreg module name still used in several modules.
  • Issue #5628: Fix io.TextIOWrapper.read() with a unreadable buffer.
  • Issue #5619: Multiprocessing children disobey the debug flag and causes popups on windows buildbots. Patch applied to work around this issue.
  • Issue #5400: Added patch for multiprocessing on netbsd compilation/support
  • Issue #5387: Fixed mmap.move crash by integer overflow.
  • Issue #5261: Patch multiprocessing's semaphore.c to support context manager use: "with multiprocessing.Lock()" works now.
  • Issue #5236: Change time.strptime() to only take strings. Didn't work with bytes already but the failure was non-obvious.
  • Issue #5177: Multiprocessing's SocketListener class now uses socket.SO_REUSEADDR on all connections so that the user no longer needs to wait 120 seconds for the socket to expire.
  • Issue #5595: Fix UnboundedLocalError in ntpath.ismount().
  • Issue #1174606: Calling read() without arguments of an unbounded file (typically /dev/zero under Unix) could crash the interpreter.
  • The max_buffer_size arguments of io.BufferedWriter, io.BufferedRWPair, and io.BufferedRandom have been deprecated for removal in Python 3.2.
  • Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop forever on incomplete input. That caused tarfile.open() to hang when used with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or partial bzip2 compressed data.
  • Issue #2110: Add support for thousands separator and 'n' type specifier to Decimal.__format__
  • Fix Decimal.__format__ bug that swapped the meanings of the '' alignment characters.
  • The error detection code in FileIO.close() could fail to reflect the `errno` value, and report it as -1 instead.
  • Issue #5016: FileIO.seekable() could return False if the file position was negative when truncated to a C int. Patch by Victor Stinner.
  • Extension Modules:
  • Issue #5391: mmap now deals exclusively with bytes.
  • Issue #5463: In struct module, remove deprecated overflow wrapping when packing an integer: struct.pack('=L', -1) now raises struct.error instead of returning b'xffxffxffxff'. The _PY_STRUCT_RANGE_CHECKING and _PY_STRUCT_OVERFLOW_MASKING constants have been removed from the struct module.

New in Python 2.6.1 (Dec 6, 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 #4367: Python would segfault during compiling when the unicodedata module couldn't be imported and N escapes were present.
  • Issue #4348: Some bytearray methods returned that didn't cause any change to the bytearray, returned the same bytearray instead of a copy.
  • Issue #4317: Fixed a crash in the imageop.rgb2rgb8() function.
  • Issue #4230: If ``__getattr__`` is a descriptor, it now functions correctly.
  • Issue #4048: The parser module now correctly validates relative imports.
  • Issue #4225: ``from __future__ import unicode_literals`` didn't work in an exec statement.
  • Issue #4176: Fixed a crash when pickling an object which ``__reduce__`` method does not return iterators for the 4th and 5th items.
  • Issue #4209: Enabling unicode_literals and the print_function in the same __future__ import didn't work.
  • On windows, os.chdir given unicode was not working if GetCurrentDirectoryW returned a path longer than MAX_PATH. (But It's doubtful this code path is really executed because I cannot move to such directory on win2k)
  • Issue #4069: When set.remove(element) is used with a set element, the element is temporarily replaced with an equivalent frozenset. But the eventual KeyError would always report the empty frozenset([]) as the missing key. Now it correctly refers to the initial element.
  • Fixed C99 style comments in several files. Python is now C89 compatible again.
  • Library:
  • Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception.
  • Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if the ctypes module is not present.
  • Issue #4116: Resolve member name conflict in ScrolledCanvas.__init__.
  • Issue #3774: Fixed an error when create a Tkinter menu item without command and then remove it.
  • Fixed a modulefinder crash on certain relative imports.
  • Issue #4150: Pdb's "up" command now works for generator frames in post-mortem debugging.
  • Issue #4092: Return ArgInfo as promised in the documentation from inspect.getargvalues.
  • Issue #3935: Properly support list subclasses in bisect's C implementation.
  • Issue #4014: Don't claim that Python has an Alpha release status, in addition to claiming it is Mature.
  • Build:
  • Issue #4389: Add icon to the uninstall entry in "add-and-remove-programs".
  • Issue #4289: Remove Cancel button from AdvancedDlg.
  • Issue #1656675: Register a drop handler for .py* files on Windows.
  • 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 #3758: Add ``patchcheck`` build target to .PHONY.
  • Issue #4204: Fixed module build errors on FreeBSD 4.
  • C-API:
  • Issue #4122: On Windows, fix a compilation error when using the Py_UNICODE_ISSPACE macro in an extension module.
  • Extension Modules:
  • Issue #4365: Add crtassem.h constants to the msvcrt module.
  • Issue #4396: The parser module now correctly validates the with statement.

New in Python 3.0 (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 2.6.0 (Oct 2, 2008)

  • Some significant new packages have been added to the standard library, such as the multiprocessing and json modules, but there aren’t many new features that aren’t related to Python 3.0 in some way.
  • Python 2.6 also sees a number of improvements and bugfixes throughout the source. A search through the change logs finds there were 259 patches applied and 612 bugs fixed between Python 2.5 and 2.6. Both figures are likely to be underestimates.

New in Python 2.5.2 (Feb 25, 2008)

  • Fix deallocation of array objects when allocation ran out of memory. Remove array test case that was incorrect on 64-bit systems.
  • Bug #2137: Remove test_struct.test_crasher, which was meaningful only on 32-bit systems.

New in Python 2.5.2 RC1 (Feb 19, 2008)

  • Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
  • Issue #2045: Fix an infinite recursion triggered when printing a subclass of collections.defaultdict, if its default_factory is set to a bound method.
  • Issue #1920: "while 0" statements were completely removed by the compiler, even in the presence of an "else" clause, which is supposed to be run when the condition is false. Now the compiler correctly emits bytecode for the "else" suite.
  • A few crashers fixed: weakref_in_del.py (issue #1377858); loosing_dict_ref.py (issue #1303614, test67.py); borrowed_ref_[34].py (not in tracker).
  • Fix for #1303614 and #1174712 backported from the trunk: __dict__ descriptor abuse for subclasses of built-in types; subclassing from both ModuleType and another built-in types.
  • Bug #1915: Python compiles with --enable-unicode=no again. However several extension methods and modules do not work without unicode support.
  • Issue #1678380: distinction between 0.0 and -0.0 was lost during constant folding optimization. This was a regression from Python 2.4.
  • Issue #1882: when compiling code from a string, encoding cookies in the second line of code were not always recognized correctly.
  • Bug #1517: Possible segfault in lookup().
  • Issue #1638: %zd configure test fails on Linux.
  • Issue #1553: An erroneous __length_hint__ can make list() raise a SystemError.
  • Issue #1521: On 64bit platforms, using PyArgs_ParseTuple with the t# of w# format code incorrectly truncated the length to an int, even when PY_SSIZE_T_CLEAN is set. The str.decode method used to return incorrect results with huge strings.
  • Issue #1445: Fix a SystemError when accessing the ``cell_contents`` attribute of an empty cell object.
  • Issue #1265: Fix a problem with sys.settrace, if the tracing function uses a generator expression when at the same time the executed code is closing a paused generator.
  • Issue 1704621: Fix segfaults in list_repeat() and list_inplace_repeat().
  • Issue #1147: Generators were not raising a DeprecationWarning when a string was passed into throw().
  • Patch #1031213: Decode source line in SyntaxErrors back to its original source encoding.
  • Patch #1673759: add a missing overflow check when formatting floats with %G.
  • Patch #1733960: Allow T_LONGLONG to accept ints.
  • Prevent expandtabs() on string and unicode objects from causing a segfault when a large width is passed on 32-bit platforms.
  • Bug #1733488: Fix compilation of bufferobject.c on AIX.
  • Fix Issue #1703448: A joined thread could show up in the threading.enumerate() list after the join() for a brief period until it actually exited.
  • Patch #1966: Break infinite loop in httplib when the servers implements the chunked encoding incorrectly.
  • tarfile.py: Fix reading of xstar archives.
  • #2021: Allow tempfile.NamedTemporaryFile to be used in with statements by correctly supporting the context management protocol.
  • Fixed _ctypes.COMError so that it must be called with exactly three arguments, instances now have the hresult, text, and details instance variables.
  • #1507247, #2004: tarfile.py: Use mode 0700 for temporary directories and default permissions for missing directories.
  • #175006: The debugger used to skip the condition of a "while" statement after the first iteration. Now it correctly steps on the expression, and breakpoints on the "while" statement are honored on each loop.
  • The ctypes int types did not accept objects implementing __int__() in the constructor.
  • #1189216: Fix the zipfile module to work on archives with headers past the 2**31 byte boundary.
  • Issue #1336: fix a race condition in subprocess.Popen if the garbage collector kicked in at the wrong time that would cause the process to hang when the child wrote to stderr.
  • Bug #1687: Fixed plistlib.py restricts to Python int when writing.
  • Issue #1182: many arithmetic bugs in the decimal module have been fixed, and the decimal module has been updated to comply with the latest IBM Decimal Arithmetic specification (version 1.66) and testsuite (version 2.57). (Backported from Python 2.6a0.)
  • Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.
  • Issue #1735: TarFile.extractall() now correctly sets directory permissions and times.
  • Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a mountpoint.
  • Issue #1700: Regular expression inline flags incorrectly handle certain unicode characters.
  • Change ctypes version number to 1.0.3 (when Python 2.5.2 is released, ctypes 1.0.3 will be also be released).
  • Issue #1695: Fixed typo in the docstrings for time.localtime() and gmtime().
  • Issue #1642: Fix segfault in ctypes when trying to delete attributes.
  • os.access now returns True on Windows for any existing directory.
  • Issue #1531: tarfile.py: Read fileobj from the current offset, do not seek to the start.
  • Issue 1429818: patch for trace and doctest modules so they play nicely together.
  • doctest mis-used __loader__.get_data(), assuming universal newlines was used.
  • Issue #1705170: contextlib.contextmanager was still swallowing StopIteration in some cases. This should no longer happen.
  • Bug #1307: Fix smtpd so it doesn't raise an exception when there is no arg.
  • ctypes will now work correctly on 32-bit systems when Python is configured with --with-system-ffi.
  • Bug #1777530: ctypes.util.find_library uses dump(1) instead of objdump(1) on Solaris.
  • Bug #1153: repr.repr() now doesn't require set and dictionary items to be orderable to properly represent them.
  • Bug #1709599: Run test_1565150 only if the file system is NTFS.
  • When encountering a password-protected robots.txt file the RobotFileParser no longer prompts interactively for a username and password (bug 813986).
  • TarFile.__init__() no longer fails if no name argument is passed and the fileobj argument has no usable name attribute (e.g. StringIO).
  • Reverted the fix for bug #1548891 because it broke compatibility with arbitrary read buffers. Added a note in the documentation.
  • GB18030 codec now can encode additional two-byte characters that are missing in GBK.
  • Bug #1704793: Raise KeyError if unicodedata.lookup cannot represent the result in a single character.
  • Change location of the package index to pypi.python.org/pypi
  • Bug #1701409: Fix a segfault in printing ctypes.c_char_p and ctypes.c_wchar_p when they point to an invalid location. As a sideeffect the representation of these instances has changed.
  • Bug #1734723: Fix repr.Repr() so it doesn't ignore the maxtuple attribute.
  • Bug #1728403: Fix a bug that CJKCodecs StreamReader hangs when it reads a file that ends with incomplete sequence and sizehint argument for .read() is specified.
  • Bug #1730389: Have time.strptime() match spaces in a format argument with ``s `` instead of ``s*``.
  • SF 1668596/1720897: distutils now copies data files even if package_dir is empty.
  • Fix bug in marshal where bad data would cause a segfault due to lack of an infinite recursion check.
  • mailbox.py: Ignore stray directories found in Maildir's cur/new/tmp subdirectories.
  • HTML-escape the plain traceback in cgitb's HTML output, to prevent the traceback inadvertently or maliciously closing the comment and injecting HTML into the error page.
  • Bug #1290505: Properly clear time.strptime's locale cache when the locale changes between calls. Backport of r54646 and r54647.
  • Bug #1706381: Specifying the SWIG option "-c " in the setup.py file (as opposed to the command line) will now write file names ending in ".cpp" too.
  • Patch #1695229: Fix a regression with tarfile.open() and a missing name argument.
  • tarfile.py: Fix directory names to have only one trailing slash.
  • Fix test_pty.py to not hang on OS X (and theoretically other *nixes) when run in verbose mode.
  • Bug #1693258: IDLE would show two "Preferences" menu's with some versions of Tcl/Tk
  • Issue1385: The hmac module now computes the correct hmac when using hashes with a block size other than 64 bytes (such as sha384 and sha512).
  • Issue829951: In the smtplib module, SMTP.starttls() now complies with RFC 3207 and forgets any knowledge obtained from the server not obtained from the TLS negotiation itself. Patch contributed by Bill Fenner.
  • Patch #1736: Fix file name handling of _msi.FCICreate.
  • Backport r59862 (issue #712900): make long regexp matches interruptable.
  • #1940: make it possible to use curses.filter() before curses.initscr() as the documentation says.
  • Fix a potential 'SystemError: NULL result without error' in _ctypes.
  • Bug #1301: Bad assert in _tkinter fixed.
  • Patch #1114: fix curses module compilation on 64-bit AIX, & possibly other 64-bit LP64 platforms where attr_t is not the same size as a long. (Contributed by Luke Mewburn.)
  • Bug #1649098: Avoid declaration of zero-sized array declaration in structure.
  • Bug #1703286: ctypes no longer truncates 64-bit pointers.
  • Bug #1721309: prevent bsddb module from freeing random memory.
  • Bug #1233: fix bsddb.dbshelve.DBShelf append method to work as intended for RECNO databases.
  • Bug #1726026: Correct the field names of WIN32_FIND_DATAA and WIN32_FIND_DATAW structures in the ctypes.wintypes module.
  • Added support for linking the bsddb module against BerkeleyDB 4.6.x.
  • Fix libffi configure for hppa*-*-linux* | parisc*-*-linux*.
  • Build using system ffi library on arm*-linux*.
  • Bug #1372: zlibmodule.c: int overflow in PyZlib_decompress
  • bsddb module: Fix memory leak when using database cursors on databases without a DBEnv.
  • Bug #1637365: add subsection about "__name__ == __main__" to the Python tutorial.
  • Bug #1569057: Document that calling file.next() on a file open for writing has undefined behaviour. Backport of r54712.
  • Have the search path for building extensions follow the declared order in $CPPFLAGS and $LDFLAGS.
  • Bug #1234: Fixed semaphore errors on AIX 5.2
  • Bug #1699: Define _BSD_SOURCE only on OpenBSD.
  • Bug #1608: use -fwrapv when GCC supports it. This is important, newer GCC versions may optimize away overflow buffer overflow checks without this option!
  • Allow simultaneous installation of 32-bit and 64-bit versions on 64-bit Windows systems.
  • Patch #786737: Allow building in a tree of symlinks pointing to a readonly source.
  • Bug #1737210: Change Manufacturer of Windows installer to PSF.
  • Bug #1746880: Correctly install DLLs into system32 folder on Win64.
  • Define _BSD_SOURCE, to get access to POSIX extensions on OpenBSD 4.1 .
  • Patch #1673122: Use an explicit path to libtool when building a framework. This avoids picking up GNU libtool from a users PATH.
  • Allow Emacs 22 for building the documentation in info format.
  • Makefile.pre.in(buildbottest): Run an optional script pybuildbot.identify to include some information about the build environment.