]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
19 months agoUpdate titles and subtitles on landing page template (#116914)
Carol Willing [Sun, 17 Mar 2024 00:01:56 +0000 (17:01 -0700)] 
Update titles and subtitles on landing page template (#116914)

* Update titles and subtitles on landing page template

* address review from gvanrossum

* Edits from hugovk review

* Change word order back. Down the road we should split license and history

19 months agogh-116809: Restore removed _PyErr_ChainExceptions1() function (#116900)
Victor Stinner [Sat, 16 Mar 2024 20:37:11 +0000 (21:37 +0100)] 
gh-116809: Restore removed _PyErr_ChainExceptions1() function (#116900)

19 months agoCI: Process stale issues four times per day (#116857)
Hugo van Kemenade [Sat, 16 Mar 2024 17:59:42 +0000 (19:59 +0200)] 
CI: Process stale issues four times per day (#116857)

19 months agogh-116879: Add new optimizer pystats to tables (GH-116880)
Michael Droettboom [Sat, 16 Mar 2024 15:10:43 +0000 (11:10 -0400)] 
gh-116879: Add new optimizer pystats to tables (GH-116880)

19 months agogh-112536: Add more TSAN tests (#116896)
Donghee Na [Sat, 16 Mar 2024 14:52:44 +0000 (23:52 +0900)] 
gh-112536: Add more TSAN tests (#116896)

---------

Co-authored-by: Antoine Pitrou <antoine@python.org>
19 months agogh-116851: Remove "from ctypes import *" from a ctypes example (GH-116852)
jnchen [Sat, 16 Mar 2024 13:01:45 +0000 (21:01 +0800)] 
gh-116851: Remove "from ctypes import *" from a ctypes example (GH-116852)

It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.

19 months agogh-114271: Fix race in `Thread.join()` (#114839)
mpage [Sat, 16 Mar 2024 12:56:30 +0000 (05:56 -0700)] 
gh-114271: Fix race in `Thread.join()` (#114839)

There is a race between when `Thread._tstate_lock` is released[^1] in `Thread._wait_for_tstate_lock()`
and when `Thread._stop()` asserts[^2] that it is unlocked. Consider the following execution
involving threads A, B, and C:

1. A starts.
2. B joins A, blocking on its `_tstate_lock`.
3. C joins A, blocking on its `_tstate_lock`.
4. A finishes and releases its `_tstate_lock`.
5. B acquires A's `_tstate_lock` in `_wait_for_tstate_lock()`, releases it, but is swapped
   out before calling `_stop()`.
6. C is scheduled, acquires A's `_tstate_lock` in `_wait_for_tstate_lock()` but is swapped
   out before releasing it.
7. B is scheduled, calls `_stop()`, which asserts that A's `_tstate_lock` is not held.
   However, C holds it, so the assertion fails.

The race can be reproduced[^3] by inserting sleeps at the appropriate points in
the threading code. To do so, run the `repro_join_race.py` from the linked repo.

There are two main parts to this PR:

1. `_tstate_lock` is replaced with an event that is attached to `PyThreadState`.
   The event is set by the runtime prior to the thread being cleared (in the same
   place that `_tstate_lock` was released). `Thread.join()` blocks waiting for the
   event to be set.
2. `_PyInterpreterState_WaitForThreads()` provides the ability to wait for all
   non-daemon threads to exit. To do so, an `is_daemon` predicate was added to
   `PyThreadState`. This field is set each time a thread is created. `threading._shutdown()`
   now calls into `_PyInterpreterState_WaitForThreads()` instead of waiting on
   `_tstate_lock`s.

[^1]: https://github.com/python/cpython/blob/441affc9e7f419ef0b68f734505fa2f79fe653c7/Lib/threading.py#L1201
[^2]: https://github.com/python/cpython/blob/441affc9e7f419ef0b68f734505fa2f79fe653c7/Lib/threading.py#L1115
[^3]: https://github.com/mpage/cpython/commit/81946532792f938cd6f6ab4c4ff92a4edf61314f

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
19 months agogh-112536: Add test_threading to TSAN tests (#116898)
Antoine Pitrou [Sat, 16 Mar 2024 11:55:46 +0000 (12:55 +0100)] 
gh-112536: Add test_threading to TSAN tests (#116898)

19 months agogh-116484: Fix collisions between Checkbutton and ttk.Checkbutton default names ...
Serhiy Storchaka [Sat, 16 Mar 2024 11:31:19 +0000 (13:31 +0200)] 
gh-116484: Fix collisions between Checkbutton and ttk.Checkbutton default names (GH-116495)

Change automatically generated tkinter.Checkbutton widget names to
avoid collisions with automatically generated tkinter.ttk.Checkbutton
widget names within the same parent widget.

19 months agogh-116764: Fix regressions in urllib.parse.parse_qsl() (GH-116801)
Serhiy Storchaka [Sat, 16 Mar 2024 10:36:05 +0000 (12:36 +0200)] 
gh-116764: Fix regressions in urllib.parse.parse_qsl() (GH-116801)

* Restore support of None and other false values.
* Raise TypeError for non-zero integers and non-empty sequences.

The regressions were introduced in gh-74668
(bdba8ef42b15e651dc23374a08143cc2b4c4657d).

19 months agogh-90535: Fix support of interval>1 in logging.TimedRotatingFileHandler (GH-116220)
Serhiy Storchaka [Sat, 16 Mar 2024 10:29:42 +0000 (12:29 +0200)] 
gh-90535: Fix support of interval>1 in logging.TimedRotatingFileHandler (GH-116220)

Fix support of interval values > 1 in logging.TimedRotatingFileHandler
for when='MIDNIGHT' and when='Wx'.

19 months agogh-112536: Add TSAN builds on Github Actions (#116872)
Donghee Na [Sat, 16 Mar 2024 10:10:37 +0000 (19:10 +0900)] 
gh-112536: Add TSAN builds on Github Actions (#116872)

19 months agogh-116858: Add `@cpython_only` to several tests in `test_cmd_line` (#116859)
Nikita Sobolev [Sat, 16 Mar 2024 08:54:42 +0000 (11:54 +0300)] 
gh-116858: Add `@cpython_only` to several tests in `test_cmd_line` (#116859)

19 months agoMinor kde() docstring nit: make presentation order match the function signature ...
Raymond Hettinger [Fri, 15 Mar 2024 19:02:10 +0000 (14:02 -0500)] 
Minor kde() docstring nit: make presentation order match the function signature (#116876)

19 months agoGH-115802: Reduce the size of _INIT_CALL_PY_EXACT_ARGS. (GH-116856)
Mark Shannon [Fri, 15 Mar 2024 17:16:30 +0000 (17:16 +0000)] 
GH-115802: Reduce the size of _INIT_CALL_PY_EXACT_ARGS. (GH-116856)

19 months agogh-116868: Avoid locking in PyType_IsSubtype (#116829)
Dino Viehland [Fri, 15 Mar 2024 16:35:29 +0000 (12:35 -0400)] 
gh-116868: Avoid locking in PyType_IsSubtype (#116829)

Make PyType_IsSubType not acquire lock

19 months agogh-112536: Add --tsan test for reasonable TSAN execution times. (gh-116601)
Donghee Na [Fri, 15 Mar 2024 16:07:16 +0000 (01:07 +0900)] 
gh-112536: Add --tsan test for reasonable TSAN execution times. (gh-116601)

19 months agogh-116782: Mention `__type_params__` in `inspect.getmembers` docs (#116783)
Nikita Sobolev [Fri, 15 Mar 2024 15:47:46 +0000 (18:47 +0300)] 
gh-116782: Mention `__type_params__` in `inspect.getmembers` docs (#116783)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
19 months agogh-116621: Specialize list.extend for dict keys/values (gh-116816)
Donghee Na [Fri, 15 Mar 2024 14:48:34 +0000 (23:48 +0900)] 
gh-116621: Specialize list.extend for dict keys/values (gh-116816)

19 months agogh-116735: Use `MISSING` for `CALL` event if argument is absent (GH-116737)
Tian Gao [Fri, 15 Mar 2024 14:46:18 +0000 (07:46 -0700)] 
gh-116735: Use `MISSING` for `CALL` event if argument is absent (GH-116737)

19 months agogh-63283: IDNA prefix should be case insensitive (GH-17726)
Zackery Spytz [Fri, 15 Mar 2024 14:38:13 +0000 (07:38 -0700)] 
gh-63283: IDNA prefix should be case insensitive (GH-17726)

Any capitalization of "xn--" should be acceptable for the ACE prefix
(see https://tools.ietf.org/html/rfc3490#section-5).

Co-authored-by: Pepijn de Vos <pepijndevos@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
19 months agogh-111926: Simplify proxy creation logic (#116844)
mpage [Fri, 15 Mar 2024 13:58:40 +0000 (06:58 -0700)] 
gh-111926: Simplify proxy creation logic (#116844)

Since 3.12, allocating a GC-able object cannot trigger GC. This allows
us to simplify the logic for creating the canonical callback-less
proxy object.

19 months agogh-111926: Simplify weakref creation logic (#116843)
mpage [Fri, 15 Mar 2024 13:56:13 +0000 (06:56 -0700)] 
gh-111926: Simplify weakref creation logic (#116843)

Since 3.12, allocating a GC object cannot immediately trigger GC. This
allows us to simplify the logic for creating the canonical callback-less
weakref.

19 months agoGH-116422: Modify a few uops so that they can be supported by tier 2 with hot/cold...
Mark Shannon [Fri, 15 Mar 2024 10:48:00 +0000 (10:48 +0000)] 
GH-116422: Modify a few uops so that they can be supported by tier 2 with hot/cold splitting (GH-116832)

19 months agogh-90095: Ignore empty lines and comments in `.pdbrc` (#116834)
Tian Gao [Fri, 15 Mar 2024 09:36:04 +0000 (02:36 -0700)] 
gh-90095: Ignore empty lines and comments in `.pdbrc` (#116834)

19 months agogh-85283: Build pwd extension with the limited C API (#116841)
Victor Stinner [Fri, 15 Mar 2024 07:49:58 +0000 (08:49 +0100)] 
gh-85283: Build pwd extension with the limited C API (#116841)

Argument Clinic now uses the PEP 737 "%T" format to format type name
for the limited C API.

19 months agogh-116842: Improve test comment and fix a doctest (gh-116846)
Raymond Hettinger [Fri, 15 Mar 2024 02:40:36 +0000 (21:40 -0500)] 
gh-116842: Improve test comment and fix a doctest (gh-116846)

19 months agoGH-113838: Add "Comparison to os.path" section to pathlib docs (#115926)
Barney Gale [Fri, 15 Mar 2024 00:11:49 +0000 (00:11 +0000)] 
GH-113838: Add "Comparison to os.path" section to pathlib docs (#115926)

19 months agogh-116195: Implements a fast path for nt.getppid (GH-116205)
vxiiduu [Thu, 14 Mar 2024 23:09:36 +0000 (09:09 +1000)] 
gh-116195: Implements a fast path for nt.getppid (GH-116205)

Use the NtQueryInformationProcess system call to efficiently retrieve the parent process ID in a single step, rather than using the process snapshots API which retrieves large amounts of unnecessary information and is more prone to failure (since it makes heap allocations).

Includes a fallback to the original win32_getppid implementation in case the unstable API appears to return strange results.

19 months agogh-111696, PEP 737: Add %T and %N to PyUnicode_FromFormat() (#116839)
Victor Stinner [Thu, 14 Mar 2024 22:23:00 +0000 (23:23 +0100)] 
gh-111696, PEP 737: Add %T and %N to PyUnicode_FromFormat() (#116839)

19 months agogh-116811: Ensure MetadataPathFinder.invalidate_caches is reachable when delegated...
Jason R. Coombs [Thu, 14 Mar 2024 21:59:00 +0000 (17:59 -0400)] 
gh-116811: Ensure MetadataPathFinder.invalidate_caches is reachable when delegated through PathFinder. (#116812)

* Make MetadataPathFinder a proper classmethod.

* In PathFinder.invalidate_caches, also invoke MetadataPathFinder.invalidate_caches.

* Add blurb

19 months agogh-106531: Refresh zipfile._path with zipp 3.18. (#116835)
Jason R. Coombs [Thu, 14 Mar 2024 21:53:50 +0000 (17:53 -0400)] 
gh-106531: Refresh zipfile._path with zipp 3.18. (#116835)

* gh-106531: Refresh zipfile._path with zipp 3.18.

* Add blurb

19 months agoMinor improvements to the itertools documentation (gh-116833)
Raymond Hettinger [Thu, 14 Mar 2024 21:39:50 +0000 (16:39 -0500)] 
Minor improvements to the itertools documentation (gh-116833)

19 months agogh-111696, PEP 737: Add PyType_GetModuleName() function (#116824)
Victor Stinner [Thu, 14 Mar 2024 18:17:43 +0000 (19:17 +0100)] 
gh-111696, PEP 737: Add PyType_GetModuleName() function (#116824)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
19 months agogh-113317, AC: Add libclinic.converter module (#116821)
Victor Stinner [Thu, 14 Mar 2024 17:59:43 +0000 (18:59 +0100)] 
gh-113317, AC: Add libclinic.converter module (#116821)

* Move CConverter class to a new libclinic.converter module.
* Move CRenderData and Include classes to a new libclinic.crenderdata
  module.

19 months agogh-112795: Move the test for ZipFile into the core tests for zipfile. (#116823)
Jason R. Coombs [Thu, 14 Mar 2024 17:50:24 +0000 (13:50 -0400)] 
gh-112795: Move the test for ZipFile into the core tests for zipfile. (#116823)

Move the test for ZipFile into the core tests for zipfile.

19 months agoGH-116422: Factor out eval breaker checks at end of calls into its own micro-op....
Mark Shannon [Thu, 14 Mar 2024 16:31:47 +0000 (16:31 +0000)] 
GH-116422: Factor out eval breaker checks at end of calls into its own micro-op. (GH-116817)

19 months agogh-111696, PEP 737: Add PyType_GetFullyQualifiedName() function (#116815)
Victor Stinner [Thu, 14 Mar 2024 16:19:36 +0000 (17:19 +0100)] 
gh-111696, PEP 737: Add PyType_GetFullyQualifiedName() function (#116815)

Rewrite tests on type names in Python, they were written in C.

19 months agogh-113317, AC: Add libclinic.block_parser module (#116819)
Victor Stinner [Thu, 14 Mar 2024 16:11:39 +0000 (17:11 +0100)] 
gh-113317, AC: Add libclinic.block_parser module (#116819)

* Move Block and BlockParser classes to a new libclinic.block_parser
  module.
* Move Language and PythonLanguage classes to a new
  libclinic.language module.

19 months agogh-116731: libregrtest: Clear inspect & importlib.metadata caches in clear_caches...
Petr Viktorin [Thu, 14 Mar 2024 15:47:12 +0000 (16:47 +0100)] 
gh-116731: libregrtest: Clear inspect & importlib.metadata caches in clear_caches (GH-116805)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
19 months agogh-88494: Use QueryPerformanceCounter() for time.monotonic() (#116781)
Victor Stinner [Thu, 14 Mar 2024 15:42:41 +0000 (16:42 +0100)] 
gh-88494: Use QueryPerformanceCounter() for time.monotonic() (#116781)

On Windows, time.monotonic() now uses the QueryPerformanceCounter()
clock to have a resolution better than 1 us, instead of the
gGetTickCount64() clock which has a resolution of 15.6 ms.

19 months agoCI: Only test free-threading with faster macOS M1 (#116814)
Hugo van Kemenade [Thu, 14 Mar 2024 15:10:56 +0000 (17:10 +0200)] 
CI: Only test free-threading with faster macOS M1 (#116814)

Only test free-threading with faster macOS M1

19 months agogh-113317, AC: Add libclinic.function (#116807)
Victor Stinner [Thu, 14 Mar 2024 14:37:22 +0000 (15:37 +0100)] 
gh-113317, AC: Add libclinic.function (#116807)

Move Module, Class, Function and Parameter classes to a new
libclinic.function module.

Move VersionTuple and Sentinels to libclinic.utils.

19 months agogh-116646, AC: Always use PyObject_AsFileDescriptor() in fildes (#116806)
Victor Stinner [Thu, 14 Mar 2024 13:58:07 +0000 (14:58 +0100)] 
gh-116646, AC: Always use PyObject_AsFileDescriptor() in fildes (#116806)

The fildes converter of Argument Clinic now always call
PyObject_AsFileDescriptor(), not only for the limited C API.

The _PyLong_FileDescriptor_Converter() converter stays as a fallback
when PyObject_AsFileDescriptor() cannot be used.

19 months agogh-116646, AC: Add CConverter.use_converter() method (#116793)
Victor Stinner [Thu, 14 Mar 2024 12:57:02 +0000 (13:57 +0100)] 
gh-116646, AC: Add CConverter.use_converter() method (#116793)

Only add includes when the converter is effectively used.

19 months agogh-85283: Build fcntl extension with the limited C API (#116791)
Victor Stinner [Thu, 14 Mar 2024 12:01:13 +0000 (13:01 +0100)] 
gh-85283: Build fcntl extension with the limited C API (#116791)

19 months agogh-116780: Fix `test_inspect` in `-OO` mode (#116788)
Nikita Sobolev [Thu, 14 Mar 2024 10:16:18 +0000 (13:16 +0300)] 
gh-116780: Fix `test_inspect` in `-OO` mode (#116788)

19 months agogh-90300: Fix undocumented envvars in the Python CLI help (GH-116765)
Serhiy Storchaka [Thu, 14 Mar 2024 10:09:19 +0000 (12:09 +0200)] 
gh-90300: Fix undocumented envvars in the Python CLI help (GH-116765)

19 months agogh-113308: Remove some internal parts of `uuid` module (#115934)
Nikita Sobolev [Thu, 14 Mar 2024 10:01:41 +0000 (13:01 +0300)] 
gh-113308: Remove some internal parts of `uuid` module (#115934)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
19 months agogh-116785: Fix direct invocation of `test_inspect` (#116787)
Nikita Sobolev [Thu, 14 Mar 2024 09:55:54 +0000 (12:55 +0300)] 
gh-116785: Fix direct invocation of `test_inspect` (#116787)

19 months agogh-116646: Add limited C API support to AC fildes converter (#116769)
Victor Stinner [Thu, 14 Mar 2024 09:28:58 +0000 (10:28 +0100)] 
gh-116646: Add limited C API support to AC fildes converter (#116769)

Add tests on the "fildes" converter to _testclinic_limited.

19 months agogh-113317, AC: Move warn() and fail() to libclinic.errors (#116770)
Victor Stinner [Thu, 14 Mar 2024 08:07:01 +0000 (09:07 +0100)] 
gh-113317, AC: Move warn() and fail() to libclinic.errors (#116770)

19 months agoGH-114736: Use WASI SDK 21 (GH-116771)
Brett Cannon [Thu, 14 Mar 2024 01:45:33 +0000 (18:45 -0700)] 
GH-114736: Use WASI SDK 21 (GH-116771)

19 months agoGH-115983: skip building shared modules for testing under WASI (GH-116528)
Brett Cannon [Wed, 13 Mar 2024 23:25:50 +0000 (16:25 -0700)] 
GH-115983: skip building shared modules for testing under WASI (GH-116528)

19 months agoDocs: PyUnstable_Long_IsCompact() docs now mention PyLong_AsNativeBytes() (#116634)
Sergey B Kirpichev [Wed, 13 Mar 2024 23:01:13 +0000 (02:01 +0300)] 
Docs: PyUnstable_Long_IsCompact() docs now mention PyLong_AsNativeBytes() (#116634)

19 months agoDocs: fix spelling of the word 'transferring' (#116641)
guangwu [Wed, 13 Mar 2024 22:53:32 +0000 (06:53 +0800)] 
Docs: fix spelling of the word 'transferring' (#116641)

19 months agogh-116760: Fix pystats for trace attempts (GH-116761)
Michael Droettboom [Wed, 13 Mar 2024 22:13:33 +0000 (18:13 -0400)] 
gh-116760: Fix pystats for trace attempts (GH-116761)

There are now at least two bytecodes that may attempt to optimize,
JUMP_BACK, and more recently, COLD_EXIT.

Only the JUMP_BACK was counting the attempt in the stats.
This moves that counter to uop_optimize itself so it should
always happen no matter where it is called from.

19 months agogh-90300: Document equivalent -X options for envvars in the Python CLI help (GH-116756)
Serhiy Storchaka [Wed, 13 Mar 2024 20:59:16 +0000 (22:59 +0200)] 
gh-90300: Document equivalent -X options for envvars in the Python CLI help (GH-116756)

19 months agoGH-115979: update test_importlib to work under WASI SDK 21 (GH-116754)
Brett Cannon [Wed, 13 Mar 2024 20:24:28 +0000 (13:24 -0700)] 
GH-115979: update test_importlib to work under WASI SDK 21 (GH-116754)

19 months agoBetter presentation order for recipes. (gh-116755)
Raymond Hettinger [Wed, 13 Mar 2024 20:02:56 +0000 (15:02 -0500)] 
Better presentation order for recipes. (gh-116755)

19 months agogh-90300: Sort the -X options and some envvars in the Python CLI help (GH-116739)
Serhiy Storchaka [Wed, 13 Mar 2024 19:15:44 +0000 (21:15 +0200)] 
gh-90300: Sort the -X options and some envvars in the Python CLI help (GH-116739)

19 months agogh-116631: Fix race condition in `test_shutdown_immediate_put_join` (#116670)
Sam Gross [Wed, 13 Mar 2024 18:56:28 +0000 (14:56 -0400)] 
gh-116631: Fix race condition in `test_shutdown_immediate_put_join` (#116670)

The test case had a race condition: if `q.task_done()` was executed
after `shutdown(immediate=True)`, then it would raise an exception
because the immediate shutdown already emptied the queue. This happened
rarely with the GIL (due to the switching interval), but frequently in
the free-threaded build.

19 months agogh-100746: Improve `test_named_expressions.py` (#116713)
Nikita Sobolev [Wed, 13 Mar 2024 18:12:40 +0000 (21:12 +0300)] 
gh-100746: Improve `test_named_expressions.py` (#116713)

19 months agogh-98731: Improvements to the logging documentation (GH-101618)
Nir Friedman [Wed, 13 Mar 2024 15:58:30 +0000 (11:58 -0400)] 
gh-98731: Improvements to the logging documentation (GH-101618)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
19 months agogh-116604: Fix test_gc on free-threaded build (#116662)
Sam Gross [Wed, 13 Mar 2024 13:27:36 +0000 (09:27 -0400)] 
gh-116604: Fix test_gc on free-threaded build (#116662)

The free-threaded GC only does full collections, so it uses a threshold that
is a maximum of a fixed value (default 2000) and proportional to the number of
live objects. If there were many live objects after the previous collection,
then the threshold may be larger than 10,000 causing
`test_indirect_calls_with_gc_disabled` to fail.

This manually sets the threshold to `(1000, 0, 0)` for the test. The `0`
disables the proportional scaling.

19 months ago[doc]: Update cookbook recipe for Qt6. (GH-116719)
Vinay Sajip [Wed, 13 Mar 2024 13:22:47 +0000 (13:22 +0000)] 
[doc]: Update cookbook recipe for Qt6. (GH-116719)

19 months agogh-110918: Fix side effects of regrtest test_match_tests() (#116718)
Victor Stinner [Wed, 13 Mar 2024 13:20:33 +0000 (14:20 +0100)] 
gh-110918: Fix side effects of regrtest test_match_tests() (#116718)

test_match_tests now saves and restores patterns.

Add get_match_tests() function to libregrtest.filter.

Previously, running test_regrtest multiple times in a row only ran
tests once: "./python -m test test_regrtest -R 3:3.

19 months agogh-90300: Fix cmdline.rst (GH-116721)
Serhiy Storchaka [Wed, 13 Mar 2024 13:03:13 +0000 (15:03 +0200)] 
gh-90300: Fix cmdline.rst (GH-116721)

* Fix the description of the "-b" option.
* Add references to environment variables for "-s" and "-X dev" options.

19 months agogh-115419: Change default sym to not_null (GH-116562)
Ken Jin [Wed, 13 Mar 2024 12:57:48 +0000 (20:57 +0800)] 
gh-115419: Change default sym to not_null (GH-116562)

19 months agogh-116714: Handle errors correctly in `PyFloat_GetInfo` (#116715)
Nikita Sobolev [Wed, 13 Mar 2024 12:38:03 +0000 (15:38 +0300)] 
gh-116714: Handle errors correctly in `PyFloat_GetInfo` (#116715)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
19 months agogh-116401: Fix blocking os.fwalk() and shutil.rmtree() on opening a named pipe (GH...
Serhiy Storchaka [Wed, 13 Mar 2024 09:40:28 +0000 (11:40 +0200)] 
gh-116401: Fix blocking os.fwalk() and shutil.rmtree() on opening a named pipe (GH-116421)

19 months agogh-116626: Emit `CALL` events for all `INSTRUMENTED_CALL_FUNCTION_EX` (GH-116627)
Tian Gao [Wed, 13 Mar 2024 08:28:01 +0000 (01:28 -0700)] 
gh-116626: Emit `CALL` events for all `INSTRUMENTED_CALL_FUNCTION_EX` (GH-116627)

19 months agogh-96471: Add ShutDown to queue.py '__all__' (#116699)
Laurie O [Wed, 13 Mar 2024 07:21:30 +0000 (17:21 +1000)] 
gh-96471: Add ShutDown to queue.py '__all__' (#116699)

19 months agoModernize roundrobin() recipe and improve variable names (gh-116710)
Raymond Hettinger [Wed, 13 Mar 2024 07:12:30 +0000 (02:12 -0500)] 
Modernize roundrobin() recipe and improve variable names (gh-116710)

19 months agogh-116491: Improve `test_win32_ver` (#116506)
Nikita Sobolev [Wed, 13 Mar 2024 06:46:48 +0000 (09:46 +0300)] 
gh-116491: Improve `test_win32_ver` (#116506)

19 months agogh-115264: Fix `test_functools` with `-00` mode (#115276)
Nikita Sobolev [Wed, 13 Mar 2024 06:41:37 +0000 (09:41 +0300)] 
gh-115264: Fix `test_functools` with `-00` mode (#115276)

19 months agogh-111307: Update design FAQ 'switch' entry (#115899)
Terry Jan Reedy [Wed, 13 Mar 2024 05:30:39 +0000 (01:30 -0400)] 
gh-111307: Update design FAQ 'switch' entry (#115899)

19 months agoDocs: fix broken links (#116651)
Mariusz Felisiak [Wed, 13 Mar 2024 04:19:33 +0000 (05:19 +0100)] 
Docs: fix broken links (#116651)

19 months agoMinor clarity improvement for the iter_index() recipe. Also add value subsequence...
Raymond Hettinger [Wed, 13 Mar 2024 02:33:42 +0000 (21:33 -0500)] 
Minor clarity improvement for the iter_index() recipe. Also add value subsequence tests. (gh-116696)

19 months agoGH-116554: Relax list.sort()'s notion of "descending" runs (#116578)
Tim Peters [Wed, 13 Mar 2024 00:59:42 +0000 (19:59 -0500)] 
GH-116554: Relax list.sort()'s notion of "descending" runs (#116578)

* GH-116554: Relax list.sort()'s notion of "descending" run

Rewrote `count_run()` so that sub-runs of equal elements no longer end a descending run. Both ascending and descending runs can have arbitrarily many sub-runs of arbitrarily many equal elements now. This is tricky, because we only use ``<`` comparisons, so checking for equality doesn't come "for free". Surprisingly, it turned out there's a very cheap (one comparison) way to determine whether an ascending run consisted of all-equal elements. That sealed the deal.

In addition, after a descending run is reversed in-place, we now go on to see whether it can be extended by an ascending run that just happens to be adjacent. This succeeds in finding at least one additional element to append about half the time, and so appears to more than repay its cost (the savings come from getting to skip a binary search, when a short run is artificially forced to length MIINRUN later, for each new element `count_run()` can add to the initial run).

While these have been in the back of my mind for years, a question on StackOverflow pushed it to action:

https://stackoverflow.com/questions/78108792/

They were wondering why it took about 4x longer to sort a list like:

[999_999, 999_999, ..., 2, 2, 1, 1, 0, 0]

than "similar" lists. Of course that runs very much faster after this patch.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
19 months agogh-116682: stdout may be empty in test_cancel_futures_wait_false (#116683)
Sam Gross [Wed, 13 Mar 2024 00:11:58 +0000 (20:11 -0400)] 
gh-116682: stdout may be empty in test_cancel_futures_wait_false (#116683)

If the `shutdown()` call happens before the worker thread starts executing
the task, then nothing will be printed to stdout.

19 months agoMerge branch 'main' of https://github.com/python/cpython
Thomas Wouters [Tue, 12 Mar 2024 23:46:31 +0000 (00:46 +0100)] 
Merge branch 'main' of https://github.com/python/cpython

19 months agoPost 3.13.0a5
Thomas Wouters [Tue, 12 Mar 2024 23:46:17 +0000 (00:46 +0100)] 
Post 3.13.0a5

19 months agoGH-116098: Remove dead frame object creation code (GH-116687)
Tian Gao [Tue, 12 Mar 2024 23:35:28 +0000 (16:35 -0700)] 
GH-116098: Remove dead frame object creation code (GH-116687)

19 months agoAdd `typing.NamedTuple` in glossary section for named tuples (#108327)
Tushar Sadhwani [Tue, 12 Mar 2024 22:46:42 +0000 (04:16 +0530)] 
Add `typing.NamedTuple` in glossary section for named tuples (#108327)

19 months agogh-116621: Set manual critical section for list.extend (gh-116657)
Donghee Na [Tue, 12 Mar 2024 22:28:23 +0000 (07:28 +0900)] 
gh-116621: Set manual critical section for list.extend (gh-116657)

19 months agoBeef-up tests for the itertool docs. (gh-116679)
Raymond Hettinger [Tue, 12 Mar 2024 22:19:58 +0000 (17:19 -0500)] 
Beef-up tests for the itertool docs. (gh-116679)

19 months agogh-89547: typing.rst: Add note about change in behavior with ClassVar/Final (#116686)
Jelle Zijlstra [Tue, 12 Mar 2024 22:17:53 +0000 (15:17 -0700)] 
gh-89547: typing.rst: Add note about change in behavior with ClassVar/Final (#116686)

19 months agogh-116307: Proper fix for 'mod' leaking across importlib tests (#116680)
Jason R. Coombs [Tue, 12 Mar 2024 21:36:21 +0000 (17:36 -0400)] 
gh-116307: Proper fix for 'mod' leaking across importlib tests (#116680)

gh-116307: Create a new import helper 'isolated modules' and use that instead of 'Clean Import' to ensure that tests from importlib_resources don't leave modules in sys.modules.

19 months agoPython 3.13.0a5 v3.13.0a5
Thomas Wouters [Tue, 12 Mar 2024 17:34:05 +0000 (18:34 +0100)] 
Python 3.13.0a5

19 months agoCI: Process stale issues twice per day (#116636)
Hugo van Kemenade [Tue, 12 Mar 2024 17:49:26 +0000 (19:49 +0200)] 
CI: Process stale issues twice per day (#116636)

19 months agogh-116656: Fix test_capi test_py_config_isoloated_per_interpreter() (#116658)
Victor Stinner [Tue, 12 Mar 2024 17:31:35 +0000 (18:31 +0100)] 
gh-116656: Fix test_capi test_py_config_isoloated_per_interpreter() (#116658)

Don't parse argv when setting the configuration, to avoid SystemExit if parsing argv fails.

19 months agogh-116604: Check for `gcstate->enabled` in _Py_RunGC in free-threaded build (#116663)
Sam Gross [Tue, 12 Mar 2024 17:12:02 +0000 (13:12 -0400)] 
gh-116604: Check for `gcstate->enabled` in _Py_RunGC in free-threaded build (#116663)

This isn't strictly necessary because the implementation of `gc_should_collect`
already checks `gcstate->enabled` in the free-threaded build, but it seems
like a good idea until the common pieces of gc.c and gc_free_threading.c are
refactored out.

19 months agogh-116127: PEP-705: Add `ReadOnly` support for `TypedDict` (#116350)
Nikita Sobolev [Tue, 12 Mar 2024 14:49:39 +0000 (17:49 +0300)] 
gh-116127: PEP-705: Add `ReadOnly` support for `TypedDict` (#116350)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
19 months agoFix code comment regarding DK_ENTRIES (GH-113960)
Matthias Diener [Tue, 12 Mar 2024 14:05:30 +0000 (09:05 -0500)] 
Fix code comment regarding DK_ENTRIES (GH-113960)

fix code comment regarding dict entries

19 months agogh-116616: Use relaxed atomic ops to access socket module defaulttimeout (#116623)
Erlend E. Aasland [Tue, 12 Mar 2024 13:44:39 +0000 (14:44 +0100)] 
gh-116616: Use relaxed atomic ops to access socket module defaulttimeout (#116623)

Co-authored-by: Sam Gross <colesbury@gmail.com>
19 months agogh-116604: Correctly honor the gc status when calling _Py_RunGC (#116628)
Pablo Galindo Salgado [Tue, 12 Mar 2024 12:00:49 +0000 (12:00 +0000)] 
gh-116604: Correctly honor the gc status when calling _Py_RunGC (#116628)

19 months agogh-110819: Fix ‘kind’ may be used uninitialized warning in `longobject` (#116599)
Nikita Sobolev [Tue, 12 Mar 2024 10:50:06 +0000 (13:50 +0300)] 
gh-110819: Fix ‘kind’ may be used uninitialized warning in `longobject` (#116599)

19 months agogh-116541: Handle errors correctly in `_pystatvfs_fromstructstatvfs` (#116542)
Nikita Sobolev [Tue, 12 Mar 2024 10:10:00 +0000 (13:10 +0300)] 
gh-116541: Handle errors correctly in `_pystatvfs_fromstructstatvfs` (#116542)

19 months agogh-89547: Support for nesting special forms like Final (#116096)
Mehdi Drissi [Tue, 12 Mar 2024 06:11:56 +0000 (23:11 -0700)] 
gh-89547: Support for nesting special forms like Final (#116096)