Accepting complex numbers as "real" and "image" arguments
was deprecated in the 3.14 (see ef01e95).
Removal will simplify constructor a lot, lets do this.
Under TLS 1.3 a PSK is only offered and may be declined, and both sides
fall back to certificate authentication when one is available, so
CERT_NONE leaves the server unauthenticated and a zero length PSK does
not reject the connection. Drop CERT_NONE from the example and the PSK
tests.
A callback that raises is treated like one returning a zero length PSK,
so under TLS 1.3 it also falls back to certificate authentication. A
server with a certificate loaded declines even a matching PSK with
OpenSSL's default TLS 1.3 cipher suite order, which selects a SHA-384
suite. Mention checking session_reused as the client side alternative
to not using CERT_NONE.
Include the client's certificate when the session was resumed from a
ticket, and return [] instead of raising AttributeError when the client
sent no certificate.
ANT-2026-2RMA0IPV
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
In-place filtering deleted the backup file, the only copy of the data,
when the output file could not be created. An existing backup file is
now only replaced once there is a file to back up, so trying again does
not delete it either. The output file is now created with O_EXCL and
its mode is set through the file descriptor.
ANT-2026-3TZS4H87
copytree() now accepts copy_dir_stat (default true). When false,
directory permissions and times are not copied with copystat(), e.g.
to copy a read-only tree into a writable one. The flag propagates
through recursive calls; file metadata is unaffected and remains
handled by copy_function. Document the parameter and cover both
behaviors with tests.
`Path.iterdir` now raises `NotADirectoryError` rather than `ValueError`,
glob character classes follow shell-style semantics, and the workaround for
the `stacklevel` bug in PyPy < 7.3.19 is removed.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* Update vendored mimalloc to v2.5.2
Upgrade mimalloc from v2.1.2 to v2.5.2 as-is from upstream.
v2.1.2: https://github.com/microsoft/mimalloc/releases/tag/v2.1.2
v2.5.2: https://github.com/microsoft/mimalloc/releases/tag/v2.5.2
* Re-apply CPython-specific changes to mimalloc v2.5.2
Most of the previous downstream changes were upstreamed in mimalloc
v2.1.3 - v2.1.7 (heap tags, _mi_heap_init/_mi_tld_init, MI_PRIM_THREAD_ID,
sub-processes, heap walk optimizations, platform fixes) and are dropped.
Remaining CPython-specific changes, all marked with a "CPython" comment:
- QSBR delayed page freeing for free-threaded builds (gh-115103,
gh-145615): mi_page_t/mi_heap_t fields and _PyMem_mi_* hooks in
page.c, heap.c and segment.c.
- debug_offset: preserve the first bytes of a PyObject (ob_tid, refcount
fields) when filling freed or uninitialized memory in debug builds
(gh-115491).
- Atomic mi_block_t.next loads/stores to avoid TSAN reports (gh-129748).
- Relax the owning thread assertion in _mi_free_delayed_block for
free-threaded builds, since the GC traverses heaps of other threads.
- Call _mi_heap_delayed_free_partial() in mi_heap_visit_blocks()
(gh-112532).
- Only count reclaimed pages up to MI_MEDIUM_OBJ_SIZE_MAX as a
"right page" in mi_segment_reclaim (gh-115103).
- Rename the weak _ZSt15get_new_handlerv symbol and disable the
mi_is_in_heap_region debug warning.
- Zero-initialize _mi_page_empty instead of a positional initializer.
* Update the free-threaded build to mimalloc v2.5.2 changes
mimalloc v2.1.4 replaced the list of abandoned segments with per-arena
bitmaps and introduced sub-processes (mi_subproc_t) to keep abandoned
segments of separate interpreters apart. Use them instead of the
CPython-specific mi_abandoned_pool_t:
- Each interpreter owns a mi_subproc_t created in init_interpreter().
- tstate_mimalloc_bind() sets tld->segments.subproc and uses the
upstream _mi_heap_init() signature.
- The GC and sys.getallocatedblocks() visit abandoned segments with
_PyMem_mi_visit_abandoned_blocks(), the upstream cursor API without
the mi_option_visit_abandoned requirement, while STW.
* Update NEWS.d
* fix MSAN
* fix TSAN
* fix test_cext
* Disable THP
* Address code review
* Address code review
* Address code review
* nit
* Address code review
* Address code review
binascii.a2b_qp() and quopri now leave an invalid "=" escape in place and
rescan the following character instead of consuming it, like email.quoprimime
and other decoders (b'==41' now decodes to b'=A').
Add an opt-in strip_ws parameter to binascii.a2b_qp(), quopri.decode(),
quopri.decodestring() and email.quoprimime.decode() to strip trailing
whitespace per RFC 2045. It is false by default everywhere except
email.quoprimime.decode(), preserving every existing default.
Also document that email's get_payload(decode=True) does not strip trailing
whitespace, contrary to RFC 2045.
Register the new "strip_ws" argument name in the global objects tables
(make regen-global-objects), needed by static builds where binascii is
compiled into the core, and replace an unresolved :func: reference to the
undocumented email.quoprimime.decode with a literal.
* gh-62222: Make strip_ws parameters keyword-only
---------
Co-authored-by: Gregory P. Smith <greg@krypto.org>