Commit graph

34551 commits

Author SHA1 Message Date
Pablo Galindo Salgado
bc7b511376
gh-138122: Allow to filter by thread in tachyon's flamegraph (#139216) 2025-09-25 15:34:57 +01:00
Jan-Eric Nitschke
2462807b70
gh-138772: Add tests for Turtle.dot() signature (GH-138773) 2025-09-25 16:46:12 +03:00
dgpb
7ce25edb8f
gh-133059: Increase the small positive integer cache to 1024 (GH-133160) 2025-09-24 17:05:30 -04:00
Tian Gao
c8624cd367
gh-138860: Lazy import rlcompleter in pdb to avoid deadlock in subprocess (#139185) 2025-09-24 11:46:05 +08:00
Serhiy Storchaka
1a2e00c97a
gh-67795: Accept any real numbers as timestamp and timeout (GH-139224)
Functions that take timestamp or timeout arguments now accept any
real numbers (such as Decimal and Fraction), not only integers or floats,
although this does not improve precision.
2025-09-23 21:31:42 +03:00
Dave Peck
6ec058a1f7
gh-138558: Improve handling of Template annotations in annotationlib (#139072) 2025-09-23 11:25:51 -07:00
Victor Stinner
e8382e55c5
gh-74857, PEP 538: Coerce POSIX locale to UTF-8 based locale (#139238) 2025-09-23 19:20:59 +02:00
Russell Keith-Magee
a79ce35c70
gh-136744: Remove a redundant test skip (#139267)
Remove a redundant test skip.
2025-09-23 16:56:14 +00:00
Peter Bierma
6b4e3fe9d4
gh-126016: Fix flaky test by allowing the SIGINT return code (GH-139219) 2025-09-23 16:09:19 +02:00
Victor Stinner
dd683f8f34
gh-139208: Fix regrtest --fast-ci --verbose (#139240)
Don't ignore the --verbose option anymore.
2025-09-23 16:09:01 +02:00
Mark Shannon
16eae6d90d
GH-137573: Add test to check that the margin used for overflow protection is larger than the stack space used by the interpreter (GH-137724) 2025-09-23 15:47:27 +02:00
Russell Keith-Magee
04c4628345
gh-136744: Remove unnecessary chmod from pydoc.apropos() test. (GH-136746)
Remove unnecessary chmod from pydoc.apropos() test.
2025-09-22 16:26:13 +02:00
Katie Gardner
e642a24b50
gh-95953: Add a css class to changed lines of difflib.HtmlDiff make_table (#139226) 2025-09-22 13:19:37 +00:00
Petr Viktorin
61e54e52ea
gh-136003: Close file descriptors in test (GH-139225)
This fixes file descriptor leaks introduced in GH-136004
2025-09-22 13:22:27 +02:00
Jason R. Coombs
a756a4b953
gh-138313: Suppress ResourceWarnings and restore skipped test (#138597) 2025-09-21 20:53:57 -04:00
Pablo Galindo Salgado
cb6fed0d7e
gh-138709: Supress stdout/stderr during test_sampling_profiler tests (#139212) 2025-09-21 18:39:07 +00:00
Pablo Galindo Salgado
9df477c0ce
gh-138709: Fix race condition in test_external_inspection (#139209)
Fix race condition in test_external_inspection thread status tests

The tests test_thread_status_detection and test_thread_status_gil_detection
had a race condition where the test could sample thread status between when
the sleeper thread sends its "ready" message and when it actually calls
time.sleep(). This caused intermittent test failures where the sleeper
thread would show as running (status=0) instead of idle (status=1 or 2).

The fix moves the thread status collection inside the retry loop and
specifically waits for the expected thread states before proceeding with
assertions. The retry loop now continues until:
- The sleeper thread shows as idle (status=1 for CPU mode, status=2 for GIL mode)
- The busy thread shows as running (status=0)
- Both thread IDs are found in the status collection

This ensures the test waits for threads to settle into their expected states
before making assertions, eliminating the race condition.
2025-09-21 18:32:03 +01:00
Serhiy Storchaka
20d5494c88
Revert "gh-66234: Add flag to disable the use of mmap in dbm.gnu (GH-135005)" (GH-136989)
This reverts commit 0cec424af5.
2025-09-20 11:01:44 +03:00
Cody Maloney
69c6b438e8
gh-138013: Split SignalsTest from test_io.test_general (#139079)
Increase parallelism by splitting out `SignalsTest` from test_general.
`SignalsTest` takes 24.2 seconds on my dev machine when fully enabled
making it the largest part of `test_io`. Code move done via copy/paste
then tweak imports.

After splitting `test_io.test_general` is down to 10.1 seconds on my dev
box with all parts enabled.
2025-09-19 18:21:50 +00:00
Pablo Galindo Salgado
67636f72d2
gh-138709: Implement CPU time profiling in profiling.sample (#138710) 2025-09-19 19:17:28 +01:00
Peter Bierma
d06113c7a7
gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164) 2025-09-19 10:41:09 -04:00
Lisa Roach
2fd43a1ffe
gh-138310: Adds sys.audit event for import_module (#138311)
* Updates sys.audit calls for imports to include import_module
* Adds unit tests for existing and new functionality
2025-09-19 06:21:42 -07:00
Serhiy Storchaka
7257b24140
gh-139076: Fix regression in pydoc not showing extension functions (GH-139077)
Fix a bug in the pydoc module that was hiding functions in a Python
module if they were implemented in an extension module and the module did
not have __all__.
2025-09-19 15:54:06 +03:00
Peter Bierma
9243a4b933
gh-126016: Remove bad assertion in PyThreadState_Clear (GH-139158)
In the _interpreters module, we use PyEval_EvalCode() to run Python code in another interpreter. However, when the process receives a KeyboardInterrupt, PyEval_EvalCode() will jump straight to finalization rather than returning. This prevents us from cleaning up and marking the thread as "not running main", which triggers an assertion in PyThreadState_Clear() on debug builds. Since everything else works as intended, remove that assertion.
2025-09-19 12:17:05 +00:00
Gordon P. Hemsley
e3d9bd6be3
gh-81148: Eliminate unnecessary check in _strptime when determining AM/PM (#13428)
* bpo-36967: Eliminate unnecessary check in _strptime when determining AM/PM

* Pauls suggestion to refactor test

* Fix test

---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2025-09-19 10:23:12 +00:00
Semyon Moroz
495f589363
gh-121237: Add %:z directive to datetime.strptime (#136961) 2025-09-19 10:25:31 +01:00
da-woods
ac5c5d42a2
gh-119494: Fix error messages for deleting/setting type attributes (#119495) 2025-09-18 22:08:49 +01:00
Peter Bierma
3eec897752
gh-136003: Skip non-daemon threads when exceptions occur during finalization (GH-139129)
During finalization, we need to mark all non-daemon threads as daemon to quickly shut down threads when sending CTRL^C to the process. This was a minor regression from GH-136004.
2025-09-18 16:04:01 -04:00
Alex Waygood
293b05c09b
gh-118803: Make ByteString deprecations louder; remove ByteString from typing.__all__ and collections.abc.__all__ (#139127) 2025-09-18 18:58:16 +00:00
Nicholas Tindle
0f27e10204
gh-137976: Explicitly exclude localtime from available_timezones (#138012)
* fix: available_timezones is reporting an invalid IANA zone name

* 📜🤖 Added by blurb_it.

* correct rst format for backticks

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2025-09-18 17:32:14 +01:00
Adam Turner
1ebd726c9b
gh-64490: Argument Clinic: Add support for `**kwds` (#138344)
This adds a scaffold of support, initially only working with
strictly positional-only arguments. The FASTCALL calling
convention is not yet supported.
2025-09-18 13:31:42 +00:00
Victor Stinner
6504f20cce
gh-135755: Make Py_TAIL_CALL_INTERP macro private (#138981)
Rename Py_TAIL_CALL_INTERP to _Py_TAIL_CALL_INTERP.
2025-09-18 14:33:07 +02:00
Peter Bierma
2191497933
gh-136003: Execute pre-finalization callbacks in a loop (GH-136004) 2025-09-18 08:29:12 -04:00
Peter Bierma
571210b8f3
gh-135729: Store reference to globals in Interpreter._decref (GH-139104) 2025-09-18 11:17:51 +00:00
Petr Viktorin
36ec60fb43
gh-138970: Adjust tests for pegen rule flags (#139107) 2025-09-18 12:08:44 +01:00
Malcolm Smith
0ac377ff23
Make Android streams respect the unbuffered (-u) option (#138806)
Android pipes stdout/stderr to the log, which means every write to the log
becomes a separate log line. As a result, most practical uses of stdout/stderr
should be buffered; but it doesn't hurt to preserve unbuffered handling in case
it's useful.
2025-09-18 11:41:21 +01:00
Cody Maloney
db68bfc771
gh-138720: Make Buffered closed check match flush (GH-138724)
In `_io__Buffered_flush_impl` the macro `CHECK_CLOSED` is used to check
the `buffered*` is in a good state to be flushed. That differs slightly
from `buffered_closed`.

In some cases, that difference would result in `close()` thinking the
file needed to be flushed and closed while `flush()` thought the file
was already closed.

This could happen during GC and would result in an unraisable exception.
2025-09-18 12:02:29 +02:00
Mark Shannon
3b83257366
GH-138378: Move globals-to-consts pass into main optimizer pass (GH-138379) 2025-09-18 10:09:59 +01:00
Raymond Hettinger
c25400a4b6
Revert gh-139075. The sumprod fix needs more work. (gh-139092) 2025-09-18 02:05:27 -05:00
Pablo Galindo Salgado
0ce9fb7e3b
gh-138970: Add general metadata system to the peg generator (#138971) 2025-09-18 02:17:04 +01:00
Raymond Hettinger
b485e50fde
gh-139074: Fix missing high precision case in sumprod() (gh-139075) 2025-09-17 16:50:15 -05:00
Denis Sergeev
5a15e73789
gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814)
* gh-138813: Default `BaseProcess` `kwargs` to `None` (#138814)

Set `BaseProcess.__init__(..., kwargs=None)` and initialize `kwargs` with
`dict(kwargs) if kwargs else {}`. This avoids a shared mutable default and
matches threading.Thread behavior.

Co-authored-by: Dmitrii Chuprov <cheese@altlinux.org>

* DummyProcess kwargs=None (which threading.Thread accepts properly)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-09-17 14:45:52 -07:00
Stefan Tatschner
a9b6b09141
gh-86819: Add ISO-TP CAN socket constants (#23794)
Co-authored-by: Stefan Tatschner <stefan@rumpelsepp.org>
Co-authored-by: Patrick Menschel <menschel.p@posteo.de>
2025-09-17 17:18:04 +00:00
Dino Viehland
e92599e677
gh-138714: Don't assume next block has instructions when propagating line numbers (#138770)
Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2025-09-17 09:52:56 -07:00
Peter Bierma
a64881363b
gh-128639: Don't assume one thread in subinterpreter finalization with fixed daemon thread support (GH-134606)
This reapplies GH-128640.
2025-09-17 11:14:19 -04:00
Petr Viktorin
5df6a568e1
gh-107862: Add property-based round-trip tests for base64 (#119406)
* Add property-based tests to test_base64

* Allow multiple positional arguments in @hypothesis.example stub

* Simplify the altchars strategy
2025-09-17 13:40:35 +00:00
Bénédikt Tran
3a04be986a
gh-76760: test that uuid.uuid1() sets the version field (#139033) 2025-09-17 13:31:51 +00:00
Gyeongjae Choi
218b8dbc78
gh-99948: Support ctypes.util.find_library in emscripten environment (#138519)
Adds support for ctypes loading .so files directly.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-09-17 10:17:56 +00:00
Serhiy Storchaka
a1cf6e92b6
gh-71679: Share the repr implementation between bytes and bytearray (GH-138181)
This allows to use the smart quotes algorithm in the bytearray's repr.
2025-09-17 11:10:29 +03:00
Serhiy Storchaka
cf9ef73121
gh-134716: Support regular expressions in -W and PYTHONWARNINGS (GH-138149) 2025-09-16 17:06:44 +00:00