Scan the nfc_first/nfc_last reindex tables comparing only .start, range-check
the candidate once, and terminate on a sentinel above every codepoint, so each
entry costs a single comparison. ~2x faster on non-Latin and combining-heavy
NFC/NFKC input; no new data tables.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Support all aliases officially registered in IANA, except
Extended_UNIX_Code_Packed_Format_for_Japanese.
New names:
KSC_5601, KS_C_5601-1989, iso-ir-149, GB_2312-80, windows-936, mac,
CCSID00858, CCSID01140, and a number of "cs"-prefixed names.
Fix csHPRoman8, which was not normalized.
Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.
In particular:
- They may make more than one system call (PEP-475)
- Add warnings if `.write()` requires a wrapping retry loop (see: gh-126606)
- "Raw I/O" `.write`` may not write all bytes
- `buffering=0` example results in a "Raw I/O"
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Introduced in GH-23469 (bpo-26131, "Deprecate usage of load_module()")
to render an object's qualified name inside the load_module()
deprecation warnings.
Orphaned by gh-142205 (GH-97850, "Remove all uses and definitions of
load_module() from importlib"), which deleted the warning-building call
sites f"{_object_name(spec.loader)}.exec_module() not found; ..." and
left the helper with no caller.
A word-boundary search across Lib, Modules, Python, Objects and Include
finds zero references outside its own definition, and a GitHub code
search finds no downstream importers. The frozen importlib was
regenerated; importlib._bootstrap._object_name no longer exists at
runtime and the full test_importlib suite passes.
Flag.__or__, __and__ and __xor__ walked both operands on every call to reject
None values. Run that scan only when one of the operand values is actually
None, so valid combinations skip it. The TypeError and its message are
unchanged for the invalid cases.
The TimedRotatingFileHandler previously only used st_mtime attribute of the
log file to detect whether it has to be rotate yet or not. In cases when the
file is changed within the rotatation period the st_mtime is also updated
to the current time and the rotation never happens.
It's more appropriate to check the file creation time (st_ctime) instead.
Whenever available, the more appropriate st_birthtime will be in use. (This
feature is available on FreeBSD, MacOS and Windows at the moment.) If
the st_mtime would be newer than st_ctime (e.g.: because the inode
related to the file has been changed without any file content
modification), then the earliest attribute will be used.
There are propositions to add a single-quote-double-quote switch
(gh-90630), so to avoid hiccups of people passing `force` as a
positional and it being used for the single-double switch, we make
kwargs kwargs-only.
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Following on from GH-132291 this is the second part of the patch from https://bugs.debian.org/1101406
This tweaks the formatting of a few bits of the manpage.
* Correct Stable ABI documentation for METH_FASTCALL
The current documentation says:
>
> METH_FASTCALL
> Part of the Stable ABI since version 3.7.
>
> [...]
>
> Added in version 3.7.
>
> Changed in version 3.10: METH_FASTCALL is now part of the stable ABI.
so is contradictory about when it was added to the Stable ABI. Looking at the header it seems like 3.10 is right.
Co-authored-by: Charlie Lin <tuug@gmx.us>
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>