130028 Commits

Author SHA1 Message Date
Petr Viktorin
a009e78b79
gh-141004: Mark up docs of old PyMem macros (GH-143783)
These had a docs-only deprecation notice since the first version of the docs in this repo. Nowadays we call things “soft deprecated” if there's just a note in the docs.

The deprecated directive needs a version, I went with the first one that had the notice (2.0; it's not in 1.6):
- https://docs.python.org/release/2.0/api/memoryInterface.html
- https://docs.python.org/release/1.6/api/memoryInterface.html

Since PEP 445, they are now direct aliases; there are no (additional) binary compatibility concerns over the preferred names.
2026-01-15 12:37:30 +01:00
Victor Stinner
1597d00d96
gh-80620: Fix test_time.test_gmtime() for 32-bit time_t (#143861) 2026-01-15 11:54:30 +01:00
Peter Gessler
f5685a266b
gh-80620: Support negative timestamps on windows in time.gmtime, time.localtime, and datetime module (#143463)
Previously, negative timestamps (representing dates before 1970-01-01) were
not supported on Windows due to platform limitations. The changes introduce a
fallback implementation using the Windows FILETIME API, allowing negative
timestamps to be correctly handled in both UTC and local time conversions.
Additionally, related test code is updated to remove Windows-specific skips
and error handling, ensuring consistent behavior across platforms.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-15 10:51:11 +01:00
Serhiy Storchaka
565685f6e8
Add regression test for add() after remove() with hash collision in set (GH-143781) 2026-01-15 10:41:08 +02:00
Muneeb Ullah
421bd1770a
gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH-143840) 2026-01-15 09:22:01 +01:00
sobolevn
bdba5f0db2
gh-143635: Fix crash in ga_repr_items_list (#143670) 2026-01-15 06:50:47 +03:00
Donghee Na
794f758cd8
gh-141504: Refactor policy object into a single opt_config (gh-143644) 2026-01-15 09:53:00 +09:00
Donghee Na
a73ba4d46e
gh-143632: Skip unittest for mmap.set_name at musl environment (gh-143839) 2026-01-15 09:52:29 +09:00
Serhiy Storchaka
b8e925b4f8
gh-141805: Fix crash after concurrent addition objects with the same hash to set (GH-143815)
This happens when the set contained several elements with the same hash,
and then some of them were removed.
2026-01-14 23:29:17 +02:00
Raymond Hettinger
f4de184980
gh-143825: Micro-optimizations to _make_key. (gh-143844) 2026-01-14 15:20:53 -06:00
Mohammad Miadh Angkad
499706b843
GH-143842: Make optimizer color table static (GH-143846) 2026-01-14 20:37:13 +00:00
Savannah Ostrowski
313d5cde5d
Add Savannah to CODEOWNERS for WASI (#143847) 2026-01-14 12:08:32 -08:00
Serhiy Storchaka
85013d7a55
Fix refleaks in new unicodedata classes added in gh-74902 (GH-143843) 2026-01-14 19:55:11 +00:00
Priyanshu Singh
14f96a8d8f
gh-143632: Disable PR_SET_VMA_ANON_NAME on musl libc (gh-143730) 2026-01-14 17:47:55 +00:00
Hugo van Kemenade
2b33b52219 Post 3.15.0a5 2026-01-14 19:30:22 +02:00
Hugo van Kemenade
d51cc01c19 Python 3.15.0a5 v3.15.0a5 2026-01-14 16:41:32 +02:00
Serhiy Storchaka
bab1d7a561
gh-74902: Add Unicode Grapheme Cluster Break algorithm (GH-143076)
Add the unicodedata.iter_graphemes() function to iterate over grapheme
clusters according to rules defined in Unicode Standard Annex #29.

Add unicodedata.grapheme_cluster_break(), unicodedata.indic_conjunct_break()
and unicodedata.extended_pictographic() functions to get the properties
of the character which are related to the above algorithm.

Co-authored-by: Guillaume "Vermeille" Sanchez <guillaume.v.sanchez@gmail.com>
2026-01-14 14:37:57 +00:00
Peter Bierma
0e0d51cdce
gh-141004: Document several soft-deprecated C APIs (GH-141634)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-14 08:20:33 -05:00
Serhiy Storchaka
a471a32f4b
gh-143214: Add the wrapcol parameter in binascii.b2a_base64() and base64.b64encode() (GH-143216) 2026-01-14 14:44:53 +02:00
Ken Jin
e370c8db52
gh-143123: Protect against recursive tracer calls/finalization (GH-143126)
* Stronger check for recursive traces

* Add a stop_tracing field

* Stop early when tracing exceptions
2026-01-14 12:23:14 +00:00
Mark Shannon
6db952eae9
GH-143613: Add colours and some more edges to executor visualization graph (GH-143809) 2026-01-14 11:34:58 +00:00
Duane Griffin
ce8f5f98c6
gh-106287: Do not write objects after an unmarshalling error (GH-132715)
Writing out an object may involve a slot lookup, which is not safe to do with
an exception raised. In debug mode an assertion failure will occur if this
happens.
2026-01-14 11:25:46 +00:00
Hai Zhu
94dbce1397
gh-138050: Use cold flag instead of warm flag in MAKE_WARM (GH-143827) 2026-01-14 10:27:33 +00:00
Petr Viktorin
7e8a1b5061
gh-141004: Document old provisional names for vectorcall/code API (GH-143568)
gh-141004: Document old provisional names for vectorcall & code API

For vectorcall API, the underscore-prefixed provisional names
continue to be available per PEP 590:
https://peps.python.org/pep-0590/#finalizing-the-api
Use `versionadded`, `versionchanged`, and `:no-typesetting:`
to mark this up.

For PyCode API, use `:no-typesetting:` rather than `index::` so that
these are semantically documented as C functions.
2026-01-14 10:54:45 +01:00
Russell Keith-Magee
1857a40807
gh-143460: Correct unlimited stack size skip for Emscripten (#143765)
Modifies the test skip for unlimited stack size to add Emscripten to the
exclusion list.
2026-01-14 06:03:04 +08:00
Ken Jin
2873c31edf
gh-131798: JIT optimizer: Support custom binary op and property frames (GH-143735) 2026-01-13 19:11:53 +00:00
Hugo van Kemenade
dfc66e5c8d Merge branch 'main' of https://github.com/python/cpython 2026-01-13 20:44:19 +02:00
Hugo van Kemenade
da0e8c39dc Post 3.15.0a4 2026-01-13 20:39:00 +02:00
Alper
fca7fec88c
gh-116738: Make lzma module thread-safe (#142947) 2026-01-13 14:02:27 +00:00
Bartosz Sławecki
865eb12e07
gh-143728: Keep TypedDict and NamedTuple in class role in docs (#143702) 2026-01-13 13:52:29 +00:00
Hugo van Kemenade
80e9eaf071
Bump GitHub Actions (#143757) 2026-01-13 15:43:26 +02:00
Yongtao Huang
f53a801e91
remove duplicate error constants in _winapi (#143684) 2026-01-13 19:11:38 +05:30
Lakshya Upadhyaya
95a17b4a85
gh-141045: Document that shutil.Error is a subclass of OSError (#141152) 2026-01-13 19:08:26 +05:30
Yongtao Huang
103a384bfd
gh-143249: Fix buffer leak when overlapped operation fails to start on windows (#143250) 2026-01-13 19:01:24 +05:30
Stan Ulbrych
1176facbf2
gh-141004: Don't trigger run-tests when Tools/check-c-api-docs/ignored_c_api.txt is changed (GH-143583) 2026-01-13 08:28:09 -05:00
Petr Viktorin
f0a0467c17
gh-143054: Disallow non-top-level Cut for now (GH-143622)
The behaviour of Cut in nested parentheses, Repeat, Opt, and similar
is somewhat chaotic. Apparently even the academic papers on PEG aren't
as clear as they could be.

And it doesn't really matter. Python only uses top-level cuts.
When that changes, we can clarify as much as necessary (and even
change the implementation to make sense for what we'll need).

Document that this is deliberately unspecified, and add a test to
make sure any decision is deliberate, tested and documented.
2026-01-13 13:21:59 +01:00
Yashraj
a7ba3b124f
gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) (GH-143508)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-13 13:15:02 +01:00
Hugo van Kemenade
43cd277ae9 Python 3.15.0a4 v3.15.0a4 2026-01-13 12:26:56 +02:00
Cody Maloney
510ab7d6e1
gh-132108: Add Buffer Protocol support to int.from_bytes to improve performance (#132109)
Speed up conversion from `bytes-like` objects like `bytearray` while
keeping conversion from `bytes` stable.

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-13 10:33:26 +01:00
Stan Ulbrych
e5b5a15804
gh-141004: GHA: Run check-c-api-docs check on docs-only PRs (GH-143573)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2026-01-13 10:18:48 +01:00
Hugo van Kemenade
cbf9b8cc08
gh-143658: importlib.metadata: Use str.translate to improve performance of importlib.metadata.Prepared.normalized (#143660)
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2026-01-13 08:54:15 +02:00
Raymond Hettinger
a6bc60da02
Update random combinatoric recipes and add tests (gh-143762) 2026-01-12 17:55:02 -06:00
Gregory P. Smith
298d5440eb
gh-143706: Fix sys.argv not set during multiprocessing forkserver __main__ preload (#143717)
The forkserver was not passing sys.argv to its main() function, causing
sys.argv to be empty during `__main__` module import in child processes. This
fixes a non-obvious regression inadvertently introduced by the gh-126631 main
preloading fix.
2026-01-12 15:47:21 -08:00
Łukasz Langa
d5882c5b70
Bump automatic certificate update on Windows during builds (GH-143741)
Without this, OpenSSL that we use to download external dependencies might use a stale certificate store and be unable to connect to servers. We need to use a Windows-specific HTTP client that uses CryptoAPI directly to trigger certificate updates.

We only do it on failure to avoid hitting servers twice. And we only do it once per each URL.
2026-01-13 00:01:01 +01:00
Savannah Ostrowski
0bee481576
Add Savannah to optimizer CODEOWNERS (#143761) 2026-01-12 14:56:05 -08:00
Ken Jin
5a45279320
gh-134584: Add more contributors for JIT refcounting work (GH-143760) 2026-01-12 22:14:52 +00:00
reiden
c556786b8b
gh-134584: Eliminate redundant refcounting in TO_BOOL_INT, TO_BOOL_LIST (GH-143759) 2026-01-12 21:56:26 +00:00
Raymond Hettinger
66e1399311
Minor readability/usability improvement to the recipes section (gh-143753) 2026-01-12 14:12:23 -06:00
Savannah Ostrowski
4766237d19
GH-43374: Revert "GH-43374: Fix urlretrieve reporthook to report actual bytes r… (#143711)
Revert "GH-43374: Fix urlretrieve reporthook to report actual bytes read (#142653)"

This reverts commit 68a01f901f446f71aac88431e01bb18b9fa35bd0.
2026-01-12 19:03:42 +00:00
Serhiy Storchaka
c559135c93
gh-143196: Fix crash in non-standard use of internal JSON encoder object (GH-143618)
The internal encoder object returned by undocumented function
json.encoder.c_make_encoder() (aka _json.make_encoder()) crashed
when it was called with non-zero second argument.
2026-01-12 18:23:05 +00:00