创新互联Python教程:更新日志

更新日志

python next

Release date: XXXX-XX-XX

网站建设哪家好,找创新互联!专注于网页设计、网站建设、微信开发、小程序开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了乌鲁木齐免费建站欢迎大家使用!

Security

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

Library

  • gh-74044: Fixed bug where inspect.signature() reported incorrect arguments for decorated methods.

  • 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-97928: tkinter.Text.count() raises now an exception for options starting with “-“ instead of silently ignoring them.

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

    to

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

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

Documentation

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

Tests

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

Build

  • gh-99086: Fix -Wimplicit-int compiler warning in configure check for PTHREAD_SCOPE_SYSTEM.

  • gh-97731: Specify the full path to the source location for make docclean (needed for cross-builds).

  • 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-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 适用于Windows的Python启动器 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 Python\deepfreeze and Python\frozen_modules directories on Windows. Patch by Charlie Zhao.

macOS

  • gh-94328: Update macOS installer to SQLite 3.39.4.

IDLE

  • gh-97527: Fix a bug in the previous bugfix that caused IDLE to not start when run with 3.10.8, 3.12.0a1, and at least Microsoft Python 3.10.2288.0 installed without the Lib/test package. 3.11.0 was never affected.

Tools/Demos

  • gh-95853: The wasm_build.py script now pre-builds Emscripten ports, checks for broken EMSDK versions, and warns about pkg-config env vars.

  • gh-95853: The new tool Tools/wasm/wasm_builder.py automates configure, compile, and test steps for building CPython on WebAssembly platforms.

  • gh-95731: Fix handling of module docstrings in Tools/i18n/pygettext.py.

C API

  • gh-98724: The Py_CLEAR, Py_SETREF and Py_XSETREF macros now only evaluate their argument once. If the argument has side effects, these side effects are no longer duplicated. Patch by Victor Stinner.

  • gh-98978: Fix use-after-free in Py_SetPythonHome(NULL), Py_SetProgramName(NULL) and _Py_SetProgramFullPath(NULL) function calls. Issue reported by Benedikt Reinartz. Patch by Victor Stinner.

  • gh-96853: Py_InitializeEx now correctly calls PyConfig_Clear after initializing the interpreter (the omission didn’t cause a memory leak only because none of the dynamically allocated config fields are populated by the wrapper function)

Python 3.11.0 final

Release date: 2022-10-24

Security

  • gh-97616: Fix multiplying a list by an integer (list *= int): detect the integer overflow when the new allocated length is close to the maximum size. Issue reported by Jordan Limor. Patch by Victor Stinner.

  • gh-97514: On Linux the multiprocessing module returns to using filesystem backed unix domain sockets for communication with the forkserver process instead of the Linux abstract socket namespace. Only code that chooses to use the “forkserver” start method is affected.

    Abstract sockets have no permissions and could allow any user on the system in the same network namespace (often the whole system) to inject code into the multiprocessing forkserver process. This was a potential privilege escalation. Filesystem based socket permissions restrict this to the forkserver process user as was the default in Python 3.8 and earlier.

    This prevents Linux CVE-2022-42919.

Core and Builtins

  • gh-97002: Fix an issue where several frame objects could be backed by the same interpreter frame, possibly leading to corrupted memory and hard crashes of the interpreter.

  • gh-97752: Fix possible data corruption or crashes when accessing the f_back member of newly-created generator or coroutine frames.

  • gh-96975: Fix a crash occurring when PyEval_GetFrame() is called while the topmost Python frame is in a partially-initialized state.

  • gh-96848: Fix command line parsing: reject -X int_max_str_digits option with no value (invalid) when the PYTHONINTMAXSTRDIGITS environment variable is set to a valid limit. Patch by Victor Stinner.

  • gh-96821: Fix undefined behaviour in _testcapimodule.c.

  • gh-95778: When ValueError is raised if an integer is larger than the limit, mention the sys.set_int_max_str_digits() function in the error message. Patch by Victor Stinner.

  • gh-96587: Correctly raise SyntaxError on exception groups (PEP 654) on python versions prior to 3.11

  • bpo-42316: Document some places where an assignment expression needs parentheses.

