129895 Commits

Author SHA1 Message Date
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
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
Aniket
3d44f0ab65
gh-142461: Move misplaced NEWS entries to an appropriate section (GH-143411) 2026-01-12 20:13:44 +02:00
Terry Jan Reedy
ec254e2b40
gh-139707: Copy-strip change to idle.rst into idlelib (#143718)
On Windows, running `python -c "from idlelib.help import copy_strip;
copy_strip()"` after idle.html is built results in
`f:\dev\3x\Doc\build\html\library\idle.html
copied to f:\dev\3x\Lib\idlelib\help.html`
This PR commits the html change to idlelib/help.html.
2026-01-12 12:55:06 -05:00
Sam Gross
7d155d7915
gh-140795: Remove 'exc' field in SSLObject (gh-143491)
The 'exc' field was used by our debug SSL callbacks. Keep the exception
in the normal per-thread state to avoid shared mutable state between
threads.

This also avoids a reference count leak if the Python callback raised an
exception because it can be called multiple times per SSL operation.
2026-01-12 17:14:13 +00:00
Lysandros Nikolaou
1de46715ec
gh-142518: Document thread-safety guarantees of list operations (#142519)
* Add everything to code blocks
* Improve wording around atomicity; specify exact types
* Better explain lock-free and atomicity
2026-01-12 17:43:05 +01:00
Nadeshiko Manju
e535bdb0a2
gh-134584: Eliminate redundant refcounting from _CONTAINS_{OP|OP_SET|OP_DICT} (GH-143731)
Signed-off-by: Manjusaka <me@manjusaka.me>
2026-01-12 15:47:31 +00:00
VanshAgarwal24036
c315748060
gh-143544: Fix possible use-after-free in the JSON decoder when JSONDecodeError disappears during raising it (#143561)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-01-12 16:39:32 +01:00
Pablo Galindo Salgado
fe78c1e749
gh-143253: Add libabigail suppression file for internal types (#143254)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-01-12 17:37:43 +02:00
Kuang Yu Heng
971f387bbb
gh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142)
Add a note to the readline module documentation stating that
Python 3.13 and later no longer supports readline in the default REPL,
as per gh-118840. Includes workaround using PYTHON_BASIC_REPL.

Update tutorial to remove the reference, and use a different key to
test things out.

Signed-off-by: Kuang Yu Heng <yuheng3107@gmail.com>
2026-01-12 15:30:35 +00:00
Cajetan Rodrigues
054a565c64
gh-134584: JIT: Remove redundant refcount for _BINARY_OP_SUBSCR_DICT (GH-143724) 2026-01-12 14:13:55 +00:00
Yashraj
42f7c2dfba
gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros (GH-143494) 2026-01-12 13:59:59 +01:00
Guo Ci
7f50a5febd
gh-140806: add docs for enum.bin function (#140807)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-01-12 13:34:18 +02:00
Inada Naoki
43c76587c1
gh-143189: fix insertdict() for non-Unicode key (#143285) 2026-01-12 13:21:23 +02:00
Petr Viktorin
bd83a57463
gh-143578: Restore note about patchlevel.h (#143596)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-01-12 11:21:14 +00:00
Serhiy Storchaka
f3759d21dd
gh-142306: Improve errors for Element.remove() (GH-142308)
* Raise TypeError for non-element argument in the Python implementation
  too.
* Include the repr of the elements in the ValueError error message.
2026-01-12 11:49:18 +02:00
Serhiy Storchaka
dbd10a6c29
gh-142881: Fix concurrent and reentrant call of atexit.unregister() (GH-142901) 2026-01-12 10:45:10 +02:00
Serhiy Storchaka
5f28aa2f37
gh-143346: Fix calculation of the line width for wrapped Base64 in plistlib (GH-143347)
It was incorrect in case of mixed tabs and spaces in indentation.
2026-01-12 10:40:06 +02:00
Ken Jin
548526bbbe
gh-134584: JIT: Remove redundant refcounting for UNARY_{INVERT|NEGATIVE} (GH-143704) 2026-01-11 20:42:55 +00:00
Bartosz Sławecki
9d13ca97c1
gh-142972: Document arbitrary ordering in Path.glob and Path.rglob (GH-143025) 2026-01-11 14:36:47 -05:00
James Hilton-Balfe
265381b7e8
gh-128335: Make slice generic at runtime (#128336)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-01-11 11:27:24 -08:00
Bartosz Sławecki
620a5b9269
gh-127750: Fix annotations in singledispatchmethod signature tests (GH-143571)
These tests relied on a bug -- gh-84644, which is that singledispatch
doesn't verify the annotation is on the "first" parameter.
2026-01-11 21:24:19 +02:00
Ken Jin
9633f95b95
gh-139038: Update JIT perf figures for 3.14a4 (GH-143705) 2026-01-11 18:55:05 +00:00
Sergey B Kirpichev
23b93770f6
gh-143420: Clarify sequence behavior for slice indexes (#143422) 2026-01-11 19:17:47 +02:00
AN Long
e22b68568a
gh-86139: Correct NamedTuple and TypedDict's type in typing.rst (#143692)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2026-01-11 15:53:25 +00:00
Sergey B Kirpichev
515ae4078d
gh-78724: Raise RuntimeError's when calling methods on non-ready Struct()'s (GH-143643) 2026-01-11 15:52:01 +00:00
Serhiy Storchaka
d1282efb2b
gh-143638: Forbid cuncurrent use of the Pickler and Unpickler objects in C implementation (GH-143664)
Previously, this could cause crash or data corruption, now concurrent calls
of methods of the same object raise RuntimeError.
2026-01-11 14:01:13 +02:00
Manuel Jacob
03e6457096
Remove outdated comment about excess_args warning in object.__init__ (#143669)
The code emitting a warning was removed in 96384b93aae1d1e45dda21c4024d7d083c91626d.
2026-01-11 10:27:11 +03:00
Raymond Hettinger
75d73c3674
Sync the batched() example with the grouper() example. (gh-143676) 2026-01-10 22:00:13 -06:00
Raymond Hettinger
718c15fa95
Add derangements() recipe (gh-143671) 2026-01-10 19:47:27 -06:00
emmanuel
aa8578dc54
Doc: remove duplicate GitHub issue reference in "What's New in Python 3.13" (#143654) 2026-01-10 14:34:30 +01:00
Bénédikt Tran
ce6bae92da
gh-143377: fix crashes in _interpreters.capture_exception (#143418) 2026-01-10 12:37:54 +01:00
Nadeshiko Manju
e2f0160026
gh-143604: Hold strong reference to executor during JIT tracing (GH-143646)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2026-01-10 11:15:48 +00:00
Jeong, YunWon
e7f5ffa0de
gh-143641: Make ready_to_import always remove tempdir from sys.path (#143642)
Make ready_to_import always remove tempdir from sys.path
2026-01-10 12:51:42 +03:00
Heikki Toivonen
78e868fa28
gh-143586: Add Counter comparison tests to enforce missing element semantics (gh-143587) 2026-01-10 00:17:57 -06:00