Commit graph

129366 commits

Author SHA1 Message Date
Sam Gross
547d8daf78
gh-142218: Fix split table dictionary crash (gh-142229)
This fixes a regression introduced in gh-140558. The interpreter would
crash if we inserted a non `str` key into a split table that matches an
existing key.
2025-12-03 18:37:35 -05:00
Chris Eibl
618dc36714
GH-142050: Jit stencils on Windows contain debug data (#142052)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2025-12-03 22:08:51 +00:00
Sam Gross
c0c65141b3
gh-140482: Avoid changing terminal settings in test_pty (gh-142202)
The previous test_spawn_doesnt_hang test had a few problems:

* It would cause ENV CHANGED failures if other tests were running
  concurrently due to stty changes
* Typing while the test was running could cause it to fail
2025-12-03 15:48:44 -05:00
Mark Shannon
62423c9c36
GH-141794: Limit size of generated machine code. (GH-142228)
* Factor out bodies of the largest uops, to reduce jit code size.
* Factor out common assert, also reducing jit code size.
* Limit size of jitted code for a single executor to 1MB.
2025-12-03 17:43:35 +00:00
Petr Viktorin
aea5531583
gh-135676: Reword the f-string (and t-string) section (GH-137469)
Much of the information was duplicated in stdtypes.rst; this PR keeps lexical/syntactical details in Lexical Analysis and the evaluation & runtime behaviour in Standard types, with cross-references between the two.
Since the t-string section only listed differences from f-strings, and the grammar for the two is equivalent, that section was moved to Standard types almost entirely.

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-03 16:14:53 +01:00
Uwe L. Korn
f6f456f950
gh-142038: Expand guard for types_world_is_stopped() to fix debug builds without assertions (#142039) 2025-12-03 15:24:17 +01:00
Victor Stinner
7e5fcae09b
gh-142217: Remove internal _Py_Identifier functions (#142219)
Remove internal functions:

* _PyDict_ContainsId()
* _PyDict_DelItemId()
* _PyDict_GetItemIdWithError()
* _PyDict_SetItemId()
* _PyEval_GetBuiltinId()
* _PyObject_CallMethodIdNoArgs()
* _PyObject_CallMethodIdObjArgs()
* _PyObject_CallMethodIdOneArg()
* _PyObject_VectorcallMethodId()
* _PyUnicode_EqualToASCIIId()

These functions were not exported and so no usable outside CPython.
2025-12-03 14:33:32 +01:00
Petr Viktorin
4172644d78
gh-142206: multiprocessing.resource_tracker: Decode messages using older protocol (GH-142215) 2025-12-03 12:59:14 +00:00
Bartosz Sławecki
88cd5d9850
gh-142170: Add pymanager link to issue template menu (#142199)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-03 11:11:40 +02:00
Seth Michael Larson
08d8e18ad8
gh-142145: Remove quadratic behavior in node ID cache clearing (GH-142146)
* Remove quadratic behavior in node ID cache clearing

Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>

* Add news fragment

---------

Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>
2025-12-02 23:16:37 -08:00
Pablo Galindo Salgado
8801c6dec7
gh-140677 Add heatmap visualization to Tachyon sampling profiler (#140680)
Co-authored-by: Ivona Stojanovic <stojanovic.i@hotmail.com>
2025-12-02 20:33:40 +00:00
Stan Ulbrych
d3c888b4ec
gh-139707: Fix example for configure option (GH-142153)
Fix example for nre configure option
2025-12-02 14:12:20 +01:00
Petr Viktorin
748c4b47b7
Document None for timeout argument of select.select (#142177) 2025-12-02 10:57:09 +02:00
LloydZ
fddc24e4c8
gh-141982: Fix pdb can't set breakpoints on async functions (#141983)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2025-12-01 23:40:02 -08:00
Krishna-web-hub
2dc28eb8b0
gh-140281: Update free threading Python HOWTO for 3.14 (gh-140566)
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-12-02 05:53:12 +00:00
LloydZ
5e58548ebe
gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (#141949) 2025-12-01 20:41:54 -08:00
Peter Bierma
41728856a2
gh-142163: Only define HAVE_THREAD_LOCAL when Py_BUILD_CORE is set (#142164) 2025-12-02 09:43:11 +05:30
Kevin Wang
eb892868b3
gh-142048: Fix quadratically increasing GC delays (gh-142051)
The GC for the free threaded build would get slower with each collection due
to effectively double counting objects freed by the GC.
2025-12-01 19:04:47 -05:00
Pablo Galindo Salgado
e32c975640
gh-138122: Small fixes to the new tachyon UI (#142157) 2025-12-01 18:37:46 +00:00
László Kiss Kollár
f87eb4d7cd
gh-138122: New Tachyon UI (#142116)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2025-12-01 17:34:14 +00:00
Yashraj
52f9b5f580
gh-141004: Document descriptor and dict proxy type objects (GH-141803)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-12-01 15:51:50 +00:00
Serhiy Storchaka
694922cf40
gh-119342: Fix a potential denial of service in plistlib (GH-119343)
Reading a specially prepared small Plist file could cause OOM because file's
read(n) preallocates a bytes object for reading the specified amount of
data. Now plistlib reads large data by chunks, therefore the upper limit of
consumed memory is proportional to the size of the input file.
2025-12-01 17:28:15 +02:00
Serhiy Storchaka
5a4c4a033a
gh-119451: Fix a potential denial of service in http.client (GH-119454)
Reading the whole body of the HTTP response could cause OOM if
the Content-Length value is too large even if the server does not send
a large amount of data. Now the HTTP client reads large data by chunks,
therefore the amount of consumed memory is proportional to the amount
of sent data.
2025-12-01 17:26:07 +02:00
Stan Ulbrych
d4fa70706c
gh-139707: Add mechanism for distributors to supply error messages for missing stdlib modules (GH-140783) 2025-12-01 14:36:17 +01:00
Adam Turner
b708485d1a
Docs: Upgrade Sphinx to 9.0 (#142114) 2025-12-01 11:16:37 +00:00
Gregory P. Smith
3e2c557493
gh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH-142101)
Document not calling Popen.wait after Popen.communicate times out.

Closes #141473
2025-11-30 18:50:05 -08:00
Tadej Magajna
981ce0cf3a
gh-142066: Fix grammar in multiprocessing Pipes and Queues (GH-142121)
docs: Fix grammar in multiprocessing Pipes and Queues (gh-142066)
2025-11-30 18:14:20 -08:00
flovent
229ed3dd1f
gh-142067: Add missing default value for param in multiprocessing.Pipe's doc (GH-142109) 2025-11-30 13:10:01 -08:00
Thierry Martos
cd4d0ae75c
Improve clarity in tutorial introduction (#140669) 2025-11-30 12:47:31 +00:00
yihong
056d6c5ed9
gh-141999: Handle KeyboardInterrupt when sampling in the new tachyon profiler (#142000) 2025-11-30 02:49:13 +00:00
Pablo Galindo Salgado
ea51e745c7
gh-138122: Add thread status statistics to flamegraph profiler (#141900)
Co-authored-by: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com>
2025-11-30 01:42:39 +00:00
Duprat
db098a475a
gh-133146: Add the old public get_value method to documentation and refactor code. (GH-133301)
also uses it within the internals in a few places.
2025-11-29 22:12:48 +00:00
Chris Eibl
f2ca1581ca
GH-141808: Do not generate the jit stencils twice in case of PGO builds on Windows. (GH-142043)
* do not build the jit stencils twice in case of PGO builds on Windows

* blurb it
2025-11-29 12:43:06 -08:00
Adam Turner
77399436bf
Docs: Prepare for Sphinx 9 (#142057) 2025-11-29 16:49:37 +02:00
Adam Turner
3c117380ab
GH-121970: Remove Docutils list monkeypatch (#142056) 2025-11-29 14:28:23 +00:00
Moshe Kaplan
cfcd52490d
GH-141963: Clarify argparse documentation (GH-141964)
Clarify argparse documentation

Tightens the phrasing for several argparse actions.
2025-11-28 23:23:34 -08:00
Hugo van Kemenade
890fe5aad5
Docs: multi-disk ZIP files -> multipart ZIP files (GH-141962)
* Remove some old currentlies
* multi-disk -> multipart
* Sentence case headings
2025-11-28 23:11:59 -08:00
Sebastian Pipping
440bcb9456
gh-141994: Warn of XXE vulnerability in documentation of SAX feature xml.sax.handler.feature_external_ges (GH-141996)
Doc/library/xml.sax.handler.rst: Warn of XXE with feature_external_ges

Related to commit baa9f33897
2025-11-28 23:08:17 -08:00
Victor Stinner
5e749d3743
Fix multiprocessing queue test_get() (GH-142024)
* Replace sleep() with support.sleeping_retry().
* Test get_nowait() first.
* Restore previously disabled test.

Fix the failure:

FAIL: test_get (test.test_multiprocessing_spawn.test_processes.WithProcessesTestQueue.test_get)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/_test_multiprocessing.py", line 1208, in test_get
    self.assertEqual(queue_empty(queue), False)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: True != False
2025-11-28 23:00:14 -08:00
Gregory P. Smith
5b1862bdd8
gh-87512: Fix subprocess using timeout= on Windows blocking with a large input= (GH-142058)
On Windows, Popen._communicate() previously wrote to stdin synchronously, which could block indefinitely if the subprocess didn't consume input= quickly and the pipe buffer filled up. The timeout= parameter was only checked when joining the reader threads, not during the stdin write.

This change moves the Windows stdin writing to a background thread (similar to how stdout/stderr are read in threads), allowing the timeout to be properly enforced. If timeout expires, TimeoutExpired is raised promptly and the writer thread continues in the background. Subsequent calls to communicate() will join the existing writer thread.

Adds test_communicate_timeout_large_input to verify that TimeoutExpired is raised promptly when communicate() is called with large input and a timeout, even when the subprocess doesn't consume stdin quickly.

This test already passed on POSIX (where select() is used) but failed on Windows where the stdin write blocks without checking the timeout.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-11-28 22:07:03 -08:00
Gregory P. Smith
923056b2d4
gh-74389: gh-70560: subprocess.Popen.communicate() now ignores stdin.flush error when closed (GH-142061)
gh-70560: gh-74389: subprocess.Popen.communicate() now ignores stdin.flush error when closed

with a unittest and news entry.
2025-11-29 05:03:06 +00:00
Gregory P. Smith
cc6bc4c97f
GH-134453: Fix subprocess memoryview input handling on POSIX (GH-134949)
Fix inconsistent subprocess.Popen.communicate() behavior between Windows
and POSIX when using memoryview objects with non-byte elements as input.

On POSIX systems, the code was incorrectly comparing bytes written against
element count instead of byte count, causing data truncation for large
inputs with non-byte element types.

Changes:
- Cast memoryview inputs to byte view when input is already a memoryview
- Fix progress tracking to use len(input_view) instead of len(self._input)
- Add comprehensive test coverage for memoryview inputs

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* old-man-yells-at-ReST
* Update 2025-05-30-18-37-44.gh-issue-134453.kxkA-o.rst
* assertIsNone review feedback
* fix memoryview_nonbytes test to fail without our fix on main, and have a nicer error.

Thanks to Peter Bierma @ZeroIntensity for the code review.
2025-11-29 04:25:06 +00:00
Artur Jamro
526d7a8bb4
gh-141473: Fix subprocess.Popen.communicate to send input to stdin upon a subsequent post-timeout call (GH-141477)
* gh-141473: Fix subprocess.Popen.communicate to send input to stdin
* Docs: Clarify that `input` is one time only on `communicate()`
* NEWS entry
* Add a regression test.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-11-28 18:04:52 -08:00
Cody Maloney
d2d2e92110
Docs: Move to method references for bytearray.take_bytes (#142053) 2025-11-28 22:07:34 +01:00
dgpb
fa9519f8b2
gh-142025: Add c-analyzer include for pyexpat.c (GH-142026)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-11-28 09:51:48 -08:00
Cody Maloney
5a7c9c6861
gh-141968: Use take_bytes in encodings.punycode (#141974)
Removes a copy going from bytearray to bytes.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-28 17:47:14 +00:00
Cody Maloney
3001464248
gh-141968: Use take_bytes in re._compiler (#141995)
Removes a copy going from bytearray to bytes.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-28 17:46:10 +00:00
dgpb
5ec03cf3b0
gh-133228: c-analyzer clang preprocessor (GH-133229)
* impl
* included 2 failures to tsvs next to similar entries
* added fix/hack for curses.h fails
* fix leftover from debug
2025-11-27 22:22:21 +00:00
Stefano Rivera
656a64b37f
gh-141930: Use the regular IO stack to write .pyc files for a better error message on failure (GH-141931)
* Use open() to write the bytecode
* Convert to unittest style asserts
* Tweak news, thanks @vstinner
* Tidy
* reword NEWS, avoid word "retried"
2025-11-27 19:17:59 +00:00
Miro Hrončok
69f54ce452
gh-140210: Make test_sysconfig.test_parse_makefile_renamed_vars ignore environment variables (#140213)
The test did not expect it could be run with e.g. CFLAGS set to a custom value.
2025-11-27 10:00:02 -08:00