Library

  • gh-98331: Update the bundled copies of pip and setuptools to versions 22.3 and 65.5.0 respectively.

  • gh-90985: Earlier in 3.11 we deprecated asyncio.Task.cancel("message"). We realized we were too harsh, and have undeprecated it.

  • gh-97545: Make Semaphore run faster.

  • gh-96865: fix Flag to use boundary CONFORM

    This restores previous Flag behavior of allowing flags with non-sequential values to be combined; e.g.

    class Skip(Flag): TWO = 2 EIGHT = 8

    Skip.TWO | Skip.EIGHT ->

  • gh-90155: Fix broken asyncio.Semaphore when acquire is cancelled.

Documentation

  • gh-97741: Fix ! in c domain ref target syntax via a conf.py patch, so it works as intended to disable ref target resolution.

  • gh-93031: Update tutorial introduction output to use 3.10+ SyntaxError invalid range.

Tests

  • gh-95027: On Windows, when the Python test suite is run with the -jN option, the ANSI code page is now used as the encoding for the stdout temporary file, rather than using UTF-8 which can lead to decoding errors. Patch by Victor Stinner.

Build

  • gh-96729: Ensure that Windows releases built with Tools\msi\buildrelease.bat are upgradable to and from official Python releases.

Windows

  • gh-98360: Fixes multiprocessing spawning child processes on Windows from a virtual environment to ensure that child processes that also use multiprocessing to spawn more children will recognize that they are in a virtual environment.

  • gh-98414: Fix py.exe launcher handling of -V:/ option when default preferences have been set in environment variables or configuration files.

  • gh-90989: Clarify some text in the Windows installer.

macOS

  • gh-97897: The macOS 13 SDK includes support for the mkfifoat and mknodat system calls. Using the dir_fd option with either os.mkfifo() or os.mknod() could result in a segfault if cpython is built with the macOS 13 SDK but run on an earlier version of macOS. Prevent this by adding runtime support for detection of these system calls (“weaklinking”) as is done for other newer syscalls on macOS.

Python 3.11.0 release candidate 2

Release date: 2022-09-11

Security

  • gh-95778: Converting between int and str in bases other than 2 (binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) now raises a ValueError if the number of digits in string form is above a limit to avoid potential denial of service attacks due to the algorithmic complexity. This is a mitigation for CVE-2020-10735.

    This new limit can be configured or disabled by environment variable, command line flag, or sys APIs. See the integer string conversion length limitation documentation. The default limit is 4300 digits in string form.

    Patch by Gregory P. Smith [Google] and Christian Heimes [Red Hat] with feedback from Victor Stinner, Thomas Wouters, Steve Dower, Ned Deily, and Mark Dickinson.

Core and Builtins

  • gh-96678: Fix case of undefined behavior in ceval.c

  • gh-96641: Do not expose KeyWrapper in _functools.

  • gh-96636: Ensure that tracing, sys.setrace(), is turned on immediately. In pre-release versions of 3.11, some tracing events might have been lost when turning on tracing in a __del__ method or interrupt.

  • gh-96572: Fix use after free in trace refs build mode. Patch by Kumar Aditya.

  • gh-96611: When loading a file with invalid UTF-8 inside a multi-line string, a correct SyntaxError is emitted.

  • gh-96612: Make sure that incomplete frames do not show up in tracemalloc traces.

  • gh-96569: Remove two cases of undefined behavior, by adding NULL checks.

  • gh-96582: Fix possible NULL pointer dereference in _PyThread_CurrentFrames. Patch by Kumar Aditya.

  • gh-96352: Fix AttributeError missing name and obj attributes in object.__getattribute__(). Patch by Philip Georgi.

  • gh-96268: Loading a file with invalid UTF-8 will now report the broken character at the correct location.

  • gh-96187: Fixed a bug that caused _PyCode_GetExtra to return garbage for negative indexes. Patch by Pablo Galindo

  • gh-96071: Fix a deadlock in PyGILState_Ensure() when allocating new thread state. Patch by Kumar Aditya.

  • gh-96046: PyType_Ready() now initializes ht_cached_keys and performs additional checks to ensure that type objects are properly configured. This avoids crashes in 3rd party packages that don’t use regular API to create new types.

  • gh-95818: Skip over incomplete frames in PyThreadState_GetFrame().

  • gh-95876: Fix format string in _PyPegen_raise_error_known_location that can lead to memory corruption on some 64bit systems. The function was building a tuple with i (int) instead of n (Py_ssize_t) for Py_ssize_t arguments.

  • gh-95605: Fix misleading contents of error message when converting an all-whitespace string to float.

  • gh-94996: ast.parse() will no longer parse function definitions with positional-only params when passed feature_version less than (3, 8). Patch by Shantanu Jain.

