gh-133701: Fix incorrect `__annotations__` on TypedDict defined under PEP 563 (GH-133772)
(cherry picked from commit 9836503b48)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-132983: Style improvements for `compression.zstd` (GH-133547)
(cherry picked from commit b44c824856)
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-132641: fix race in `lru_cache` under free-threading (GH-133787)
Fix race in `lru_cache` by acquiring critical section on the cache object itself and call the lock held variant of dict functions to modify the underlying dict.
(cherry picked from commit 9ad0c7b0f1)
Co-authored-by: Peter Hawkins <phawkins@google.com>
gh-132983: Fix small issues with zstd support in zipfile (GH-133723)
(cherry picked from commit 35f47d0589)
Co-authored-by: Carey Metcalfe <carey@cmetcalfe.ca>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
gh-133968: Add fast path to PyUnicodeWriter_WriteStr() (GH-133969)
Don't call PyObject_Str() if the input type is str.
(cherry picked from commit fe9f6e829a)
Co-authored-by: Victor Stinner <vstinner@python.org>
If the error handler is used, a new bytes object is created to set as
the object attribute of UnicodeDecodeError, and that bytes object then
replaces the original data. A pointer to the decoded data will became invalid
after destroying that temporary bytes object. So we need other way to return
the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal().
_PyBytes_DecodeEscape() does not have such issue, because it does not
use the error handlers registry, but it should be changed for compatibility
with _PyUnicode_DecodeUnicodeEscapeInternal().
(cherry picked from commit 9f69a58623)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
It now supports non-ASCII paths in non-UTF-8 locales and
non-UTF-8 paths in UTF-8 locales.
(cherry picked from commit c09cec5d69)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-132983: Fix compiler warning about unused function ``mt_continue_should_break()`` (GH-133947)
(cherry picked from commit 121ed71f4e)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
* Fix TypeError when formatter_class is a custom subclass of
HelpFormatter.
* Fix TypeError when formatter_class is not a subclass of
HelpFormatter and non-standard prefix_char is used.
* Fix support of colorizing when formatter_class is not a subclass of
HelpFormatter.
* Remove the prefix_chars parameter of HelpFormatter.
(cherry picked from commit 734e15b70d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Prevent the possibility of re-entrancy leading to deadlock or infinite recursion (caused by logging triggered by logging), by disabling logging while the logger is handling log messages.
(cherry picked from commit 2561e148ec)
Co-authored-by: Duane Griffin <duaneg@dghda.com>
gh-133744: Fix multiprocessing interrupt test: add an event (GH-133746)
Add an event to synchronize the parent process with the child
process: wait until the child process starts sleeping.
(cherry picked from commit c2989b7070)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-119180: annotationlib: Fix values of Format members in docs (GH-133841)
(cherry picked from commit 0eb448cae5)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-119180: More documentation for PEP 649/749 (GH-133552)
The SC asked that the Appendix in PEP-749 be added to the docs.
(cherry picked from commit 3396df56d0)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-133590: ensure that `TableEntry.linenumber_borrow` is initialized (GH-133681)
(cherry picked from commit c838e21fda)
Co-authored-by: Lauta <ljfp@ljfp.xyz>
gh-132983: Make zstd types immutable (GH-133784)
(cherry picked from commit 1a87b6e9ae)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-132983: Reduce the size of ``_zstdmodule.h`` (GH-133793)
(cherry picked from commit 1a548c0a50)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
When calling .close() the HTMLParser should flush all remaining content,
even when that content is in an unclosed script or style tag.
(cherry picked from commit 53383e90e4)
Co-authored-by: Waylan Limberg <waylan.limberg@icloud.com>
gh-132642: document how to render human-readable `timedelta` objects (GH-133825)
(cherry picked from commit efcc42ba70)
Co-authored-by: Kentaro Jay Takahashi <64148935+KentaroJay@users.noreply.github.com>
Tiny doc fix to double up backslashes in a Windows filesystem path (GH-133828)
(cherry picked from commit e7741dd773)
Co-authored-by: Tim Golden <mail@timgolden.me.uk>
GH-132983: PEP 7 and Argument Clinic changes for zstd (GH-133791)
(cherry picked from commit 1978904a2f)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
GH-132983: remove empty_bytes from _zstd module state (GH-133785)
(cherry picked from commit 98e2c3af47)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>