Commit graph

131691 commits

Author SHA1 Message Date
Sanyam Kumat
ab930175e7
gh-148954: Escape methodname in xmlrpc.client.dumps() to prevent XML injection (GH-148968) 2026-06-06 21:38:15 +00:00
Zackery Spytz
69851a6407
gh-50948: IDLE: Warn if saving a file will overwrite a newer version (GH-17578)
Co-authored-by: Guilherme Polo <ggpolo@gmail.com>
Co-authored-by: Priya Pappachan <priyapappachan010@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-06 17:14:45 +00:00
Edward Xu
12af26d17e
gh-150411: fix gc_generation.count race in free-threading (#150413) 2026-06-06 17:03:04 +00:00
Jelle Zijlstra
884ac3e3ec
gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (#149612)
This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object.
2026-06-06 05:47:33 -07:00
Alexander Shadchin
fded34d6fe
Delete mention encoding and errors for importlib.resources.path() (GH-143111) 2026-06-06 14:52:01 +03:00
Inada Naoki
4833b2031e
Doc: fix order of PyLong_FromUnsignedLongLong (#150937) 2026-06-06 20:37:49 +09:00
Jeff Epler
b6e66136cc
gh-150534: Add C23 half-turn trigonometric *pi functions (GH-150555)
Add the the following functions to the math module:
acospi, asinpi, atanpi, atan2pi, cospi, sinpi, tanpi.
2026-06-06 10:19:45 +00:00
Thomas Kowalski
fab449bddb
gh-149835: Use realpath() instead of abspath() in shutil.move() (GH-149986) 2026-06-06 13:04:23 +03:00
Serhiy Storchaka
b18b6a49c6
gh-84649: Use statx() in TimedRotatingFileHandler if available (ПР-150968)
This allows to support rotation based on the file birth time on Linux.
2026-06-06 11:49:07 +03:00
Pieter Eendebak
97dea30914
gh-150889: Improve performance of unicodedata.normalize() (GH-150890)
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>
2026-06-06 11:34:33 +03:00
Shamil
2452449b32
gh-148832: Use -icf=0 in BOLT_APPLY_FLAGS (gh-148833) 2026-06-06 07:19:49 +00:00
Maurycy Pawłowski-Wieroński
785b6dcf71
gh-150662: Stop unbounded memory growth in Tachyon --gecko collector (#150845) 2026-06-06 02:27:41 +00:00
Grant Herman
262625fa30
gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing (#150275) 2026-06-06 01:58:35 +00:00
Ilya Nikolaev
ea4c85552b
Use time.monotonic in OrderedDict LRU cache example (#150986) 2026-06-06 01:42:59 +03:00
Ezio Melotti
6544bf4263
gh-110631: Fix wrong blocks indentation in difflib.rst (GH-110885) 2026-06-05 17:02:10 +00:00
Victor Stinner
9f225e2c34
gh-150436: Check returncode in Win32ProcessTestCase (#150972) 2026-06-05 15:24:46 +00:00
sobolevn
9b4090c48e
gh-149977: Fix extra output of -m test test_lazy_import, again (#150965) 2026-06-05 15:21:10 +00:00
Bernát Gábor
3835fca3f5
gh-150818: Wire logger parent before publishing it in getLogger() (GH-150941) 2026-06-05 16:00:56 +01:00
Victor Stinner
0036565e81
gh-146527: Fix memory leak in _PyGC_Fini() (#150969)
Free generation_stats allocated by _PyGC_Init().

Fix Python/gc.c: Python/gc_free_threading.c was already fixed.
2026-06-05 13:43:05 +00:00
Serhiy Storchaka
c195a046f8
gh-53144: Improve charset support in the email package (GH-149942)
Defer to the codecs module for all aliases.
Use MIME/IANA names for all IANA registered charsets.
Fix email.contentmanager.set_text_content().
2026-06-05 15:53:59 +03:00
Serhiy Storchaka
ac8f80ce7b
gh-84649: Fix unstable test_rollover_based_on_st_birthtime_only (GH-150954) 2026-06-05 12:41:51 +00:00
Victor Stinner
c32501261a
gh-150907: Fix dynamic_annotations.h when built with C++ and Valgrind (#150914)
Add extern "C++" scope for the C++ template.

Fix test_cppext when Python is built with --with-valgrind.
2026-06-05 14:11:46 +02:00
Serhiy Storchaka
49f4ecfb08
gh-149891: Add more encoding aliases (GH-149892)
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.
2026-06-05 12:08:04 +00:00
Cody Maloney
e4db68b9c9
gh-129011: Update docs for Raw I/O read, readinto, and write (#135328)
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>
2026-06-05 14:00:59 +02:00
sobolevn
2f064fbc0b
gh-150899: Do not reset custom -Xlazy_imports mode in test_lazy_imports (#150900) 2026-06-05 11:03:57 +03:00
Serhiy Storchaka
45562c6f4f
gh-62825: Fix encoding aliases "KS_C_5601-1987", "KS X 1001", etc (GH-150933)
They are now aliases of CP949 instead of EUC-KR.
2026-06-05 10:58:20 +03:00
Hood Chatham
c83d3d789e
gh-145177: Bump emscripten version to 4.0.19 (#150926)
Bumpts the emscripten version to 4.0.19.
2026-06-05 13:59:43 +08:00
Steve Dower
e28a2f4930
Add shebang documentation for PyManager 26.3b1 (GH-150931) 2026-06-04 21:37:18 +01:00
Bernát Gábor
f906522a4e
gh-150886: Remove unused importlib._bootstrap._object_name (#150884)
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.
2026-06-04 20:08:58 +00:00
Bernát Gábor
d4a8066c82
gh-150817: Speed up Flag bitwise operations (GH-150824)
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.
2026-06-04 12:58:20 -07:00
Bernát Gábor
e833f57383
gh-150818: Speed up logging.getLogger() for existing loggers (GH-150825) 2026-06-04 17:15:12 +01:00
Mark Shannon
038495db33
GH-148960: Ensure that asserts are ignored if NDEBUG is set (#150916) 2026-06-04 15:11:33 +01:00
Ivan Marton
ac3694b008
gh-84649: Make TimedRotatingFileHandler use CTIME instead of MTIME (GH-24660)
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.
2026-06-04 13:50:33 +00:00
Jiseok CHOI
fc9c4db130
gh-150913: Fix sqlite3.Blob validation for empty slice assignment (GH-150915)
ass_subscript_slice() returned early when the computed slice length
was zero, bypassing validation performed for non-empty slices.
2026-06-04 16:41:47 +03:00
sobolevn
d83d50b5b7
gh-150750: Fix a race condition in deque.index with free-threading (#150779) 2026-06-04 13:31:31 +00:00
Adorilson Bezerra
a96cba5c4a
gh-106318: Add doctest role and a 'See also' to the str.split() docs (#144367) 2026-06-04 12:39:14 +01:00
Batuhan Taskaya
3ff2117ea3
bpo-38131: Improve messages when generating AST nodes from objects with wrong field values (GH-17715) 2026-06-04 10:58:51 +00:00
Miro Hrončok
cb064e746d
Fix 2 broken links in documentation (#150892)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-04 10:42:06 +01:00
jb2170
ae507e3b14
gh-119670: Add force keyword only argument to shlex.quote (#148846)
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>
2026-06-04 11:06:02 +02:00
Stefano Rivera
6b24376fed
Manpage formatting tweaks & lint (GH-132338)
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.
2026-06-04 09:35:04 +02:00
Hood Chatham
57d444612d
gh-145177: Fix Emscripten help text (#150874)
Removes some stray commas in help text.
2026-06-04 08:00:51 +08:00
Stan Ulbrych
7a468a1012
gh-150032: Tidy up 3.15 pending removals (#149594)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
2026-06-03 17:29:13 +03:00
Hugo van Kemenade
b643826c11
Docs: Replace hardcoded SOURCE_URI with patchlevel check (#150850) 2026-06-03 16:37:09 +03:00
Abduaziz π
5915a1fb9d
gh-132467: Document and test that generic aliases are not classes (#133504)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-06-03 13:35:25 +00:00
da-woods
58beae7319
Correct Stable ABI documentation for METH_FASTCALL (GH-149593)
* 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.
2026-06-03 15:20:35 +02:00
Victorien
deb33ecba3
gh-105812: Make use of the Sphinx deco role in documentation (#139598) 2026-06-03 13:14:47 +00:00
Yashraj
6453065db9
gh-141004: Document unstable perf map functions in ceval.h (GH-143492) 2026-06-03 12:36:25 +00:00
Robsdedude
5553e003ca
Fix a typo in SSLSocket docs (GH-150839) 2026-06-03 08:18:06 -04:00
Petr Viktorin
c720e18c94
gh-146636: Add Free-threaded Stable ABI migration guide (GH-150580)
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>
2026-06-03 14:02:36 +02:00
Edward Xu
41eb8ee2bb
gh-148613: Fix race in gc_set_threshold and gc_get_threshold (#150356) 2026-06-03 16:58:26 +05:30