Library

  • gh-96700: Fix incorrect error message in the io module.

  • gh-96652: Fix the faulthandler implementation of faulthandler.register(signal, chain=True) if the sigaction() function is not available: don’t call the previous signal handler if it’s NULL. Patch by Victor Stinner.

  • gh-68163: Correct conversion of numbers.Rational‘s to float.

  • gh-96385: Fix TypeVarTuple.__typing_prepare_subst__. TypeError was not raised when using more than one TypeVarTuple, like [*T, *V] in type alias substitutions.

  • gh-90467: Fix asyncio.streams.StreamReaderProtocol to keep a strong reference to the created task, so that it’s not garbage collected

  • gh-96159: Fix a performance regression in logging TimedRotatingFileHandler. Only check for special files when the rollover time has passed.

  • gh-96175: Fix unused localName parameter in the Attr class in xml.dom.minidom.

  • gh-96125: Fix incorrect condition that causes sys.thread_info.name to be wrong on pthread platforms.

  • gh-95463: Remove an incompatible change from bpo-28080 that caused a regression that ignored the utf8 in ZipInfo.flag_bits. Patch by Pablo Galindo.

  • gh-95899: Fix asyncio.Runner to call asyncio.set_event_loop() only once to avoid calling attach_loop() multiple times on child watchers. Patch by Kumar Aditya.

  • gh-95736: Fix unittest.IsolatedAsyncioTestCase to set event loop before calling setup functions. Patch by Kumar Aditya.

  • gh-95704: When a task catches asyncio.CancelledError and raises some other error, the other error should generally not silently be suppressed.

  • gh-95231: Fail gracefully if EPERM or ENOSYS is raised when loading crypt methods. This may happen when trying to load MD5 on a Linux kernel with FIPS enabled.

  • gh-74116: Allow asyncio.StreamWriter.drain() to be awaited concurrently by multiple tasks. Patch by Kumar Aditya.

  • gh-92986: Fix ast.unparse() when ImportFrom.level is None

Documentation

  • gh-96098: Improve discoverability of the higher level concurrent.futures module by providing clearer links from the lower level threading and multiprocessing modules.

  • gh-95957: What’s New 3.11 now has instructions for how to provide compiler and linker flags for Tcl/Tk and OpenSSL on RHEL 7 and CentOS 7.

Tests

  • gh-95243: Mitigate the inherent race condition from using find_unused_port() in testSockName() by trying to find an unused port a few times before failing. Patch by Ross Burton.

Build

  • gh-94682: Build and test with OpenSSL 1.1.1q

Windows

  • gh-96577: Fixes a potential buffer overrun in msilib.

  • gh-96559: Fixes the Windows launcher not using the compatible interpretation of default tags found in configuration files when no tag was passed to the command.

Python 3.11.0 release candidate 1

Release date: 2022-08-05

Core and Builtins

  • gh-95150: Update code object hashing and equality to consider all debugging and exception handling tables. This fixes an issue where certain non-identical code objects could be “deduplicated” during compilation.

  • gh-95355: _PyPegen_Parser_New now properly detects token memory allocation errors. Patch by Honglin Zhu.

  • gh-90081: Run Python code in tracer/profiler function at full speed. Fixes slowdown in earlier versions of 3.11.

  • gh-95324: Emit a warning in debug mode if an object does not call PyObject_GC_UnTrack() before deallocation. Patch by Pablo Galindo.

  • gh-95185: Prevented crashes in the AST constructor when compiling some absurdly long expressions like "+0"*1000000. RecursionError is now raised instead. Patch by Pablo Galindo

  • gh-93351: ast.AST node positions are now validated when provided to compile() and other related functions. If invalid positions are detected, a ValueError will be raised.

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

