Commit graph

130703 commits

Author SHA1 Message Date
Steve Dower
a9b6788ae6
gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293)
Changing the values requires forking and patching, which is intentional. Simply rebuilding from source does not change the implementation enough to justify changing these values - they would still be `cpython` and compatible with existing `.pyc` files. But people who maintain forks are better served by being able to easily override these values in a place that can be forward-ported reliably.
2026-02-10 00:01:17 +00:00
Savannah Ostrowski
30cfe6ee23
GH-144552: Clean up tail-call.yml CI (#144553)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-02-09 14:52:45 -08:00
Stan Ulbrych
fd190d1fa1
gh-144492: Fix process_changed_files outputs for reusable-{macos, wasi}.yml (#144518)
Fix `process_changed_files` double-processing reusable-{macos, wasi] ending up with incorrect outputs
2026-02-09 19:30:19 +02:00
Victor Stinner
245ba3d6cb
gh-144490: Fix test_cppext on Windows (#144628)
Don't include pycore_backoff.h and pycore_cell.h on Windows, since
they emit C++ compiler warnings.
2026-02-09 17:17:00 +01:00
Peter Bierma
fd6b639a49
gh-144601: Avoid sharing exception objects raised in a PyInit function across multiple interpreters (GH-144602) 2026-02-09 16:57:03 +01:00
alexey semenyuk
dd2da42ea4
gh-134179: Use sys._clear_internal_caches() at test_cmd_line (#134180)
Use sys._clear_internal_caches() instead of deprecated sys._clear_type_cache() at test_cmd_line.
2026-02-09 15:40:17 +01:00
Bartosz Sławecki
ff531f9005
gh-132604: Deprecate inherited runtime checkability of protocols (GH-143806)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-02-09 15:13:47 +01:00
VanshAgarwal24036
a91b5c3fb5
gh-143543: Fix re-entrant use-after-free in itertools.groupby (GH-143738)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-09 15:12:25 +01:00
Hai Zhu
988286e510
gh-144623: Fix missing output uops in optimizer debug output (GH-144617) 2026-02-09 13:23:02 +00:00
Kumar Aditya
dd30f16ac0
gh-141563: make PyDateTime_IMPORT thread-safe (#144210) 2026-02-09 13:20:35 +00:00
Jason Yalim, PhD
d99f3fc474
gh-140715: Add %F format code support to strptime() (GH-140647)
Also: add tests for the `%T` format code

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-09 13:24:15 +01:00
Sergey B Kirpichev
aa6ed802f2
gh-119740: Remove obsoleted removal announce for trunc delegation (GH-144622)
This was done in GH-119743 (3.14).
2026-02-09 13:41:05 +02:00
Petr Viktorin
b22ff1e543
gh-140550: allow slots that repeat information from PyModuleDef (GH-144340)
When integrating slots-based module creation is with the inittab,
which currently requires PyModuleDef, it would be convenient to
reuse the the same slots array for the MethodDef.

Allow slots that match what's already present in the PyModuleDef.
2026-02-09 11:35:43 +01:00
Adorilson Bezerra
432ddd99e2
gh-106318: Add examples for str.partition() method (#142823) 2026-02-09 00:10:43 +02:00
Adorilson Bezerra
3dd7a3c65a
gh-106318: Add example for str.isalnum() (#137550) 2026-02-09 00:08:18 +02:00
Sacul
cfeede85a7
GH-131798: Optimize _GUARD_TOS_SLICE (GH-144470) 2026-02-08 18:08:26 +00:00
Guo Ci
d73634935c
For enum.bin, update versionadded directive from 3.10 to 3.11 (#144574) 2026-02-07 23:35:02 -08:00
Savannah Ostrowski
e682141c49
Bump pre-commit hooks (#144576) 2026-02-07 23:14:18 +00:00
Bénédikt Tran
934997218e
gh-143700: document secrets.DEFAULT_ENTROPY as an opaque value (#144568) 2026-02-07 23:36:42 +01:00
Guo Ci
6665115679
gh-84116: Add missing backslash to _SubParsersAction.add_parser signature (#144572) 2026-02-07 19:02:01 +01:00
kovan
0e7c06a858
gh-142044: Add note to prefer asyncio.timeout[_at] over asyncio.Timeout (#144449) 2026-02-07 12:22:51 +00:00
kovan
16efaa225c
gh-140490: Document changes for PurePath.stem in Python 3.14 (#144450) 2026-02-07 13:19:20 +01:00
Damian Shaw
f4364a51c1
gh-144538: Upgrade bundled pip to 26.0.1 (gh-144556)
Upgrade bundled pip to 26.0.1
2026-02-07 10:59:54 +00:00
Alper
a2495ff1e7
gh-144490: Fix C++ compatibility in pycore_cell.h (GH-144482) 2026-02-06 22:11:58 -05:00
Krishna-web-hub
74db4404ea
gh-84116: Docs: Document help and aliases for argparse.add_parser() (#140574)
* gh-140281: Doc: Update free-threading how-to

* gh-140281: Doc: Update free-threading how-to

* Fix trailing whitespace

* doc fixing of the cpython fixes#84116

* Docs: Document help and aliases for argparse.add_parser() (gh-84116)

* Docs: Document help and aliases for argparse.add_parser() (gh-84116)

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing whitespace

* Fix trailing errors

* Fix trailing errors and spaces

* Fix docutils formatting, NEWS ref, and trailing whitespace

* Docs: Update argparse.rst and add NEWS entry

* Delete Doc/howto/free-threading-python.rst

* Delete Misc/NEWS.d/next/Documentation/2025-10-25-00-49-43.gh-issue-140281.tuMQUe.rst

* adding the depreceated tag

* The error indexing was fixed

* Fix trailing whitespace

* Restore missing free-threading documentation

* fixing some minor error

* fixing some minor error part 2

* fixing some minor error part 3

* Fix NEWS entry format

* Final cleanup of NEWS entry format 2

* changes in the argparse.rst

* Remove unnecessary NEWS entry

* Fixing the issue as requested

* Added the Changes done before.

* done the changes

* done the changes#1

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Done the changes

* Done the new changes

* The versionadded is rectified

* Update Doc/library/argparse.rst

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

* Docs editing

* Docs fixing whitespace

* Docs rectifiying

* little bit rectification

* Indentation rectification

* Indentation rectification 1

* Apply suggestion from @picnixz

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* deprecated rectification

* Remove mistakenly added NEWS entry

* Update Doc/library/argparse.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* changes #1

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Update Doc/library/argparse.rst 2

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* removed useless thing

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* changed according to the request

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Updated the test part

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-06 13:26:44 -08:00
Ken Jin
895e83727d
gh-144549: Fix tail calling interpreter on Windows for FT (GH-144550) 2026-02-06 19:20:28 +00:00
Hugo van Kemenade
28fb13cb33
gh-143658: Use str.lower and replace to further improve performance of importlib.metadata.Prepared.normalized (#144083)
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2026-02-06 19:38:58 +02:00
Ken Jin
25e99b375d
gh-132132: Upgrade to VS 2026 on Windows tailcall CI (GH-144544)
Upgrade to VS 2026 on Windows tailcall CI
2026-02-06 16:36:51 +00:00
Stan Ulbrych
fb196c6f32
gh-140715: Update datetime.*.str*time format code tables (GH-140716) 2026-02-06 17:08:26 +01:00
Victor Stinner
172135cc42
gh-144490: Fix test_cppext: test the internal C API (#144536)
Add missing TEST_INTERNAL_C_API env var.
2026-02-06 16:42:42 +01:00
Sam Gross
0fdf6a9a71
gh-144513: Skip critical section locking during stop-the-world (gh-144524)
When the interpreter is in a stop-the-world pause, critical sections
don't need to acquire locks since no other threads can be running.
This avoids a potential deadlock where lock fairness hands off ownership
to a thread that has already suspended for stop-the-world.
2026-02-06 15:14:08 +00:00
Sam Gross
5bb3bbb9c6
gh-144446: Fix some frame object thread-safety issues (gh-144479)
Fix thread-safety issues when accessing frame attributes while another
thread is executing the frame:

- Add critical section to frame_repr() to prevent races when accessing
  the frame's code object and line number

- Add _Py_NO_SANITIZE_THREAD to PyUnstable_InterpreterFrame_GetLasti()
  to allow intentional racy reads of instr_ptr.

- Fix take_ownership() to not write to the original frame's f_executable
2026-02-06 09:43:36 -05:00
kangtastic
45d4a34720
gh-101178: Add Ascii85, Base85, and Z85 support to binascii (GH-102753)
Add Ascii85, Base85, and Z85 encoders and decoders to binascii,
replacing the existing pure Python implementations in base64.

This makes the codecs two orders of magnitude faster and consume
two orders of magnitude less memory.

Note that attempting to decode Ascii85 or Base85 data of length 1 mod 5
(after accounting for Ascii85 quirks) now produces an error, as no
encoder would emit such data. This should be the only significant
externally visible difference compared to the old implementation.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-06 16:43:16 +02:00
Sam Gross
d891b2bbd1
gh-139103: Improve namedtuple scaling in free-threaded build (gh-144332)
Add `_Py_type_getattro_stackref`, a variant of type attribute lookup
that returns `_PyStackRef` instead of `PyObject*`. This allows returning
deferred references in the free-threaded build, reducing reference count
contention when accessing type attributes.

This significantly improves scaling of namedtuple instantiation across
multiple threads.

* Add blurb

* Rename PyObject_GetAttrStackRef to _PyObject_GetAttrStackRef

* Apply suggestion from @vstinner

Co-authored-by: Victor Stinner <vstinner@python.org>

* Apply suggestion from @vstinner

Co-authored-by: Victor Stinner <vstinner@python.org>

* format

* Update Include/internal/pycore_function.h

Co-authored-by: Victor Stinner <vstinner@python.org>

---------

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-06 09:43:05 -05:00
Ned Batchelder
638d22c6e7
Docs: module pages should not link to themselves (#144505)
* Docs: module pages should not link to themselves

* fix header punctuation
2026-02-06 06:48:27 -05:00
Petr Viktorin
f85e1170d2
gh-141004: Reorganize and reword the 'Useful macros' section (GH-144471)
- Group the macros
- Roughly order them to put the most important ones first
- Add expansions where it makes sense; especially if there's
  an equivalent in modern C or a common compiler

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-02-06 11:55:11 +01:00
Stan Ulbrych
cf60e0c452
Docs: Pull expat license from Modules/expat/ in license.rst (#144488)
Use license directly from Modules/expat/COPYING.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-06 09:54:34 +01:00
David Lechner
56590f820e
gh-144493: Improve error message in _overlapped.BindLocal() (#144495)
Replace a confusing error message with one that actually explains what the error is in `_overlapped.BindLocal()`.

Fixes: https://github.com/python/cpython/issues/144493
2026-02-06 09:51:19 +01:00
Seth Michael Larson
957f9fe162
gh-74453: Deprecate os.path.commonprefix (#144436)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-02-05 22:37:05 +02:00
Zackery Spytz
01a1dd283b
gh-77188: Add support for pickling private methods and nested classes (GH-21480)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-05 19:50:51 +00:00
Serhiy Storchaka
4644fed819
gh-144001: Support ignoring the invalid pad character in Base64 decoding (GH-144306) 2026-02-05 21:14:49 +02:00
Serhiy Storchaka
c81e1843d4
gh-74955: Document that __all__ must contain strings in normalization form NFKC (GH-144504) 2026-02-05 20:06:33 +02:00
Raymond Hettinger
50e107f149
More realistic lru_cache example (gh-144517) 2026-02-05 12:04:12 -06:00
NewUserHa
d9a2e587fc
gh-142407: Clarify copy performance on Windows in shutil docs (GH-142408) 2026-02-05 17:45:14 +00:00
Seth Michael Larson
7e777c587f
gh-144484: Warn users not to use wsgiref in production 2026-02-05 15:43:39 +00:00
Serhiy Storchaka
67ddba9aa9
gh-144148: Update the urllib.parse documentation (GH-144497)
Document urlsplit() as the main parsing function and urlparse() as
an obsolete variant.
2026-02-05 16:32:17 +02:00
Stan Ulbrych
d5cb9f6a9b
gh-144363: Update bundled libexpat to 2.7.4 (#144365)
* Update to 2.7.4

* update expat license copyright year to match and a pedantic #define

* include COPYING update in refresh.sh

* Update checksum for copying

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-05 13:58:18 +01:00
Victor Stinner
ffa68529b4
gh-144330: Initialize classmethod and staticmethod in new (#144469)
Move classmethod and staticmethod initialization from __init__() to
__new__().

PyClassMethod_New() and PyStaticMethod_New() now copy attributes of
the wrapped functions: __module__, __name__, __qualname__ and
__doc__.

Change static type initialization: initialize PyStaticMethod_Type and
PyCFunction_Type earlier.

Remove test_refleaks_in_classmethod___init__() and
test_refleaks_in_staticmethod___init__() tests from test_descr since
classmethod and staticmethod have no __init__() method anymore.
2026-02-05 11:32:56 +01:00
Mark Shannon
b53fc7caa6
GH-144179: Use recorded values to make optimizer more robust (GH-144437)
* Add three new symbol kinds
* Do not smuggle code object in _PUSH_FRAME operand
* Fix small bug in predicate analysis
2026-02-05 08:58:41 +00:00
Raymond Hettinger
b6d8aa436b
Itertools recipes: Replace the tabulate() example with running_mean() (gh-144483) 2026-02-04 14:21:20 -06:00