Commit graph

129641 commits

Author SHA1 Message Date
saucoide
09044dd42b
gh-80744: do not read .pdbrc twice when cwd == $home (#136816) 2025-12-21 08:58:07 -08:00
Gregory P. Smith
b8d3fddba6
gh-70647: Better promote how to safely parse yearless dates in datetime. (GH-116179)
* gh-70647: Better promote how to safely parse yearless dates in datetime.

Every four years people encounter this because it just isn't obvious.
This moves the footnote up to a note with a code example.

We'd love to change the default year value for datetime but doing
that could have other consequences for existing code.  This documented
workaround *always* works.

* doctest code within note is bad, dedent.

* Update to match the error message.

* remove no longer referenced footnote

* ignore the warning in the doctest

* use Petr's suggestion for the docs to hide the warning processing

* cover date.strptime (3.14) as well
2025-12-20 22:47:40 -08:00
Gregory P. Smith
8d2d7bb2e7
gh-142145: relax the no-longer-quadratic test timing (#143030)
* gh-142145: relax the no-longer-quadratic test timing

* require cpu resource
2025-12-20 23:42:06 +00:00
Sam Gross
2b4feee648
gh-122581: Use parser mutex in default build for subinterpreters (gh-142959) 2025-12-20 15:37:31 -05:00
Sam Gross
7607712b61
gh-120321: Avoid -Wunreachable-code warning on Clang (gh-143022) 2025-12-20 14:42:12 -05:00
Hai Zhu
3cc57505e5
gh-142834: pdb commands command should use last available breakpoint (#142835) 2025-12-20 09:27:34 -08:00
AZero13
5989095dfd
gh-143012: use Py_ssize_t cast for PyBytes_FromStringAndSize (#143013) 2025-12-20 10:37:10 +03:00
Hugo van Kemenade
5b5263648f
gh-142927: Tachyon: Start with user's default light/dark theme (#142987) 2025-12-20 02:36:09 +01:00
Sam Gross
e46f28c6af
gh-129069: Fix listobject.c data races due to memmove (gh-142957)
The use of memmove and _Py_memory_repeat were not thread-safe in the
free threading build in some cases. In theory, memmove and
_Py_memory_repeat can copy byte-by-byte instead of pointer-by-pointer,
so concurrent readers could see uninitialized data or tearing.

Additionally, we should be using "release" (or stronger) ordering to be
compliant with the C11 memory model when copying objects within a list.
2025-12-19 18:06:47 -05:00
Sam Gross
4ea3c1a047
gh-120321: Fix TSan reported race in gen_clear_frame (gh-142995)
TSan treats compare-exchanges that fail as if they are writes
so there is a false positive with the read of gi_frame_state in
gen_close.
2025-12-19 17:33:49 -05:00
Sam Gross
08bc03ff2a
gh-120321: Make gi_frame_state transitions atomic in FT build (gh-142599)
This makes generator frame state transitions atomic in the free
threading build, which avoids segfaults when trying to execute
a generator from multiple threads concurrently.

There are still a few operations that aren't thread-safe and may crash
if performed concurrently on the same generator/coroutine:

 * Accessing gi_yieldfrom/cr_await/ag_await
 * Accessing gi_frame/cr_frame/ag_frame
 * Async generator operations
2025-12-19 19:10:37 +00:00
Shamil
e2a7db7175
gh-142476: fix memory leak when creating JIT executors (GH-142492) 2025-12-19 19:07:11 +00:00
Ken Jin
6b4bc6e6a2
gh-134584: JIT: Borrow references for immortal promoted globals (GH-142921)
JIT: Borrow references for immortal promoted globals
2025-12-19 19:06:34 +00:00
stratakis
6a4f10325d
gh-142776: Ensure fp file descriptor is closed on all code paths in import.c (GH-142777) 2025-12-19 10:14:52 -08:00
Ken Jin
786f464c74
gh-142961: Fix constant folding len(tuple) in JIT (GH-142963) 2025-12-19 17:43:36 +00:00
Petr Viktorin
049c2526bf
gh-134160: Start "Extending and embedding" with a Diataxis-style tutorial (GH-142314)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Daniele Nicolodi <daniele@grinta.net>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-12-19 17:48:34 +01:00
Diego Russo
685272eb8a
JIT: Rename trampoline.c to shim.c (#142974) 2025-12-19 14:39:41 +00:00
Rogdham
4aef138325
gh-136282: Configparser: create unnamed sections via mapping protocol access (GH-136313) 2025-12-19 13:44:03 +01:00
Andrej
610aabfef2
gh-142527: Docs: Clarify that random.seed() discards the sign of an integer input (#142483)
If *a* is an integer, the sign of *a* is discarded in the C source code. Clarify this behavior to prevent foot guns, where a common use case might naively assume that flipping the sign will produce different sequences (e.g. for a train/test split of a synthetic data generator in machine learning).

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-19 00:29:35 -08:00
wangxiaolei
220f0b1077
gh-142560: prevent use-after-free in search-like methods by exporting buffer in bytearray (#142938) 2025-12-19 08:02:23 +00:00
Savannah Ostrowski
1391ee664c
GH-134584: Remove redundant refcount for BINARY_OP_SUBSCR_STR_INT (#142844) 2025-12-18 21:29:54 +00:00
Ethan Furman
e79c39101a
gh-118342: [Enum] update docs (GH-137290)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-18 18:31:37 +00:00
LloydZ
33d94abafd
gh-134584: Eliminate redundant refcounting from _BINARY_OP_SUBSCR_LIST_INT (GH-142926) 2025-12-18 18:25:36 +00:00
Sam Gross
f54d44d333
gh-129068: Make range iterators thread-safe (gh-142886)
Now that we specialize range iteration in the interpreter for the common
case where the iterator has only one reference, there's not a
significant performance cost to making the iteration thread-safe.
2025-12-18 13:11:51 -05:00
Kumar Aditya
e22c49522b
gh-142890: remove unnecessary interp parameter from dict functions and _PyDict_NotifyEvent (#142923) 2025-12-18 22:48:56 +05:30
Serhiy Storchaka
4a8ecbad80
gh-142681: Move NormalizationTest-3.2.0.txt to more safe place. (GH-142935) 2025-12-18 18:04:28 +01:00
Mark Shannon
e4058d7cb1
GH-142513: Reimplement executor management (GH-142931)
* Invalidating an executor does not cause arbitrary code to run
* Executors are only freed at safe points
2025-12-18 16:43:44 +00:00
Donghee Na
14f0b5191a
gh-142419: Add mmap.set_name method for user custom annotation (gh-142480) 2025-12-18 23:33:49 +09:00
Hugo van Kemenade
d2abd5733b
gh-76007: Deprecate VERSION in xml.etree.ElementTree & version in xml.sax.expatreader & xml.sax.handler (#142898) 2025-12-18 14:22:23 +00:00
Max R
0f01530bd5
Fix typo in format_string docstring (GH-136742) 2025-12-18 14:43:19 +01:00
Bartosz Sławecki
ddfc155d3a
gh-142784: make the asyncio REPL call loop.close() at exit (#142785) 2025-12-18 13:00:12 +00:00
MonadChains
1c544acaa5
gh-124098: Fix incorrect inclusion of handler methods without protocol prefix in OpenerDirector (GH-136873) 2025-12-18 13:50:05 +01:00
Donghee Na
71a7cb8887
gh-134584: Remove redundant refcount from _BINARY_OP_ADD_UNICODE (gh-142825) 2025-12-18 21:33:18 +09:00
James
fc80096a07
gh-137063: Document that ast node types replaced by Constant are no longer available (#137064) 2025-12-18 13:17:42 +01:00
ivonastojanovic
cbc0851ada
gh-138122: Improve bytecode panel (#142910)
The bytecode panel appears when a user generates a heatmap with
--opcodes and clicks the button to unfold a line and display the
bytecode instructions. Currently, an empty space appears on the
left where the line number, self, and total columns are displayed.
This area should instead extend those columns, rather than leaving
a gap.
2025-12-18 11:43:39 +00:00
Ken Jin
8b64dd853d
gh-139757: Treat call specially in JIT assembly backend optimizer on x86-64 and AArch64 (GH-142907)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2025-12-17 22:47:47 +00:00
Sam Gross
6e625f87d2
gh-129748: Remove TSan suppression for mi_block_set_nextx (gh-142887)
The function was already changed to use a relaxed atomic store in gh-134238.
2025-12-17 15:27:04 -05:00
Savannah Ostrowski
92243dc62c
GH-100964: Fix reference cycle in exhausted generator frames (#141112) 2025-12-17 19:21:45 +00:00
Sam Gross
25397f9541
gh-142766: Clear frame when generator.close() is called (gh-142838) 2025-12-17 13:06:32 -05:00
Pablo Galindo Salgado
77b56eafde
gh-91048: Refactor common data into context object in Modules/_remote_debugging (#142879) 2025-12-17 17:43:52 +00:00
Ken Jin
fba4584ffc
gh-142849: Fix segfault in executor_to_gv (GH-142885)
Fix segfault in `executor_to_gv`
2025-12-17 17:05:21 +00:00
sobolevn
e61a447d0e
gh-142873: Do not check for PyContextVar_CheckExact twice in PyContextVar_Set (#142874) 2025-12-17 19:41:36 +03:00
Damian Birchler
77c8e6a2b8
gh-142876: remove reference to thread in documentation of asyncio.Queue.shutdown (#142888) 2025-12-17 16:40:03 +00:00
Petr Viktorin
7d81eab923
gh-142225: Add PyABIInfo_VAR to to _testcapimodule & _testinternalcapi (GH-142833) 2025-12-17 16:33:09 +01:00
Pablo Galindo Salgado
568a819f67
gh-138122: Validate base frame before caching in remote debugging frame cache (#142852) 2025-12-17 15:12:28 +00:00
Benjamin Johnson
2b466c47c3
gh-112127: Fix possible use-after-free in atexit.unregister() (GH-114092)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-17 17:09:57 +02:00
Ken Jin
49627dc991
Use other name for JIT contributor (#142877) 2025-12-17 14:21:02 +00:00
Keming
d4095f25e8
gh-142654: show the clear error message when sampling on an unknown PID in tachyon (#142655)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-12-17 14:15:22 +00:00
Savannah Ostrowski
1fc3039d71
gh-139038: Add JIT What's New for 3.15 (#142845)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2025-12-17 12:14:44 +00:00
Mark Shannon
c7dcb26520
GH-142621: JIT: Avoid memory load for symbols within 4GB on AArch64 (GH-142820) 2025-12-17 12:07:07 +00:00