Library

  • gh-95609: Update bundled pip to 22.2.2.

  • gh-95289: Fix asyncio.TaskGroup to propagate exception when asyncio.CancelledError was replaced with another exception by a context manger. Patch by Kumar Aditya and Guido van Rossum.

  • 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-95097: Fix asyncio.run() for asyncio.Task implementations without uncancel() method. Patch by Kumar Aditya.

  • 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-95109: Ensure that timeouts scheduled with asyncio.Timeout that have already expired are delivered promptly.

  • gh-91810: Suppress writing an XML declaration in open files in ElementTree.write() with encoding='unicode' and xml_declaration=None.

  • gh-91447: Fix findtext in the xml module to only give an empty string when the text attribute is set to None.

Documentation

  • gh-91207: Fix stylesheet not working in Windows CHM htmlhelp docs and add warning that they are deprecated. Contributed by C.A.M. Gerlach.

  • gh-95451: Update library documentation with availability information on WebAssembly platforms wasm32-emscripten and wasm32-wasi.

  • gh-95415: Use consistent syntax for platform availability. The directive now supports a content body and emits a warning when it encounters an unknown platform.

  • gh-86128: Document a limitation in ThreadPoolExecutor where its exit handler is executed before any handlers in atexit.

Tests

  • gh-95573: Lib/test/test_asyncio/test_ssl.py exposed a bug in the macOS kernel where intense concurrent load on non-blocking sockets occasionally causes errno.ENOBUFS (“No buffer space available”) to be emitted. FB11063974 filed with Apple, in the mean time as a workaround buffer size used in tests on macOS is decreased to avoid intermittent failures. Patch by Fantix King.

  • gh-95280: Fix problem with test_ssl test_get_ciphers on systems that require perfect forward secrecy (PFS) ciphers.

  • gh-94675: Add a regression test for re exponentional slowdown when using rjsmin.

Build

  • gh-94801: Fix a regression in configure script that caused some header checks to ignore custom CPPFLAGS. The regression was introduced in gh-94802.

  • gh-95145: wasm32-wasi builds no longer depend on WASIX’s pthread stubs. Python now has its own stubbed pthread API.

  • gh-95174: Python now detects missing dup function in WASI and works around some missing errno, select, and socket constants.

  • gh-95174: Python now skips missing socket functions and methods on WASI. WASI can only create sockets from existing fd / accept and has no netdb.

  • gh-95085: Platforms wasm32-unknown-emscripten and wasm32-unknown-wasi have been promoted to PEP 11 tier 3 platform support.

Windows

  • gh-95656: Enable the enable_load_extension() sqlite3 API.

  • gh-95587: Fixes some issues where the Windows installer would incorrectly detect certain features of an existing install when upgrading.

  • gh-94399: Restores the behaviour of 适用于Windows的Python启动器 for /usr/bin/env shebang lines, which will now search PATH for an executable matching the given command. If none is found, the usual search process is used.

  • gh-95445: Fixes the unsuccessful removal of the HTML document directory when uninstalling with Windows msi.

  • gh-95359: Fix 适用于Windows的Python启动器 handling of py.ini commands (it was incorrectly expecting a py_ prefix on keys) and crashes when reading per-user configuration file.

  • gh-95285: Fix 适用于Windows的Python启动器 handling of command lines where it is only passed a short executable name.

IDLE

  • gh-65802: Document handling of extensions in Save As dialogs.

  • gh-95191: Include prompts when saving Shell (interactive input and output).

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

