gh114053: Fix edge-case bug where typing.get_type_hints() wouldproduce incorrect results if type parameters in a class scope wereoverridden by assignments in a class scope and from __future__ importannotations semantics were enabled. Patch by Alex Waygood.
gh-120384: Fix an array out of bounds crash in list_ass_subscript,which could be invoked via some specificly tailored input: includingconcurrent modification of a list object, where one thread assigns a sliceand another clears it.
gh-118486: os.mkdir() on Windows now accepts mode of 0o700 torestrict the new directory to the current user. This fixesCVE-2024-4030 affecting tempfile.mkdtemp() in scenarios where thebase temporary directory is more permissive than the default.
gh-117233: Detect BLAKE2, SHA3, Shake, & truncated SHA512 support in theOpenSSL-ish libcrypto library at build time. This allows hashlibto be used with libraries that do not to support every algorithm thatupstream OpenSSL does.
gh-119213: Non-builtin modules built with argument clinic were crashing ifused in a subinterpreter before the main interpreter. The objects thatwere causing the problem by leaking between interpreters carelessly havebeen fixed.
gh-118164: Break a loop between the Python implementation of thedecimal module and the Python code for integer to stringconversion. Also optimize integer to string conversion for values in therange from 9_000 to 135_000 decimal digits.
gh-90329: Suppress the warning displayed on virtual environment creationwhen the requested and created paths differ only by a short (8.3 style)name. Warnings will continue to be shown if a junction or symlink in thepath caused the venv to be created in a different location than originallyrequested.
gh-99108: Updated the hashlib built-in HACL* project C codefrom upstream that we use for many implementations when they are notpresent via OpenSSL in a given build. This also avoids the rare potentialfor a C symbol name one definition rule linking issue.
gh-117310: Fixed an unlikely early & extra Py_DECREF triggered crashin ssl when creating a new _ssl._SSLContext if CPython wasbuilt implausibly such that the default cipher list is empty or theSSL library it was linked against reports a failure from its CSSL_CTX_set_cipher_list() API.
gh-88352: Fix the computation of the next rollover time in thelogging.TimedRotatingFileHandler handler.computeRollover() now always returns a timestamp larger than thespecified 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 theDST change.
gh-76511: Fix UnicodeEncodeError in email.Message.as_string() thatresults when a message that claims to be in the ascii character setactually has non-ascii characters. Non-ascii characters are now replacedwith the U+FFFD replacement character, like in the replace errorhandler.
gh-115809: Improve algorithm for computing which rolled-over log files todelete in logging.TimedRotatingFileHandler. It is now reliablefor handlers without namer and with arbitrary deterministic namerthat leaves the datetime part in the file name unmodified.
gh-115165: Most exceptions are now ignored when attempting to set the__orig_class__ attribute on objects returned when callingtyping generic aliases (including generic aliases created usingtyping.Annotated). Previously only AttributeError wasignored. Patch by Dave Shawley.
gh-93205: Fixed a bug inlogging.handlers.TimedRotatingFileHandler where multiple rotatinghandler instances pointing to files with the same name but differentextensions would conflict and not delete the correct files.
gh-66543: Make mimetypes.guess_type() properly parsing of URLs withonly a host name, URLs containing fragment or query, and filenames withonly a UNC sharepoint on Windows. Based on patch by Dong-hee Na.
gh-116307: Added import helper isolated_modules as CleanImportdoes not remove modules imported during the context. Use it inimportlib.resources tests to avoid leaving mod around to impedeimportlib.metadata tests.
gh-117267: Ensure DirEntry.stat().st_ctime behaves consistently withos.stat() during the deprecation period of st_ctime bycontaining the same value as st_birthtime. After the deprecationperiod, st_ctime will be the metadata change time (or unavailablethrough DirEntry), and only st_birthtime will contain the creationtime.
gh-115554: The installer now has more strict rules about updating thePython Launcher for Windows. In general, most users only have a single launcherinstalled and will see no difference. When multiple launchers have beeninstalled, the option to install the launcher is disabled until all butone have been removed. Downgrading the launcher (which was never allowed)is now more obviously blocked.
gh-114388: Fix a RuntimeWarning emitted when assign an integer-likevalue that is not an instance of int to an attribute thatcorresponds to a C struct member of type T_UINTand T_ULONG. Fix a double RuntimeWarning emitted when assign anegative integer value to an attribute that corresponds to a C structmember of type T_UINT.
gh-94606: Fix UnicodeEncodeError when email.message.get_payload()reads a message with a Unicode surrogate character and the message contentis not well-formed for surrogateescape encoding. Patch by SidneyMarkowitz.
gh-101438: Avoid reference cycle in ElementTree.iterparse. The iteratorreturned by ElementTree.iterparse may hold on to a file descriptor.The reference cycle prevented prompt clean-up of the file descriptor ifthe returned iterator was not exhausted.
gh-114014: Fixed a bug in fractions.Fraction where an invalidstring using d in the decimals part creates a different error comparedto other invalid letters/characters. Patch by Jeremiah Gabriel Pascual.
gh-113951: Fix the behavior of tag_unbind() methods oftkinter.Text and tkinter.Canvas classes with threearguments. Previously, widget.tag_unbind(tag, sequence, funcid)destroyed the current binding for sequence, leaving sequence unbound,and deleted the funcid command. Now it removes only funcid from thebinding for sequence, keeping other commands, and deletes the funcidcommand. It leaves sequence unbound only if funcid was the last boundcommand.
gh-101225: Increase the backlog formultiprocessing.connection.Listener objects created bymultiprocessing.manager and multiprocessing.resource_sharerto significantly reduce the risk of getting a connection refused errorwhen creating a multiprocessing.connection.Connection to them.
gh-113028: When a second reference to a string appears in the input topickle, and the Python implementation is in use, we are guaranteedthat a single copy gets pickled and a single object is shared whenreloaded. Previously, in protocol 0, when a string contained certaincharacters (e.g. newline) it resulted in duplicate objects.
gh-111784: Fix segfaults in the _elementtree module. Fix firstsegfault during deallocation of _elementtree.XMLParser instances bykeeping strong reference to pyexpat module in module state for capsulelifetime. Fix second segfault which happens in the same deallocationprocess by keeping strong reference to _elementtree module inXMLParser structure for _elementtree module lifetime.
gh-113320: Fix regression in Python 3.12 where Protocolclasses that were not marked as runtime-checkable would be unnecessarily introspected,potentially causing exceptions to be raised if the protocol hadproblematic members. Patch by Alex Waygood.
gh-113188: Fix shutil.copymode() and shutil.copystat() onWindows. Previously they worked differenly if dst is a symbolic link:they modified the permission bits of dst itself rather than the file itpoints to if follow_symlinks is true or src is not a symbolic link,and did not modify the permission bits if follow_symlinks is false andsrc is a symbolic link.
gh-114440: On Windows, closing the connection writer when cleaning up abroken multiprocessing.Queue queue is now done for all queues,rather than only in concurrent.futures manager thread. This canprevent a deadlock when a multiprocessing worker process terminateswithout cleaning up. This completes the backport of patches by VictorStinner and Serhiy Storchaka.
gh-102512: When os.fork() is called from a foreign thread (aka_DummyThread), the type of the thread in a child process is changed to_MainThread. Also changed its name and daemonic status, it can be nowjoined.
bpo-26791: shutil.move() now moves a symlink into a directory whenthat directory is the target of the symlink. This provides the samebehavior as the mv shell command. The previous behavior raised anexception. Patch by Jeffrey Kintscher.
gh-113009: multiprocessing: On Windows, fix a race condition inProcess.terminate(): no longer set the returncode attribute toalways call WaitForSingleObject() in Process.wait(). Previously,sometimes the process was still running after TerminateProcess() evenif GetExitCodeProcess() is not STILL_ACTIVE. Patch by VictorStinner.
gh-102362: Make sure the result of sysconfig.get_plaform() includesat least a major and minor versions, even if MACOSX_DEPLOYMENT_TARGETis set to only a major version during build to match the format expectedby pip.
gh-115015: Fix a bug in Argument Clinic that generated incorrect code formethods with no parameters that use the METH_METHOD METH_FASTCALL METH_KEYWORDS callingconvention. Only the positional parameter count was checked; any keywordargument passed would be silently accepted.
gh-111058: Change coro.cr_frame/gen.gi_frame to return None after thecoroutine/generator has been closed. This fixes a bug wheregetcoroutinestate() and getgeneratorstate()return the wrong state for a closed coroutine/generator.
gh-110543: Fix regression in Python 3.12 wheretypes.CodeType.replace() would produce a broken code object ifcalled on a module or class code object that contains a comprehension.Patch by Jelle Zijlstra.
gh-105716: Subinterpreters now correctly handle the case where they havethreads running in the background. Before, such threads would interferewith cleaning up and destroying them, as well as prevent running anotherscript.
3a8082e126