Opened 3 weeks ago
Closed 6 days ago
#6046 closed enhancement (fixed)
python3-3.15.1
| Reported by: | Bruce Dubbs | Owned by: | lfs-book |
|---|---|---|---|
| Priority: | normal | Milestone: | 13.2 |
| Component: | Book | Version: | git |
| Severity: | normal | Keywords: | |
| Cc: |
Description
New minor version.
Change History (3)
comment:1 by , 8 days ago
| Summary: | python3-3.15.0 (Wait for version 3.15.1) → python3-3.15.1 |
|---|
comment:2 by , 6 days ago
For 3.15.0, see https://docs.python.org/3/whatsnew/3.15.html
What's New in Python 3.15.1 final?
Security
- gh-159894: Bump the version of :pypi:
pipbundled in :mod:ensurepipto version 26.2.2.
- gh-159428: :mod:
mimetypesno longer reads the files listed in :data:mimetypes.knownfilesby default on Windows, and uses only the registry.
- gh-157953: Update bundled
libexpat <https://libexpat.github.io/>_ to version 2.9.0.
Core and Builtins
- gh-159739: Avoid a crash if allocation fails while creating a
:class:
string.templatelib.Templateiterator.
- gh-159739: Propagate errors during generic class construction and avoid a crash after failed generic alias substitution.
- gh-159739: Raise :exc:
OverflowErrorwhen the absolute value of a dynamic printf-style formatting width is too large.
- gh-159739: Fix a reference leak in :func:
gc.get_objectsand :func:gc.get_referrerswhen an internal allocation fails in the free-threaded build.
- gh-159739: Fix memory leaks during interpreter startup when a path configuration file is empty or too large, or when an audit hook rejects a command.
- gh-159739: Avoid a crash when an interpreter configuration string cannot be encoded as UTF-8.
- gh-159739: Preserve the original :exc:
SyntaxErrorif allocating optional error metadata fails.
- gh-159739: Avoid a crash if formatting an integer with the
cpresentation type runs out of memory.
- gh-159739: Avoid a crash when a module filename cannot be encoded as UTF-8.
- gh-159603: On FreeBSD, call
pthread_attr_get_np()to get the stack size (and guard size) of the current thread. Patch by Victor Stinner.
- gh-130279: Fix bug where compiler did not set the right exception handler for some jump instructions.
- gh-159430: Report the correct exception if looking up
:meth:
~object.__bytes__raises an exception while performing %-formatting of :class:bytes.
- gh-159320: Add dynamic detection of stack sizes on Android, allowing safer deep recursion.
- gh-159288: Fix a crash when walking a very long chain of lazy import
placeholders, as created by an aliased dotted import such as
lazy import a.b.c as d. :exc:RecursionErroris now raised instead.
- gh-159285: Fix a crash in a debug build when copying an empty
:class:
dictfails with :exc:MemoryError. Patch by Christian Aurich Zanettini Martins.
- gh-159041: Fix a use-after-free in :mod:
asynciotask bookkeeping when a finalizer creates a task during thread shutdown.
- gh-158973: Reset the warnings lock in the child after :func:
os.fork, before clearing other threads' states, to avoid deadlocks when their finalizers issue warnings. Preserve the lock's recursion depth if the forking thread owns it.
- gh-158918: Reduce C stack usage of
_PyModule_IsPossiblyShadowing, which could potentially cause stack overflows during module attribute access while deeply recursing in agressively optimized builds.
- gh-158803: Fix a crash in :meth:
bytes.joinand :meth:bytearray.joinin the :term:free-threaded buildwhen another thread concurrently mutates the list being joined. Patch by Christian Aurich Zanettini Martins.
- gh-158824: Fix module-level :meth:
~module.__getattr__being called before a module's own lazy imports were resolved, which allowed it to shadow them.
- gh-158820: Fix a crash when a :ref:
lazy import <lazy-imports>is declared or resolved by a finalizer running during interpreter shutdown.
- gh-158592: Skip the array reallocation when shrinking a small
:class:
list. Patch by Donghee Na.
- gh-158583: :meth:
bytes.fromhexand :meth:bytearray.fromhex: Fix uninitialized memory read. Patch by Victor Stinner.
- gh-158197: Fix crashes and debug-build assertion failures in the
:term:
free-threaded buildwhen iterating over a split dictionary while another thread deletes entries or clears it. Publish insertion-order updates atomically so readers cannot observe an increased size before the corresponding order entry is initialized.
- gh-158592:
del list[index]now triggers shrinking the list's internal array.
- gh-158486: Fix the PowerSort mask calculation in :meth:
list.sortfor very large lists.
- gh-158121: Fix missing :mod:
sys.monitoringINSTRUCTIONevents when aLINEcallback returns :data:sys.monitoring.DISABLE.
- gh-158219: Fix :class:
bytearrayconstructor: do not use a bytes object if its hash value is already computed. Patch by Cody Maloney and Victor Stinner.
- gh-158072: Fix a JIT crash when a class is instantiated with their default arguments
- gh-157468: Fix the JIT optimizer folding a builtin name to a constant
taken from the interpreter's builtins dictionary even when the running
function uses a different
builtinsmapping, such as one created withvars(builtins).copy(). The optimizer now only folds when the function's builtins is the interpreter's, and the folded constant is guarded at runtime so that another function sharing the same code object but a different builtins mapping does not use it.
- gh-157242: If :meth:
bytearray.resizeor :meth:bytearray.take_bytesfails, leave the :class:bytearrayunchanged, instead of clearing it. Patch by Victor Stinner.
- gh-156091: Fix a crash when compiling deeply nested inlined list, set, or
dict comprehensions. A :exc:
SyntaxErroris now raised when the nesting exceeds the compiler's static block limit.
- gh-106045: Fix standard library discovery in virtual environments created from a Python executable symlink located outside its base installation.
- gh-156459: Fix cleanup on error in
compiler_set_qualname. Previously it was called in_PyCompile_EnterScope, after the scope had been entered, and this was not reversed in case of an error.
- gh-156371: Fix missing
PyRefTracer_DESTROYevents for trashcan deferred objects. Patch by Donghee Na.
- gh-156204: Fix a crash in :c:func:`PyErr_GivenExceptionMatches` when evaluating deeply nested exception tuples. The recursion is now bounded, and exceeding the limit is reported as an unraisable exception.
- gh-155823: Fix a JIT bug where the side exit taken when a virtual iterator
is exhausted left a stale value on the stack, so the tier one interpreter
resumed with corrupted state and
yield fromraised :exc:AttributeErrorinstead of finishing normally.
- gh-155504: Fix a crash when thread state creation fails before the thread state is fully initialized.
- gh-155315: Fix :mod:
marshalso that afrozendictreferenced more than once in the serialized data round-trips correctly, instead of failing to load with :exc:ValueError. Patch by tonghuaroot.
- gh-154937: Fix a data race on thread handle identifiers when
_thread._shutdown()runs concurrently with the startup of non-daemon threads in the :term:free-threaded build.
- gh-152075: Reduced lock contention during LOAD_GLOBAL bytecode specialization under free threading.
- gh-153578: Fix an out-of-bounds write in :meth:
bytearray.extendwhen the bytearray is resized while the argument's :meth:~object.__buffer__is being acquired, for example by another thread. Patch by tonghuaroot.
- gh-151895: Fixed a crash in :func:
marshal.loadswhen an allocation failed while loading a reference-tracked dictionary; it now raises :exc:MemoryError.
- gh-151518: Fix a free-threaded stop-the-world fairness issue that could starve a thread reattaching after being suspended while detached.
- gh-149816: Fix a Use-After-Free race condition in
subtype_getweakref()during concurrent weakref creation and destruction in the free-threading build.
- gh-149816: Fix race conditions in
invoke_gc_callbackiteratinggc.callbacksin free-threading mode.
- gh-69605: Fix :term:
REPLcompletions inserted incorrectly when there was spaces in import statements.
Library
- gh-138641: Ignore :func:
pdb.set_tracewhen called directly at the :mod:pdbprompt.
- gh-159864: Fix a crash in :func:
syslog.openlogunder the free-threaded build when :data:sys.argvis modified concurrently.
- gh-159811: Fix a crash in :mod:
hashlibwhen the OpenSSL routine used by :meth:hash.update() <hashlib.hash.update>or by hash object constructors fails on data larger than 2048 bytes. Patch by Bénédikt Tran.
- gh-159811: Fix a crash in :mod:
hmacwhen the OpenSSL routine used by :meth:hmac.HMAC.updateor by :func:hmac.newfails on data larger than 2048 bytes. Patch by Bénédikt Tran.
- gh-159786: Fix the error handling of the HACL* routine used by
:func:
hmac.newand :meth:hmac.HMAC.update. If the maximum input length of the underlying hash function is exceeded, an :exc:OverflowErroris now raised on all builds, instead of crashing on DEBUG builds and being silently ignored otherwise. Code correctness. Realistically this can only happen at implausible sizes. Patch by Bénédikt Tran.
- gh-159739: Fix copying :class:
collections.dequesubclasses with a large maximum length.
- gh-159739: Allow cyclic garbage collection to reclaim group records
returned by :mod:
grp.
- gh-159739: Fix :class:
io.BytesIOreads into overlapping views of the same buffer.
- gh-159739: Avoid a crash when memory allocation fails while creating a
:class:
collections.OrderedDictitems iterator.
- gh-159739: Avoid reading past the end of an encoding name when the
surrogatepasserror handler receives a truncated UTF-16 or UTF-32 name.
- gh-159739: Fix incorrect :mod:
ctypesscalar values after :func:ctypes.resizeenlarges the object.
- gh-159739: Fix a memory leak when Unicode normalization cannot grow its temporary buffer.
- gh-159739: Fix resource leaks in :mod:
sslwhen certificate conversion or key log setup fails.
- gh-149015: Fix :meth:
bdb.Bdb.clear_all_file_breaksleaving breakpoints behind when multiple breakpoints are set on the same line.
- gh-159620: Fix
python -m asyncio ps,pstreeand async-aware :mod:profiling.samplingstacks stopping at asynchronous generators. Patch by Timofei Ivankov.
- gh-159458: Fix a ThreadSanitizer data race on the static cache in
normalize_century()of the datetime module under the free-threaded build.
- gh-159430: Report the correct exception if looking up
nameraises an exception when calling :func:repron a :class:weakref.ref.
- gh-159225: Prevent
inputcalls in PyREPL from modifying readline history.
- gh-159044: Restore the previous behaviour of
:meth:
http.client.HTTPConnection.set_tunnelwhere header values that are not strings (such as :const:None, :class:intor other objects) are converted with :class:strinstead of raising :exc:AttributeErrorwhen the request is sent.
- gh-159184: Fix :func:
marshal.dumpsraising :exc:MemoryErrorfor a set or frozenset containing several complex NaNs, which also made it impossible to write a :file:.pycfile for source code containing such a constant.
- gh-159185: Fix a crash in :func:
marshal.dumpsand :func:marshal.dumpwhen a set is modified while its elements are serialized, for example by the :meth:~object.__buffer__method of one of its elements. :exc:RuntimeErroris now raised.
- gh-159049: Fix reference cycles in :meth:
asyncio.loop.create_connectionand :meth:asyncio.loop.start_tlsafter a failed TLS handshake. Patch by Timofei Ivankov.
- gh-87720: Fixed error in :mod:
emailnew policies where header folding failed to detect the need to re-quote text obtained from encoded words in certain cases.
- gh-158929: Fix crash when calling :func:
syslog.syslogwhile a subinterpreter in another thread calls :func:syslog.openlogor :func:syslog.closelog.
- gh-158936: :func:
~dataclasses.dataclassno longer fails when a string annotation names a :ref:lazy import <lazy-imports>that cannot be resolved, matching the behavior for non-string annotations.
- gh-158893: Make :func:
os.strerrorthread-safe: use the reentrantstrerror_r()function if available. Patch by Victor Stinner.
- gh-158539: Fix macOS runtime section lookup for remote debugging when virtual memory region sizes differ from Mach-O segment file sizes.
- gh-156545: Fix deep flamegraph exports on platforms with small C stacks by falling back to the Python JSON encoder when the C encoder runs out of stack space.
- gh-158552: Wait for Windows threads to finish suspending before reading target memory in the sampling profiler's blocking mode. Resume the target if waiting for suspension fails.
- gh-156321: Fix :func:
asyncio.shieldreporting an exception from the inner future through the loop exception handler as soon as it completes after the shield was cancelled, even when the exception is retrieved afterwards. The exception is now reported only if it is never retrieved, as with any other future.
- gh-158539: Fix :mod:
profiling.samplingexception mode discarding samples for code running inside anexceptblock in a generator or coroutine. The remote debugger now followststate->exc_infoand itsprevious_itemchain instead of only reading the embeddedexc_state, matching the exception that :func:sys.exceptionreports.
- gh-158563: Fix :func:
turtle.undoafter :func:turtle.teleportand after an exception in :func:turtle.circle, :func:turtle.dotor :func:turtle.write. Fix :func:turtle.stamp, :func:turtle.clearstamp, :func:turtle.clearand :func:turtle.resetwhen the undo buffer is disabled.
- gh-158540: Fix :mod:
profiling.samplingnot adding the directory containing the profiled script to :data:sys.path, which prevented the script from importing modules placed next to it. The script's directory is now added, matching the behavior ofpython script.py.
- gh-158522: Fix :mod:
profiling.samplingshowing a single frame for a task whose coroutine recurses. Patch by Timofei Ivankov.
- gh-158169: Fix :attr:
zlib.Decompress.unconsumed_tailduplicating :attr:~zlib.Decompress.unused_dataafter end of stream when *max_length* was used.
- gh-158004: Fix :func:
asyncio.as_completedto continue yielding every awaitable after a pending iteration step is cancelled.
- gh-153888: Fix :func:
unittest.mock.patchwithautospec,spec, orspec_setwhen used with lazy-imported objects.
- gh-157672: Fix :mod:
tkinteron macOS: creating a :class:~tkinter.Tkinstance no longer replaces the Python handlers of SIGINT, SIGHUP and SIGTERM with Tk's handler which exits the process, so Ctrl-C raises :exc:KeyboardInterruptagain.
- gh-157621: Fix a crash when a weak-reference callback is attached to a
:class:
typing.ParamSpecArgsor :class:typing.ParamSpecKwargsinstance.
- gh-69919: :meth:
code.InteractiveInterpreter.runsourceand the REPL now report any exception raised by compiling the source, such as :exc:MemoryErroror :exc:RecursionErrorfor too deeply nested source, instead of propagating it or printing a traceback of the REPL internals.
- gh-157451: Fix :mod:
gettextplural form selection when thePlural-Formsexpression combines the unary`` operator with a binary operator, for example!n + 1or2 * !n. The latter raised :exc:SyntaxError.
- gh-157406: Fix the Python implementation of
:class:
xml.etree.ElementTree.XMLParser: thedoctype()method of the target is now called for a document type declaration without an external identifier, like<!DOCTYPE html>, as in the C implementation.
- gh-157364: Fix a use-after-free in :class:
io.TextIOWrapperwhen a call to the underlying buffer reentrantly detaches it. Patched by Shamil Abdulaev.
- gh-157242: :class:
io.BytesIOis no longer closed onwrite()andtruncate()failure (:exc:MemoryError). Patch by Victor Stinner.
- gh-157325: Fix an out-of-bounds read in the
hzincremental decoder when the input ends with~.
- gh-123018: Fix :func:
readline.write_history_fileand :func:readline.append_history_fileproducing a history file that :func:readline.read_history_filecould not load when a limit was set with :func:readline.set_history_lengthand Python was built againstlibedit. This works around `NetBSD PR 60322 <https://gnats.netbsd.org/60322>`_.
- gh-157146: :mod:
linecachecan now read the source of a module that was imported from a zip archive on :data:sys.pathwhen given only the file name, as :mod:pdb, :mod:warningsand :mod:doctestdo.
- gh-157048: Preserve the position and contents of :class:
io.BytesIOwhen :meth:!BytesIO.__init__fails because a buffer is exported.
- gh-156961: Fix :func:
tkinter.font.nametofontand the :class:tkinter.font.Fontconstructor for a font name returned by Tk as a Tcl object, for example by :meth:`ttk.Style.lookup() <tkinter.ttk.Style.lookup>`.
- gh-156946: Fix a crash in :mod:
curses.panelwhen the finalizer of a panel's user pointer runs while the panel is being deallocated. The panel is now taken off the panel stack before its user pointer is dropped.
- gh-156920: Fix :mod:
asyncioon Windows: closing a :class:~asyncio.DatagramTransportunder :class:~asyncio.ProactorEventLoopwhile datagrams were still queued, or while an in-flight write failed right asclose()was draining the buffer, could strand the queued data and never callconnection_lost(), hanging the close indefinitely.
- gh-156810: Fix a :exc:
UnicodeEncodeErrorcrash in the sampling profiler's collapsed-stack export (--collapsed) when a sampled frame's function or file name contains non-ASCII or surrogate-escaped characters. The output file is now written as UTF-8.
- gh-156797: Fix :class:
xml.sax.saxutils.XMLGenerator: the namespace URI is now escaped in the namespace declaration. Previously a URI containing&,<or a quote character produced a document which cannot be parsed.
- gh-83895: :mod:
xml.etree.ElementTreenow accepts input larger than 2 GiB in the C implementation. The data is fed to Expat in chunks, as :mod:xml.parsers.expatalready did, instead of raising :exc:OverflowError.
- gh-99064: Fix :func:
xml.etree.ElementTree.parsewith a text file or other source of :class:strdata in the C implementation. The encoding declared in the document was applied to the already decoded text, which produced mojibake. It is now ignored, as when parsing with :meth:!XMLParser.feedor :func:~xml.etree.ElementTree.fromstring.
- gh-156713: Fix :func:
!nturl2path.pathname2urland :func:!nturl2path.url2pathname: the filesystem encoding and error handler are now used for percent-encoding and decoding, as in :mod:urllib.request. Previously paths containing surrogate characters raised :exc:UnicodeEncodeError.
- gh-156698: Fix :class:
asyncio.ProactorEventLoopUDP transports so that a write error no longer strands a paused protocol: the write loop is now rescheduled when data remains buffered, and the protocol is resumed when the buffer has drained.
- gh-156658: :mod:
xml.domand :mod:xml.etree.ElementTreeno longer treat characters which are not white space in XML (such as U+00A0) as white space. Previously they could be lost in :func:~xml.etree.ElementTree.indent, :func:~xml.etree.ElementTree.canonicalizewithstrip_text=True, and when parsing with thewhitespace-in-element-contentfeature turned off.
- gh-156568: :func:
zipapp.create_archivenow correctly sets the executable bit on the target archive when copying a zipapp where the target is a path-like object.
- gh-156545: Fix the sampling profiler's flamegraph export so that profiling
a deeply recursive program no longer fails with :exc:
RecursionErrorinstead of producing a flamegraph. Patch by tonghuaroot.
- gh-156476: The pure Python implementation of :meth:
queue.SimpleQueue.getnow ignores *timeout* when *block* is false, matching the documented behavior and the C implementation. It previously raised :exc:ValueError.
- gh-156444: Fix matching of a negated character set in a bytes pattern
compiled with both :const:
re.IGNORECASEand :const:re.LOCALE. The case closure is now applied to the members of the set, so that[bc]no longer matchesb'B'.
- gh-156180: :func:
zlib.adler32_combineand :func:zlib.crc32_combinenow raise :exc:ValueErrorif the *len2* argument is negative, instead of returning rubbish or hanging indefinitely, respectively.
- gh-156166: :mod:
ssl: A failed assignment or deletion of the_msg_callbackattribute of :class:ssl.SSLContextno longer removes the current callback. Deleting it now raises :exc:AttributeErrorinstead of :exc:TypeError.
- gh-156173: Calling :meth:
zlib.Decompress.flushon invalid compressed data now raises :exc:zlib.errorinstead of being silently ignored.
- gh-152817: :mod:
sqlite3: Disallow removing therow_factoryattribute of a cursor to prevent a crash on a query.
- gh-156124: Fix a crash in the free-threaded build when deleting the
:attr:
!contentsattribute of a :mod:ctypespointer.
- gh-156101: Fix :attr:
sqlite3.Cursor.arraysizebeing set to 0 if the assigned value is too large. The attribute is now left unchanged if the assignment fails.
- gh-156100: Fix crashes in :class:
sqlite3.Connectionwhen deleting the :attr:~sqlite3.Connection.autocommitattribute or setting it to an integer which does not fit in C :c:expr:`long`. Both now raise an exception.
- gh-156099: Fix a crash when deleting the
keylog_filenameattribute of :class:ssl.SSLContext. It now raises :exc:AttributeError.
- gh-156067: Fix error handling in the :mod:
zoneinfoaccelerator module when a transition index is-1or a TZ string'sboolraises.
- gh-155997: Fix :func:
concurrent.interpreters.list_all. It failed if an interpreter was destroyed during the call, in particular by a garbage collection which finalized the object owning the last reference to it.
- gh-155941: Fix :func:
asyncio.start_serverwhen a plain-function *client_connected_cb* raises: the error is now reported like the coroutine case and the transport is closed, instead of leaving the connection open forever (which also made :meth:asyncio.Server.wait_closedhang).
- gh-155843: :mod:
hmac: ensure that HMAC objects are properly initialized to prevent rare crashes on allocation failures. Patch by Bénédikt Tran.
- gh-155835: :mod:
hashlib: Fix data races when accessing :attr:~hashlib.hash.digest_sizeand :attr:~hashlib.hash.block_sizeon SHA-3 objects. Patch by Bénédikt Tran.
- gh-155830: :mod:
!_blake2: Ensure that BLAKE-2 objects are correctly initialized before being tracked by the garbage collector. Patch by Bénédikt Tran.
- gh-155782: :mod:
ssl: prevent a crash in :meth:~ssl.SSLSocket.groupfor session-less objects on OpenSSL 3.2 and later. Patch by Bénédikt Tran.
- gh-155811: Add a sequence counter to GC statistics to prevent
:mod:
!_remote_debuggingreturning inconsistent snapshots caused by non-atomic reads. Patch by Maurycy Pawłowski-Wieroński.
- gh-155717: :mod:
multiprocessing's default start method is now :ref:"spawn" <multiprocessing-start-methods>instead of"forkserver"when there is no writable temporary directory, such as on a read-only file system. Previously starting a process failed with an :exc:OSErrorthere.
- gh-155775: Fix a regression in :mod:
imaplibintroduced in the fix for :gh:63121: refreshing the capabilities after a successful :meth:~imaplib.IMAP4.loginor :meth:~imaplib.IMAP4.authenticateconsumed theCAPABILITYresponse, so it could no longer be read with :meth:~imaplib.IMAP4.response.
- gh-113318: Fix crashes when deleting an attribute whose setter is
generated by Argument Clinic and is not prepared for deletion, among them
:attr:
frame.f_trace_opcodesand thecontext,ownerandsessionattributes of_ssl._SSLSocket. Deleting such attribute now raises :exc:AttributeError.
- gh-150449: Fix :class:
sqlite3.Blobslices with a negative step. Reading or writing such a slice raised :exc:SystemError. It now raises :exc:ValueError.
- gh-155336: Fix error handling in :func:
socket.gethostbyaddrand :func:socket.gethostbyname_exwhen hostname resolution fails.
- gh-155426: Make sure that the pure Python fallback of :func:
hmac.digestrejects keys that are neither :class:bytesor :class:bytearray. Previously, an :exc:AttributeErrorwas raised instead of :exc:TypeError. Patch by Bénédikt Tran.
- gh-102475: Fix :func:
os.path.realpathon Windows: the unresolved part of the path is now appended, not joined, so a file name which looks like a drive (e.g.spam:eggs) no longer discards the resolved part. A path relative to another drive is now resolved against the root directory of that drive.
- gh-89760: Fix :func:
os.path.realpathon Windows: the
?\prefix is no longer stripped from a volume GUID path, which made the result invalid.
- gh-84419: Fix :func:
os.staton Windows: trailing dots and spaces, which are ignored by the operating system, are no longer taken into account when the execute permissions are guessed from the file extension.
- gh-155319: :func:
warnings.warn_explicitnow displays the source line taken from the loader of the module whose globals are passed as *module_globals*. It also no longer raises :exc:IndexErrorif *lineno* is out of the range of the module source.
- gh-123011: :func:
warnings.warn_explicitno longer emits a spurious :exc:DeprecationWarningor raises :exc:ImportErrorwhen it is called with the globals of the :mod:__main__module.
- gh-69370: :program:
python -m inspect --detailsno longer fails with :exc:UnicodeEncodeErrorif the path of the module contains characters unencodable in the encoding of :data:sys.stdout. Such characters are now escaped with backslashes.
- gh-69371: Fix :mod:
pydocfor modules whose path contains undecodable bytes. :func:!pydoc.writedocand the pydoc HTTP server no longer fail with :exc:UnicodeEncodeError: the file URL is now percent-encoded using the filesystem encoding, and characters unencodable in the generated HTML page are escaped with backslashes.
- gh-154855: Fix :meth:
curses.window.instrreturning one character too few when the :mod:cursesmodule is built against a curses library that counts the terminator in the requested length, such as the NetBSD one.
- gh-154594: Fix :func:
copy.deepcopyso that an object whose deep copy isNoneis still memoized. Patch by tonghuaroot.
- gh-154523: Fixed data-race when calling :meth:
io.TextIOBase.detachin :term:free-threaded build.
- gh-135683: :class:
logging.FileHandlerand :class:logging.handlers.WatchedFileHandlernow honor :data:logging.raiseExceptionsfor errors that occur while opening the file, like for other errors during logging.
- gh-82535: :class:
logging.handlers.SysLogHandlerno longer fails if the address cannot be resolved when the handler is created. The address is resolved again when a record is emitted.
- gh-153970: Calling :func:
stron a :exc:subprocess.CalledProcessErrorno longer raises :exc:TypeErrorwhen its :attr:!returncodeis not an integer, such asNone.
- gh-154194: Fix the sampling profiler dropping entire samples when a non-fatal read fails; frames now keep any readable metadata, and long funcnames and filenames are truncated instead. Patch by Maurycy Pawłowski-Wieroński.
- gh-153005: :meth:
!concurrent.interpreters.Queue.getand :meth:!concurrent.interpreters.Queue.putnow compute theirtimeoutdeadline from :func:time.monotonicinstead of the wall clock, so adjusting the system clock during the call no longer makes them over- or under-wait.
- gh-154062: Stop normalizing differential flamegraph baselines to the duration of the current profile.
- gh-81241: Fix :exc:
OSErrorwhen importing :mod:ctypesfrom a statically linked interpreter.
- gh-153838: Skip non-regular files in the
profiling.samplingheatmap exporter instead of reading them unconditionally. Patch by tonghuaroot.
- gh-141276: Fix duplicate :exc:
SyntaxWarningmessages when importing source modules from ZIP archives. :meth:zipimport.zipimporter.get_filename, and therefore :meth:~zipimport.zipimporter.find_spec, no longer compile source modules. A :exc:SyntaxErrorin a zipped source module is now raised when the module is executed rather than when it is found, matching the behavior of filesystem-based loaders.
- gh-153603: Fix a crash in the ISO-2022 decoders when decoding a byte after
an unknown charset designation is set via the decoder's
setstatemethod. Patch by tonghuaroot.
- gh-153539: Fix a crash in the C implementation of
:meth:
io.TextIOWrapper.tellwhen the decoder'sgetstatemethod triggers a reentrant seek, or when another thread seeks the same stream concurrently. Patch by tonghuaroot.
- gh-152754: Fix a crash when the same :func:
os.scandiriterator is used concurrently from multiple threads. It no longer releases the directory handle while another thread is reading from it. Sharing an iterator between threads remains subject to race conditions: which entries each thread receives is unspecified.
- gh-153364: Make frame, coroutine and task-waiter walks iterative and bounded, avoiding potential hangs and stack overflows. Fix asyncio task inspection when awaited-by sets contain removed entries. Patch by Maurycy Pawłowski-Wieroński.
- gh-149816: :mod:
hashlib: fix a crash arising from a race condition when looking up an OpenSSL hash algorithm by name the first time. Patch by Bénédikt Tran.
- gh-151292: Fix
profiling.sampling --binaryleaving unreadable profile files when the binary format reaches a size limit. Preserve collected samples when the writer can still finalize safely. Patch by Maurycy Pawłowski-Wieroński.
- gh-152721: Fix quadratic replay time in the :mod:
profiling.samplingbinary reader when a profile's run-length-encoded samples alternate thread status.
- gh-151126: Fix a crash caused by failing to set :exc:
MemoryErroron allocation failure when passing :class:ctypes.Structureor :class:ctypes.Unioninstances by value to ctypes foreign functions.
- gh-152692: Fix :func:
annotationlib.type_reprreturning a string such asNone.list.appendfor bound built-in methods, whosemoduleisNone. It now returns the qualified name, as it already did for other builtins.
- gh-152490: Fix :exc:
TypeErrorwhen formatting a :exc:SyntaxErrorraised with :data:NotImplementedas its argument, which caused unexpected REPL exit and IDLE Shell restart.
- gh-152373: Fix the :mod:
pdbuntilcommand not stepping over a list comprehension when a breakpoint is set on it. Patch by tonghuaroot.
- gh-152204: Fix the pure-Python implementations of
:meth:
datetime.date.fromisoformat, :meth:datetime.time.fromisoformatand :meth:datetime.datetime.fromisoformatsilently accepting some malformed ISO 8601 strings, such as non-ASCII digits or a sign in a fixed-width field (for example'2020+12'or'20201212T0102٣٤'). Each field is now required to be exactly *N* ASCII digits, matching the C implementation.
- gh-133998: Fix :func:
tarfile.openin streaming write mode (w|gz) raising :exc:struct.errorwhen given an *mtime* outside the range of the gzip header's 32-bit timestamp field. Out-of-range values are now stored as0, matching :mod:gzip.
- gh-117807: Fix :mod:
mimetypesinitialization from MIME map files containing invalid UTF-8 bytes.
- gh-143008: Fix race conditions when re-initializing a
:class:
io.TextIOWrapperobject.
- gh-145856: Fix :func:
plistlib.dumpsand :func:plistlib.dumpso thatskipkeys=Truetogether withsort_keys=Truecorrectly drops non-string keys when the dictionary contains a mix of string and non-string keys. Previously the sort ran before the filter and raised :exc:TypeError.
- gh-143376: :mod:
concurrent.interpreters: fix a crash when internal cross-interpreter channel ends have incorrect channel IDs. Patch by Bénédikt Tran.
- gh-146065: Fix a crash in asyncio.Future iterator when send() is called after throw() or close().
- gh-143008: Fix crash in :class:
io.TextIOWrapperwhen reentrant :meth:io.TextIOBase.detachis called reentrantly from the underlying buffer.
- gh-129605: Improve exception handling when computing suggestions in traceback.py. This fixes a bug that could cause PyREPL to exit unexpectedly.
- gh-102967: A bug in :func:
!doctest._SpoofOut.truncatewas causing None to be passed to :func:!StringIO.seekwhen no size was given. A simple fix skips the seek call when no size is given so the buffer can be truncated from the current position.
- gh-82039: :meth:
http.cookiejar.FileCookieJar.loadnow checks the first, format signature line in a case-insensitive manner. Patch by Ashley Harvey.
- gh-70758: Creating a new :mod:
turtlescreen after the previous one was closed no longer raisesturtle.Terminatoron the first turtle command.
- bpo-44012: The
explodedattribute of :class:ipaddress.IPv6Addressand :class:ipaddress.IPv6Interfacenow supports addresses with a scope ID (link-local addresses). Previously the former raised :exc:~ipaddress.AddressValueErrorand the latter omitted the scope ID.
- gh-83869: Fix :mod:
tarfilereading an archive with a GNU sparse 1.0 member whose size is set in the pax extended header. The offset of the next header was computed from the offset of the data, which is already past the sparse map, and from the size of the member, which can be the apparent size of the sparse file. All following members were unreachable.
- gh-61366: :class:
http.cookiejar.MozillaCookieJarnow reads session cookies written by curl and Wget, which use0in the expiration time field. Contributed by Jérémie Detrey.
Documentation
- gh-142083: Document the
'w'type code in the :class:array.arraydocstring, so that it lists the same type codes as :data:array.typecodesand the :mod:arraymodule documentation.
- gh-107689: Added docstrings to abstract ctypes.
Tests
- gh-159293: Restore the recursion limit after the free-threading recursion-limit race test to avoid failures in subsequent tests run in the same process.
- gh-159211: The iOS testbed no longer gathers simulator diagnostics when a test run fails.
- gh-157628: In regrtest, only consider that a test leaks if all test runs leak at least one file descriptor. For example, ignore "[0, 1, -1] file descriptors, sum=0" deltas, instead of reporting a leak. Patch by Victor Stinner.
- gh-140550: Enable limited C API tests on Free Threading in test_cext and test_cppext: test the :c:macro:`Py_TARGET_ABI3T` macro. Patch by Victor Stinner.
- gh-75876: A test decorated with :func:
~test.support.bigmemtestnow runs in a subprocess if it really allocates the memory it asks for (that is, if the-Moption is used), so that the memory it uses and the address space it fragments are released when it ends. A dummy run stays in the process. The separate memory watchdog process is no longer needed: the parent process watches the memory usage of the subprocess.
- gh-155411: Fix :func:
!test.support.subTestsfor asynchronous test methods. They were wrapped in a synchronous function, which discarded the coroutine without awaiting it, so the test silently did not run at all.
- gh-132581: The list of tests which altered the execution environment now
includes the reasons why the environment was considered altered, for
example an unraisable exception or a modified :data:
sys.path. The final result no longer repeats the same state twice (likeENV CHANGED then ENV CHANGED).
- gh-155109: Add
test.support.run_with_limited_c_stack()and use it in tests that exhaust the C stack with a fixed number of recursive calls, so that their outcome no longer depends on the C stack size.
Build
- gh-143632: Fix the check that disables
PR_SET_VMA_ANON_NAMEon musl libc: it tested an unset variable, so it never had any effect and the build could fail with a redefinition ofstruct prctl_mm_map.
- gh-159759: Fix the
libpython.staticpath in :pep:739build-details.json, which pointed to a file that is not installed when building with :option:--enable-shared, and no longer list a static library for framework builds, which do not install one.
- gh-159440: The version string reported by
sys.versionno longer carries a spurious-dirtysuffix when CPython is built out-of-tree from a clean git checkout: the build stamp now checks the source tree instead of the build directory.
- gh-158683: Fix the :file:
Modules/Setupentry for the :mod:!_zstdmodule by adding missing source files.
- gh-157142: Fix the link of
Programs/_freeze_modulewhen extension modules are built in (MODULE_BUILDTYPE=static) and the test modules are enabled:Modules/getpath_noop.cnow defines_Py_Get_Getpath_CodeObject(), which_testinternalcapiuses.
- gh-155911: Fix curses detection when a curses library is already in
LIBS
IDLE
- gh-159517: Fix the completion list and the call tip grabbing the focus on macOS with Tcl/Tk 9.1.
- gh-56596: Make IDLE keyboard shortcuts with ascii letters work when Caps Lock is on even when only one of the upper and lowercase versions are defined.
- gh-64007: IDLE no longer applies syntax coloring to the text entered for
:func:
inputin the Shell.
- gh-85560: Fix IDLE failing to find the opening parenthesis when a
continuation line inside the parentheses starts with
elseof a conditional expression or withyield.
- gh-75487: Fix saving a truncated number when an integer entry in the IDLE Settings dialog is blanked with the Backspace key.
- gh-74112: Ctrl-C in the IDLE Shell now interrupts blocking calls such as
:func:
time.sleepand :meth:socket.recv <socket.socket.recv>.
- gh-151471: Colorize the soft keyword
typein IDLE.
- gh-103089: IDLE no longer hangs when opening a file with very long lines. Only the first 2,000 characters of a line are colorized.
- gh-70331: IDLE no longer fails to start with
python -m idlelib, and its user process no longer fails to start, when the current directory contains user files with the same names as standard library modules that IDLE imports, such asrandom.pyortkinter.py.
- gh-93016: Fix parsing of command line arguments in the IDLE "Run... Customized" dialog on Windows: backslashes are no longer treated as escape characters. Fix also display of the previous arguments in the dialog.
- gh-69365: The IDLE search dialogs now show a regular expression error below the entry instead of in a message box.
- gh-105689: Fix calltips, parenthesis matching and auto-indent in the IDLE Shell after output containing unbalanced quotes or parentheses.
- gh-60402: In IDLE, Tab in a string that is not the start of a file name inserts a tab instead of opening the completion list.
- gh-68453: Fix running IDLE with the -s option together with -c, -r or -: the command or script now runs after the startup file, without an error dialog and without restarting the shell.
- gh-69919: IDLE now reports any exception raised by compiling the source,
such as :exc:
MemoryErrorfor too deeply nested source, instead of hanging the Shell.
- gh-91398: Remove the border around the IDLE Shell sidebar, which was drawn in the window background color and stood out with dark themes.
- gh-71136: Fix a hang of the IDLE Shell when code run under the debugger
raises :exc:
KeyboardInterrupt.
- gh-154511: Consolidate IDLE's mouse wheel handling in
idlelib.util.wheel_eventmoves there fromidlelib.treeand joinsx11_buttons, which tells whether Tk reports wheel rotations to a widget as<Button-4>/<Button-5>events, andbind_wheel, which binds whichever events Tk sends.
- gh-156896: Stop deleting tkinter submodules when idlelib.run is imported.
- gh-153480: Fix IDLE failing to start when opening a file which does not exist yet. Fix a traceback when a file open in the IDLE editor is deleted by another program; IDLE now asks whether to close the window, save the file elsewhere, or ignore it.
- gh-66172: IDLE no longer fails to start when a user configuration file is corrupt. The unparsable file is renamed with a ".bad" suffix, default settings are used instead, and a warning lists the affected files.
- gh-90304: Prevent IDLE from failing to start when a font reports a zero
width for the
'0'character. Such a broken font caused a :exc:ZeroDivisionError; the editor now falls back to the configured width.
- gh-135511: Fix display of :exc:
NameErrorand :exc:AttributeErrorwith multi-line message.
Note:
See TracTickets
for help on using tickets.

Now version 3.15.1.