C API

  • gh-92678: Restore the 3.10 behavior for multiple inheritance of C extension classes that store their dictionary at the end of the struct.

  • gh-94936: Added PyCode_GetVarnames(), PyCode_GetCellvars() and PyCode_GetFreevars() for accessing co_varnames, co_cellvars and co_freevars respectively via the C API.

Python 3.11.0 beta 5

Release date: 2022-07-25

Core and Builtins

  • gh-93351: ast.AST node positions are now validated when provided to compile() and other related functions. If invalid positions are detected, a ValueError will be raised.

  • gh-94438: Fix an issue that caused extended opcode arguments and some conditional pops to be ignored when calculating valid jump targets for assignments to the f_lineno attribute of frame objects. In some cases, this could cause inconsistent internal state, resulting in a hard crash of the interpreter.

  • gh-95060: Undocumented PyCode_Addr2Location function now properly returns when addrq argument is less than zero.

  • gh-95113: Replace all EXTENDED_ARG_QUICK instructions with basic EXTENDED_ARG instructions in unquickened code. Consumers of non-adaptive bytecode should be able to handle extended arguments the same way they were handled in CPython 3.10 and older.

  • gh-91409: Fix incorrect source location info caused by certain optimizations in the bytecode compiler.

  • gh-94036: Fix incorrect source location info for some multi-line attribute accesses and method calls.

  • gh-94739: Allow jumping within, out of, and across exception handlers in the debugger.

  • 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-91256: Ensures the program name is known for help text during interpreter startup.

  • gh-94869: Fix the column offsets for some expressions in multi-line f-strings ast nodes. Patch by Pablo Galindo.

  • gh-94822: Fix an issue where lookups of metaclass descriptors may be ignored when an identically-named attribute also exists on the class itself.

  • gh-91153: Fix an issue where a bytearray item assignment could crash if it’s resized by the new value’s __index__() method.

  • gh-90699: Fix reference counting bug in bool.__repr__(). Patch by Kumar Aditya.

Library

  • 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-95132: Fix a sqlite3 regression where *args and **kwds were incorrectly relayed from connect() to the Connection factory. The regression was introduced in 3.11a1 with PR 24421 (gh-85128). Patch by Erlend E. Aasland.`

  • gh-93157: Fix fileinput module didn’t support errors option when inplace is true.

  • gh-95105: wsgiref.types.InputStream.__iter__() should return Iterator[bytes], not Iterable[bytes]. Patch by Shantanu Jain.

  • gh-94857: Fix refleak in _io.TextIOWrapper.reconfigure. Patch by Kumar Aditya.

  • 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-89988: Fix memory leak in pickle.Pickler when looking up dispatch_table. Patch by Kumar Aditya.

  • bpo-47025: Drop support for bytes on sys.path.

Tests

  • gh-95212: Make multiprocessing test case test_shared_memory_recreate parallel-safe.

Build

  • gh-94847: Fixed _decimal module build issue on GCC when compiling with LTO and pydebug. Debug builds no longer force inlining of functions.

  • gh-94841: Fix the possible performance regression of PyObject_Free() compiled with MSVC version 1932.

  • gh-94801: configure now uses custom flags like ZLIB_CFLAGS and ZLIB_LIBS when searching for headers and libraries.

  • gh-94773: deepfreeze.py now supports code object with frozensets that contain incompatible, unsortable types.

Windows

  • gh-90844: Allow virtual environments to correctly launch when they have spaces in the path.

  • gh-94772: Fix incorrect handling of shebang lines in py.exe launcher

C API

  • gh-92678: Adds unstable C-API functions _PyObject_VisitManagedDict and _PyObject_ClearManagedDict to allow C extensions to allow the VM to manage their object’s dictionaries.

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

  • gh-94731: Python again uses C-style casts for most casting operations when compiled with C++. This may trigger compiler warnings, if they are enabled with e.g. -Wold-style-cast `` or ``-Wzero-as-null-pointer-constant options for g++.

Python 3.11.0 beta 4

Release date: 2022-07-11

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-79096: LWPCookieJar and MozillaCookieJar create files with file mode 600 instead of 644 (Microsoft Windows is not affected)

  • gh-92888: Fix memoryview use after free when accessing the backing buffer in certain cases.

  • gh-68966: The deprecated mailcap module now refuses to inject unsafe text (filenames, MIME types, parameters) into shell commands. Instead of using such text, it will warn and act as if a match was not found (or for test commands, as if the test failed).

Core and Builtins

  • gh-94694: Fix an issue that could cause code with multi-line method lookups to have misleading or incorrect column offset information. In some cases (when compiling a hand-built AST) this could have resulted in a hard crash of the interpreter.

  • gh-93252: Fix an issue that caused internal frames to outlive failed Python function calls, possibly resulting in memory leaks or hard interpreter crashes.

  • gh-94215: Fix an issue where exceptions raised by line-tracing events would cause frames to be left in an invalid state, possibly resulting in a hard crash of the interpreter.

  • gh-92228: Disable the compiler’s inline-small-exit-blocks optimization for exit blocks that are associated with source code lines. This fixes a bug where the debugger cannot tell where an exception handler ends and the following code block begins.

  • gh-94485: Line number of a module’s RESUME instruction is set to 0 as specified in PEP 626.

  • gh-94438: Account for instructions that can push NULL to the stack when setting line number in a frame. Prevents some (unlikely) crashes.

  • gh-91719: Reload opcode when raising unknown opcode error in the interpreter main loop, for C compilers to generate dispatching code independently.

  • 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-88116: Fix an issue when reading line numbers from code objects if the encoded line numbers are close to INT_MIN. Patch by Pablo Galindo

  • gh-94262: Don’t create frame objects for incomplete frames. Prevents the creation of generators and closures from being observable to Python and C extensions, restoring the behavior of 3.10 and earlier.

  • gh-94192: Fix error for dictionary literals with invalid expression as value.

  • gh-93883: Revise the display strategy of traceback enhanced error locations. The indicators are only shown when the location doesn’t span the whole line.

  • gh-94021: Fix unreachable code warning in Python/specialize.c.

  • gh-93516: Store offset of first traceable instruction in code object to avoid having to recompute it for each instruction when tracing.

  • gh-93516: Lazily create a table mapping bytecode offsets to line numbers to speed up calculation of line numbers when tracing.

  • gh-89828: types.GenericAlias no longer relays the __class__ attribute. For example, isinstance(list[int], type) no longer returns True.

  • gh-93671: Fix some exponential backtrace case happening with deeply nested sequence patterns in match statements. Patch by Pablo Galindo

  • gh-93662: Make sure that the end column offsets are correct in multi-line method calls. Previously, the end column could precede the column offset.

  • gh-93461: importlib.invalidate_caches() now drops entries from sys.path_importer_cache with a relative path as name. This solves a caching issue when a process changes its current working directory.

    FileFinder no longer inserts a dot in the path, e.g. /egg/./spam is now /egg/spam.

  • 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-93382: Cache the result of PyCode_GetCode() function to restore the O(1) lookup of the co_code attribute.

  • gh-93354: Use exponential backoff for specialization counters in the interpreter. Can reduce the number of failed specializations significantly and avoid slowdown for those parts of a program that are not suitable for specialization.

  • 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 ‘:’

  • bpo-46142: Make --help output shorter by moving some info to the new --help-env and --help-xoptions command-line options. Also add --help-all option to print complete usage.

Library

  • 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-94607: Fix subclassing complex generics with type variables in typing. Previously an error message saying Some type variables ... are not listed in Generic[...] was shown. typing no longer populates __parameters__ with the __parameters__ of a Python class.

  • gh-93910: The ability to access the other values of an enum on an enum (e.g. Color.RED.BLUE) has been restored in order to fix a performance regression.

  • gh-93896: Fix asyncio.run() and unittest.IsolatedAsyncioTestCase to always the set event loop as it was done in Python 3.10 and earlier. Patch by Kumar Aditya.

  • 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-94398: Once a asyncio.TaskGroup has started shutting down (i.e., at least one task has failed and the task group has started cancelling the remaining tasks), it should not be possible to add new tasks to the task group.

  • gh-94254: Fixed types of struct module to be immutable. Patch by Kumar Aditya.

  • gh-94207: Made _struct.Struct GC-tracked in order to fix a reference leak in the _struct module.

  • gh-91742: Fix pdb crash after jump caused by a null pointer dereference. Patch by Kumar Aditya.

  • 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-94028: Fix a regression in the sqlite3 where statement objects were not properly cleared and reset after use in cursor iters. The regression was introduced by PR 27884 in Python 3.11a1. Patch by Erlend E. Aasland.

  • gh-93820: Pickle enum.Flag by name.

  • gh-93847: Fix repr of enum of generic aliases.

  • gh-91404: Revert the re memory leak when a match is terminated by a signal or memory allocation failure as the implemented fix caused a major performance regression.

  • gh-83499: Fix double closing of file description in tempfile.

  • gh-93820: Fixed a regression when copy.copy()-ing enum.Flag with multiple flag members.

  • gh-79512: Fixed names and __module__ value of weakref classes ReferenceType, ProxyType, CallableProxyType. It makes them pickleable.

  • gh-91389: Fix an issue where dis utilities could report missing or incorrect position information in the presence of CACHE entries.

  • gh-93626: Set __future__.annotations to have a None mandatoryRelease to indicate that it is currently ‘TBD’.

  • gh-90473: Emscripten and WASI have no home directory and cannot provide PEP 370 user site directory.

  • 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-93521: Fixed a case where dataclasses would try to add __weakref__ into the __slots__ for a dataclass that specified weakref_slot=True when it was already defined in one of its bases. This resulted in a TypeError upon the new class being created.

  • 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-91162: Support splitting of unpacked arbitrary-length tuple over TypeVar and TypeVarTuple parameters. For example:

    • A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]]

    • A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]

  • 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-93156: Accessing the pathlib.PurePath.parents sequence of an absolute path using negative index values produced incorrect results.

  • gh-74696: shutil.make_archive() no longer temporarily changes the current working directory during creation of standard .zip or tar archives.

  • 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-92932: Now dis() and get_instructions() handle operand values for instructions prefixed by EXTENDED_ARG_QUICK. Patch by Sam Gross and Dong-hee Na.

  • gh-91577: Move imports in SharedMemory methods to module level so that they can be executed late in python finalization.

  • gh-91456: Deprecate current default auto() behavior: In 3.13 the default will be for for auto() to always return the largest member value incremented by 1, and to raise if incompatible value types are used.

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

  • bpo-47161: Document that pathlib.PurePath does not collapse initial double slashes because they denote UNC paths.

Tests

  • 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-94315: Tests now check for DAC override capability instead of relying on os.geteuid().

  • 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-84461: run_tests.py now handles cross compiling env vars correctly and pass HOSTRUNNER to regression tests.

  • gh-93616: test_modulefinder now creates a temporary directory in ModuleFinderTest.setUp() instead of module scope.

  • gh-93575: Fix issue with test_unicode test_raiseMemError. The test case now use test.support.calcobjsize to calculate size of PyUnicode structs. sys.getsizeof() may return different size when string has UTF-8 memory.

  • gh-90473: WASI does not have a chmod(2) syscall. os.chmod() is now a dummy function on WASI. Skip all tests that depend on working os.chmod().

  • gh-90473: Skip tests on WASI that require symlinks with absolute paths.

  • gh-57539: Increase calendar test coverage for calendar.LocaleTextCalendar.formatweekday().

  • gh-90473: Skip symlink tests on WASI. wasmtime uses openat2(2) with RESOLVE_BENEATH flag, which prevents symlinks with absolute paths.

  • gh-89858: Fix test_embed for out-of-tree builds. Patch by Kumar Aditya.

  • gh-92886: Fixing tests that fail when running with optimizations (-O) in test_imaplib.py.

  • 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-94404: makesetup now works around an issue with sed on macOS and uses correct CFLAGS for object files that end up in a shared extension. Module CFLAGS are used before PY_STDMODULE_CFLAGS to avoid clashes with system headers.

  • gh-93584: Address race condition in Makefile when installing a PGO build. All test and install targets now depend on all target.

  • gh-93491: configure now detects and reports PEP 11 support tiers.

Windows

  • gh-93824: Drag and drop of files onto Python files in Windows Explorer has been enabled for Windows ARM64.

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

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-93937: The following frame functions and type are now directly available with #include , it’s no longer needed to add #include :

    • PyFrame_Check()

    • PyFrame_GetBack()

    • PyFrame_GetBuiltins()

    • PyFrame_GetGenerator()

    • PyFrame_GetGlobals()

    • PyFrame_GetLasti()

    • PyFrame_GetLocals()

    • PyFrame_Type

    Patch by Victor Stinner.

  • gh-91321: Fix the compatibility of the Python C API with C++ older than C++11. Patch by Victor Stinner.

  • gh-91731: Avoid defining the static_assert when compiling with C++ 11, where this is a keyword and redefining it can lead to undefined behavior. Patch by Pablo Galindo

  • gh-93442: Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow C++ extensions that pass 0 or NULL to macros using _Py_CAST() to continue to compile.

Python 3.11.0 beta 3

Release date: 2022-06-01

Core and Builtins

  • gh-93359: Ensure that custom ast nodes without explicit end positions can be compiled. Patch by Pablo Galindo.

  • gh-93345: Fix a crash in substitution of a TypeVar in nested generic alias after TypeVarTuple.

Build

  • gh-69093: Fix Modules/Setup.stdlib.in rule for _sqlite3 extension.

Python 3.11.0 beta 2

Release date: 2022-05-30

Core and Builtins

  • gh-84694: The --experimental-isolated-subinterpreters configure option and EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro have been removed.

  • gh-91924: Fix __lltrace__ 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-90473: Decrease default recursion limit on WASI to address limited call stack size.

  • gh-92804: Fix memory leak in memoryview iterator as it was not finalized at exit. Patch by Kumar Aditya.

  • gh-92236: Remove spurious “LINE” event when starting a generator or coroutine, visible tracing functions implemented in C.

  • gh-92619: Make the compiler duplicate an exit block only if none of its instructions have a lineno (previously only the first instruction in the block was checked, leading to unnecessarily duplicated blocks).

  • gh-92261: Fix hang when trying to iterate over a typing.Union.

Library

  • gh-93297: Make asyncio task groups prevent child tasks from being GCed

  • gh-90817: The locale.resetlocale() function is deprecated and will be removed in Python 3.13. Use locale.setlocale(locale.LC_ALL, "") instead. Patch by Victor Stinner.

  • gh-92728: The re.template() function and the corresponding re.TEMPLATE and re.T flags are restored after they were removed in 3.11.0b1, but they are now deprecated, so they might be removed from Python 3.13.

  • gh-93044: No longer convert the database argument of sqlite3.connect() to bytes before passing it to the factory.

  • 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-92675: Fix venv.ensure_directories() to accept pathlib.Path arguments in addition to str paths. Patch by David Foster.

  • gh-87901: Removed the encoding argument from os.popen() that was added in 3.11b1.

  • gh-91922: Fix function sqlite.connect() and the sqlite.Connection constructor on non-UTF-8 locales. Also, they now support bytes paths non-decodable with the current FS encoding.

  • gh-92839: Fixed crash resulting from calling bisect.insort() or bisect.insort_left() with the key argument not equal to None.

  • gh-90473: subprocess now fails early on Emscripten and WASI platforms to work around missing os.pipe() on WASI.

  • gh-92671: Fixed ast.unparse() for empty tuples in the assignment target context.

  • 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-92550: Fix pathlib.Path.rglob() for empty pattern.

  • gh-92530: Fix an issue that occurred after interrupting threading.Condition.notify().

  • gh-92531: The statistics.median_grouped() function now always return a float. Formerly, it did not convert the input type when for sequences of length one.

  • 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-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-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-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-45393: Fix the formatting for awai

    网站标题:创新互联Python教程:更新日志
    网站路径:http://www.shufengxianlan.com/qtweb/news34/542634.html

    网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

    广告

    声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联