]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
11 months ago[3.13] gh-127651: Use __file__ in diagnostics if origin is missing (#127660) (#127775)
Shantanu [Tue, 10 Dec 2024 05:21:55 +0000 (21:21 -0800)] 
[3.13] gh-127651: Use __file__ in diagnostics if origin is missing (#127660) (#127775)

gh-127651: Use __file__ in diagnostics if origin is missing (#127660)

See the left hand side in https://github.com/python/cpython/pull/123929/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59deL2840-L2849

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 3983527c3a6b389e373a233e514919555853ccb3)

11 months agogh-127732: Add Windows Server 2025 detection to platform module (GH-127733)
Miss Islington (bot) [Mon, 9 Dec 2024 12:50:34 +0000 (13:50 +0100)] 
gh-127732: Add Windows Server 2025 detection to platform module (GH-127733)

(cherry picked from commit 5eb7fd4d0fc37b91058086181afebec41e66e5ad)

Co-authored-by: Wulian <1055917385@qq.com>
11 months ago[3.13] gh-126925: Modify how iOS test results are gathered (GH-127592) (#127754)
Russell Keith-Magee [Mon, 9 Dec 2024 06:39:11 +0000 (14:39 +0800)] 
[3.13] gh-126925: Modify how iOS test results are gathered (GH-127592) (#127754)

Adds a `use_system_log` config item to enable stdout/stderr redirection for
Apple platforms. This log streaming is then used by a new iOS test runner
script, allowing the display of test suite output at runtime. The iOS test
runner script can be used by any Python project, not just the CPython test
suite.
(cherry picked from commit 2041a95e68ebf6d13f867e214ada28affa830669)

11 months ago[3.13] gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth...
Miss Islington (bot) [Sun, 8 Dec 2024 20:15:35 +0000 (21:15 +0100)] 
[3.13] gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth.__init__` (GH-127735) (#127744)

gh-127734: improve signature of `urllib.request.HTTPPasswordMgrWithPriorAuth.__init__` (GH-127735)

improve signature of urllib.request.HTTPPasswordMgrWithPriorAuth.__init__
(cherry picked from commit a03efb533a58fd13fb0cc7f4a5c02c8406a407bd)

Co-authored-by: Stephen Morton <git@tungol.org>
11 months ago[3.13] Give `poplib.POP3.rpop` a proper docstring (GH-127370) (#127721)
Miss Islington (bot) [Sat, 7 Dec 2024 16:41:23 +0000 (17:41 +0100)] 
[3.13] Give `poplib.POP3.rpop` a proper docstring (GH-127370) (#127721)

Give `poplib.POP3.rpop` a proper docstring (GH-127370)

Previously `poplib.POP3.rpop` had a "Not sure what this does" docstring, now it has been fixed.
(cherry picked from commit 27d0d2141319d82709eb09ba20065df3e1714fab)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
11 months ago[3.13] Fix typo in `Lib/_android_support.py` (GH-127699) (#127703)
Miss Islington (bot) [Fri, 6 Dec 2024 18:14:12 +0000 (19:14 +0100)] 
[3.13] Fix typo in `Lib/_android_support.py` (GH-127699) (#127703)

Fix typo in `Lib/_android_support.py` (GH-127699)
(cherry picked from commit e59caf67cdb8dae26470f00599ea8dbb00968a73)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
11 months ago[3.13] gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime...
Miss Islington (bot) [Fri, 6 Dec 2024 17:17:32 +0000 (18:17 +0100)] 
[3.13] gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (GH-127590) GH-127650)

gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in datetime.strptime patterns (GH-127590)

The code has required 4 digits for the year since its inclusion in the stdlib in 2002 (over 22 years ago as of this commit).
(cherry picked from commit 51cfa569e379f84b3418db0971a71b1ef575a42b)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
11 months ago[3.13] gh-125610: Fix `STORE_ATTR_INSTANCE_VALUE` specialization check (GH-125612...
Miss Islington (bot) [Fri, 6 Dec 2024 16:14:26 +0000 (17:14 +0100)] 
[3.13] gh-125610: Fix `STORE_ATTR_INSTANCE_VALUE` specialization check (GH-125612) (GH-127698)

The `STORE_ATTR_INSTANCE_VALUE` opcode doesn't support objects with
non-NULL managed dictionaries, so don't specialize to that op in that case.
(cherry picked from commit a353455fca1b8f468ff3ffbb4b5e316510b4fd43)

Co-authored-by: Sam Gross <colesbury@gmail.com>
11 months ago[3.13] gh-101100: amend references starting with `!~` in gh-127054 (GH-127684) (...
Miss Islington (bot) [Fri, 6 Dec 2024 14:19:08 +0000 (15:19 +0100)] 
[3.13] gh-101100: amend references starting with `!~` in gh-127054 (GH-127684) (#127692)

gh-101100: amend references starting with `!~` in gh-127054 (GH-127684)
(cherry picked from commit 77a61c0465c27c1c4ba7cddf4638d9ed75259671)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
11 months ago[3.13] gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol...
Miss Islington (bot) [Fri, 6 Dec 2024 05:12:23 +0000 (06:12 +0100)] 
[3.13] gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol if needed (GH-127656) (#127663)

gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol if needed (GH-127656)

Ensure `_SelectorSocketTransport.writelines` pauses the protocol if it reaches the high water mark as needed.
(cherry picked from commit e991ac8f2037d78140e417cc9a9486223eb3e786)

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
11 months ago[3.13] gh-127582: Make object resurrection thread-safe for free threading. (GH-127612...
Sam Gross [Thu, 5 Dec 2024 23:49:33 +0000 (23:49 +0000)] 
[3.13] gh-127582: Make object resurrection thread-safe for free threading. (GH-127612) (GH-127659)

Objects may be temporarily "resurrected" in destructors when calling
finalizers or watcher callbacks. We previously undid the resurrection
by decrementing the reference count using `Py_SET_REFCNT`. This was not
thread-safe because other threads might be accessing the object
(modifying its reference count) if it was exposed by the finalizer,
watcher callback, or temporarily accessed by a racy dictionary or list
access.

This adds internal-only thread-safe functions for temporary object
resurrection during destructors.
(cherry picked from commit f4f530804b9d8f089eba0f157ec2144c03b13651)

11 months ago[3.13] [Docs] GDB howto: Fix block type of a cast example (GH-127621) (#127653)
Miss Islington (bot) [Thu, 5 Dec 2024 20:58:36 +0000 (21:58 +0100)] 
[3.13] [Docs] GDB howto: Fix block type of a cast example (GH-127621) (#127653)

[Docs] GDB howto: Fix block type of a cast example (GH-127621)
(cherry picked from commit 657d0e99aa8754372786120d6ec00c9d9970e775)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
11 months ago[3.13] GH-126727: Fix test_era_nl_langinfo with Japanese ERAs on Solaris (GH-127327...
Miss Islington (bot) [Thu, 5 Dec 2024 19:08:12 +0000 (20:08 +0100)] 
[3.13] GH-126727: Fix test_era_nl_langinfo with Japanese ERAs on Solaris (GH-127327) (GH-127645)

(cherry picked from commit d958d9f4a1b71c6d30960bf6c53c41046ea94590)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
11 months ago[3.13] gh-122431: Disallow negative values in `readline.append_history_file` (GH...
Miss Islington (bot) [Thu, 5 Dec 2024 17:15:44 +0000 (18:15 +0100)] 
[3.13] gh-122431: Disallow negative values in `readline.append_history_file` (GH-122469) (#127641)

gh-122431: Disallow negative values in `readline.append_history_file` (GH-122469)
(cherry picked from commit 208b0fb645c0e14b0826c0014e74a0b70c58c9d6)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (GH-127593) (#127630)
Miss Islington (bot) [Thu, 5 Dec 2024 10:02:17 +0000 (11:02 +0100)] 
[3.13] gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (GH-127593) (#127630)

gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (GH-127593)
(cherry picked from commit fcbe6ecdb6ed4dd93b2ee144f89a73af755e2634)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127434: Fix iOS `xcrun --sdk` clang/ar scripts to allow arguments with...
Russell Keith-Magee [Thu, 5 Dec 2024 03:28:21 +0000 (11:28 +0800)] 
[3.13] gh-127434: Fix iOS `xcrun --sdk` clang/ar scripts to allow arguments with spaces (GH-127575) (#127624)

Added shell escaping to ensure iOS compiler shims can accept arguments with spaces.
(cherry picked from commit 6cf77949fba7b44f6885794b2028f091f42f5d6c)

Co-authored-by: Feodor Fitsner <feodor@appveyor.com>
11 months ago[3.13] gh-127536: Add missing locks in listobject.c (GH-127580) (GH-127613)
Sam Gross [Wed, 4 Dec 2024 20:17:19 +0000 (20:17 +0000)] 
[3.13] gh-127536: Add missing locks in listobject.c (GH-127580) (GH-127613)

We were missing locks around some list operations in the free threading
build.
(cherry picked from commit e51da64ac3bc6cd45339864db32d05115af39ead)

11 months ago[3.13] gh-127347: Document `traceback.print_list` (GH-127348) (#127569)
Miss Islington (bot) [Wed, 4 Dec 2024 08:28:14 +0000 (09:28 +0100)] 
[3.13] gh-127347: Document `traceback.print_list` (GH-127348) (#127569)

Add an documentation entry about `traceback.print_list`

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
11 months ago[3.13] Itertool recipe additions (gh-127483) (gh-127585)
Miss Islington (bot) [Wed, 4 Dec 2024 00:34:42 +0000 (01:34 +0100)] 
[3.13] Itertool recipe additions (gh-127483) (gh-127585)

11 months agoMerge branch '3.13' of https://github.com/python/cpython into 3.13
Thomas Wouters [Tue, 3 Dec 2024 21:43:45 +0000 (22:43 +0100)] 
Merge branch '3.13' of https://github.com/python/cpython into 3.13

11 months agoPost 3.13.1
Thomas Wouters [Tue, 3 Dec 2024 21:43:25 +0000 (22:43 +0100)] 
Post 3.13.1

11 months ago[3.13] gh-127421: Fix race in test_start_new_thread_failed (GH-127549) (#127574)
Miss Islington (bot) [Tue, 3 Dec 2024 18:30:08 +0000 (19:30 +0100)] 
[3.13] gh-127421: Fix race in test_start_new_thread_failed (GH-127549) (#127574)

gh-127421: Fix race in test_start_new_thread_failed (GH-127549)

Fix race in test_start_new_thread_failed

When we succeed in starting a new thread, for example if setrlimit
was ineffective, we must wait for the newly spawned thread to exit.
Otherwise, we run the risk that the newly spawned thread will race
with runtime finalization and access memory that has already been
clobbered/freed.

`_thread.start_new_thread()` only spawns daemon threads, which the runtime
does not wait for at shutdown, and does not return a handle. Use
`_thread.start_joinable_thread()` and join the resulting handle when
the thread is started successfully.
(cherry picked from commit 13b68e1a61e92a032d255aff5d5af435bbb63e8b)

Co-authored-by: mpage <mpage@meta.com>
11 months agoPython 3.13.1 v3.13.1
Thomas Wouters [Tue, 3 Dec 2024 17:55:12 +0000 (18:55 +0100)] 
Python 3.13.1

11 months ago[3.13] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952) (#122984)
Miss Islington (bot) [Tue, 3 Dec 2024 16:46:30 +0000 (17:46 +0100)] 
[3.13] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952) (#122984)

gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952)

As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working.  This is a minimal fix just to get builds working again.  There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately.
(cherry picked from commit ee1b8ce26e700350e47a5f65201097121c41912e)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
11 months ago[3.13] gh-123935: Fix typo in `_get_slots` in `dataclasses.py` (GH-123941) (#123991)
Miss Islington (bot) [Tue, 3 Dec 2024 16:17:25 +0000 (17:17 +0100)] 
[3.13] gh-123935: Fix typo in `_get_slots` in `dataclasses.py` (GH-123941) (#123991)

gh-123935: Fix typo in `_get_slots` in `dataclasses.py` (GH-123941)
(cherry picked from commit ac918ccad707ab2d7dbb78a4796a7b8a874f334c)

Co-authored-by: sobolevn <mail@sobolevn.me>
11 months ago[3.13] gh-122792: Make IPv4-mapped IPv6 address properties consistent with IPv4 ...
Miss Islington (bot) [Tue, 3 Dec 2024 16:12:36 +0000 (17:12 +0100)] 
[3.13] gh-122792: Make IPv4-mapped IPv6 address properties consistent with IPv4 (GH-122793) (GH-123815)

Make IPv4-mapped IPv6 address properties consistent with IPv4.
(cherry picked from commit 76a1c5d18312712baed4699fe7333abb050ec9b7)

Co-authored-by: Seth Michael Larson <seth@python.org>
11 months ago[3.13] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) (GH-127557)
Miss Islington (bot) [Tue, 3 Dec 2024 12:57:42 +0000 (13:57 +0100)] 
[3.13] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) (GH-127557)

(cherry picked from commit 35d37d6592d1be71ea76042165f6cbfa6c4c3a17)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
11 months ago[3.13] gh-127521: Mark list as "shared" before resizing if necessary (GH-127524)...
Miss Islington (bot) [Tue, 3 Dec 2024 00:22:05 +0000 (01:22 +0100)] 
[3.13] gh-127521: Mark list as "shared" before resizing if necessary (GH-127524) (GH-127533)

In the free threading build, if a non-owning thread resizes a list,
it must use QSBR to free the old list array because there may be a
concurrent access (without a lock) from the owning thread.

To match the pattern in dictobject.c, we just mark the list as "shared"
before resizing if it's from a non-owning thread and not already marked
as shared.
(cherry picked from commit c7dec02de2ed4baf3cd22ad094350265b52c18af)

Co-authored-by: Sam Gross <colesbury@gmail.com>
11 months agogh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)
Miss Islington (bot) [Mon, 2 Dec 2024 20:11:16 +0000 (21:11 +0100)] 
gh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)

(cherry picked from commit 4b00aba42e4d9440d22e399ec2122fe8601bbe54)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
11 months ago[3.13] gh-126914: Store the Preallocated Thread State's Pointer in a PyInterpreterSta...
Eric Snow [Mon, 2 Dec 2024 18:41:57 +0000 (11:41 -0700)] 
[3.13] gh-126914: Store the Preallocated Thread State's Pointer in a PyInterpreterState Field (gh-127114)

This approach eliminates the originally reported race.  It also gets rid of the deadlock reported in gh-96071, so we can remove the workaround added then.

This is mostly a cherry-pick of 1c0a104 (AKA gh-126989).  The difference is we add PyInterpreterState.threads_preallocated at the end of PyInterpreterState, instead of adding PyInterpreterState.threads.preallocated.  That avoids ABI disruption.

11 months ago[3.13] gh-126876: Fix socket internal_select() for large timeout (GH-126968) (#127002)
Miss Islington (bot) [Mon, 2 Dec 2024 16:25:55 +0000 (17:25 +0100)] 
[3.13] gh-126876: Fix socket internal_select() for large timeout (GH-126968) (#127002)

gh-126876: Fix socket internal_select() for large timeout (GH-126968)

If the timeout is larger than INT_MAX, replace it with INT_MAX, in
the poll() code path.

Add an unit test.
(cherry picked from commit b3687ad454c4ac54c8599a10f3ace8a13ca48915)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-126890: Restore stripped `ssl` docstrings (GH-127281) (#127513)
Peter Bierma [Mon, 2 Dec 2024 15:05:27 +0000 (10:05 -0500)] 
[3.13] gh-126890: Restore stripped `ssl` docstrings (GH-127281) (#127513)

(cherry picked from commit c112de1da2d18e3b5c2ea30b0e409f18e574efd8)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
11 months ago[3.13] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211...
Miss Islington (bot) [Mon, 2 Dec 2024 14:42:02 +0000 (15:42 +0100)] 
[3.13] gh-113841: fix possible undefined division by 0 in _Py_c_pow() (GH-127211) (#127216)

Note, that transformed expression is not an equivalent for original one (1/exp(-x) != exp(x) in general for floating-point numbers). Though, the difference seems to be ~1ULP for good libm implementations.

It's more interesting why division was used from beginning. Closest algorithm I've found (no error checks, of course;)) - it's Algorithm 190 from ACM: https://dl.acm.org/doi/10.1145/366663.366679. It uses subtraction in the exponent.

(cherry picked from commit f7bb658124aba74be4c13f498bf46cfded710ef9)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
11 months ago[3.13] add missing gc_collect() calls in sqlite3 tests (GH-127446) (#127500)
Miss Islington (bot) [Mon, 2 Dec 2024 14:19:21 +0000 (15:19 +0100)] 
[3.13] add missing gc_collect() calls in sqlite3 tests (GH-127446) (#127500)

add missing gc_collect() calls in sqlite3 tests (GH-127446)
(cherry picked from commit 2a373da7700cf928e0a5ce3998d19351a3565df4)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
11 months ago[3.13] gh-126720: Docs: Miscellaneous corrections to simple statements in the languag...
Carol Willing [Mon, 2 Dec 2024 14:10:59 +0000 (06:10 -0800)] 
[3.13] gh-126720: Docs: Miscellaneous corrections to simple statements in the language reference (GH-126720) (#126885)

Docs: Miscellaneous corrections to simple statements in the language reference (GH-126720)

* Replace: The :keyword:`global` -> The :keyword:`global` statement
Add :keyword: when it's needed

* Replace repeated links with duoble backticks

(cherry picked from commit 94a7a4e22fb8f567090514785c69e65298acca42)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
11 months ago[3.13] gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702...
Miss Islington (bot) [Mon, 2 Dec 2024 14:10:25 +0000 (15:10 +0100)] 
[3.13] gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702) (#126762)

gh-126699: allow AsyncIterator to be used as a base for Protocols (GH-126702)
(cherry picked from commit feb3e0b19cb03f06364a3f5e970f0861b8883d1c)

Co-authored-by: Stephen Morton <github@tungol.org>
11 months ago[3.13] gh-122838: Document missing opcodes (GH-123073) (#126492)
Miss Islington (bot) [Mon, 2 Dec 2024 14:07:38 +0000 (15:07 +0100)] 
[3.13] gh-122838: Document missing opcodes (GH-123073) (#126492)

gh-122838: Document missing opcodes (GH-123073)
(cherry picked from commit 9cba47d9f151734815a61e32391ea7fca877ea55)

Co-authored-by: Kamil Turek <kamil.turek@hotmail.com>
11 months ago[3.13] gh-99880: document rounding mode for new-style formatting (GH-121481) (#126334)
Miss Islington (bot) [Mon, 2 Dec 2024 14:05:13 +0000 (15:05 +0100)] 
[3.13] gh-99880: document rounding mode for new-style formatting (GH-121481) (#126334)

The CPython uses _Py_dg_dtoa(), which does rounding to nearest with half
to even tie-breaking rule.

If that functions is unavailable, PyOS_double_to_string() fallbacks to
system snprintf().  Since CPython 3.12, build requirements include C11
compiler *and* support for IEEE 754 floating point numbers (Annex F).
This means that FE_TONEAREST macro is available and, per default,
printf-like functions should use same rounding mode as _Py_dg_dtoa().

(cherry picked from commit 7d7d56d8b1147a6b85e1c09d01b164df7c5c4942)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.13] gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732) ...
Miss Islington (bot) [Mon, 2 Dec 2024 14:04:51 +0000 (15:04 +0100)] 
[3.13] gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732) (#126023)

gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732)
(cherry picked from commit 44becb8cba677cbfdbcf2f7652277e5e1efc4f20)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
11 months ago[3.13] gh-124984: Enhance `ssl` thread safety (GH-124993) (#125780)
Peter Bierma [Mon, 2 Dec 2024 14:03:44 +0000 (09:03 -0500)] 
[3.13] gh-124984: Enhance `ssl` thread safety (GH-124993) (#125780)

Make SSL objects thread safe in Free Theaded build by
using critical sections.

(cherry picked from commit 4c53b2577531c77193430cdcd66ad6385fcda81f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.13] gh-125703: Correctly honour tracemalloc hooks on specialized DECREF paths...
Miss Islington (bot) [Mon, 2 Dec 2024 14:02:20 +0000 (15:02 +0100)] 
[3.13] gh-125703: Correctly honour tracemalloc hooks on specialized DECREF paths (GH-125704) (#125705)

gh-125703: Correctly honour tracemalloc hooks on specialized DECREF paths (GH-125704)
(cherry picked from commit f8ba9fb2ce6690d2dd05b356583e8e4790badad7)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
11 months ago[3.13] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127511)
Miss Islington (bot) [Mon, 2 Dec 2024 13:57:40 +0000 (14:57 +0100)] 
[3.13] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127511)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
11 months ago[3.13] gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048) (#127508)
Miss Islington (bot) [Mon, 2 Dec 2024 13:38:13 +0000 (14:38 +0100)] 
[3.13] gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048) (#127508)

gh-126618: fix repr(itertools.count(sys.maxsize)) (GH-127048)
(cherry picked from commit 930ba0ce605eee9e3b992fa368b00a3f2b7dc4c1)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.13] Fix Unicode encode_wstr_utf8() (#127420) (#127505)
Bénédikt Tran [Mon, 2 Dec 2024 12:24:03 +0000 (13:24 +0100)] 
[3.13] Fix Unicode encode_wstr_utf8() (#127420) (#127505)

Fix Unicode encode_wstr_utf8() (#127420)

Raise RuntimeError instead of RuntimeWarning.

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) (#127496)
Miss Islington (bot) [Mon, 2 Dec 2024 08:28:15 +0000 (09:28 +0100)] 
[3.13] gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451) (#127496)

gh-127443: Fix some entries in `Doc/data/refcounts.dat` (GH-127451)

Fix incorrect entries in `Doc/data/refcounts.dat`
(cherry picked from commit 1f8267b85dda655282922ba20df90d0ac6bea634)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.13] gh-127321: Avoid stopping at an opcode without an associated line number for...
Tian Gao [Sun, 1 Dec 2024 22:58:08 +0000 (14:58 -0800)] 
[3.13] gh-127321: Avoid stopping at an opcode without an associated line number for breakpoint() (GH-127457) (#127487)

(cherry picked from commit 1bc4f076d193ad157bdc69a1d62685a15f95113f)

11 months ago[3.13] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) ...
Miss Islington (bot) [Sun, 1 Dec 2024 09:21:34 +0000 (10:21 +0100)] 
[3.13] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) (#127470)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
11 months ago[3.13] Docs: Fix incorrect indents in `c-api/type.rst` (GH-127449) (#127460)
Yuki Kobayashi [Sun, 1 Dec 2024 08:50:51 +0000 (17:50 +0900)] 
[3.13] Docs: Fix incorrect indents in `c-api/type.rst` (GH-127449) (#127460)

(cherry picked from commit 33ce8dcf791721fea563715f681dc1593a35b83b)

11 months ago[3.13] Add the missing `f` on an f-string error message in multiprocessing. (GH-12746...
Miss Islington (bot) [Sun, 1 Dec 2024 07:50:01 +0000 (08:50 +0100)] 
[3.13] Add the missing `f` on an f-string error message in multiprocessing. (GH-127462) (#127464)

Add the missing `f` on an f-string error message in multiprocessing. (GH-127462)
(cherry picked from commit 11c01092d5fa8f02c867a7f1f3c135ce63db4838)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
11 months ago[3.13] gh-127165: Disallow embedded NULL characters in `_interpreters` (GH-127199...
Miss Islington (bot) [Sun, 1 Dec 2024 06:55:55 +0000 (07:55 +0100)] 
[3.13] gh-127165: Disallow embedded NULL characters in `_interpreters` (GH-127199) (#127463)

gh-127165: Disallow embedded NULL characters in `_interpreters` (GH-127199)
(cherry picked from commit 46bfd26fb294a8769ef6d0c056ee6c9df022a037)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
11 months ago[3.13] gh-127190: Fix local_setattro() error handling (GH-127366) (#127367)
Miss Islington (bot) [Sun, 1 Dec 2024 06:48:04 +0000 (07:48 +0100)] 
[3.13] gh-127190: Fix local_setattro() error handling (GH-127366) (#127367)

gh-127190: Fix local_setattro() error handling (GH-127366)

Don't make the assumption that the 'name' argument is a string. Use
repr() to format the 'name' argument instead.
(cherry picked from commit 20657fbdb14d50ca4ec115da0cbef155871d8d33)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127341: Argument Clinic: fix compiler warnings for getters with docstrings...
Peter Bierma [Sat, 30 Nov 2024 22:25:51 +0000 (17:25 -0500)] 
[3.13] gh-127341: Argument Clinic: fix compiler warnings for getters with docstrings (GH-127310) (#127431)

(cherry picked from commit 99490913a08adcf2fe5e69b82772a829ec462275)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
11 months ago[3.13] summarize: Fix typo in stats (GH-127450) (#127454)
Miss Islington (bot) [Sat, 30 Nov 2024 16:32:13 +0000 (17:32 +0100)] 
[3.13] summarize: Fix typo in stats (GH-127450) (#127454)

Co-authored-by: alm <alonme@users.noreply.github.com>
11 months ago[3.13] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299)...
Miss Islington (bot) [Sat, 30 Nov 2024 09:19:13 +0000 (10:19 +0100)] 
[3.13] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299) (GH-127323)

(cherry picked from commit 83926d3b4c7847394b5e2531e9566d7fc9fbea0f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-124008: Fix calculation of the number of written bytes for the Windows...
Miss Islington (bot) [Sat, 30 Nov 2024 09:16:45 +0000 (10:16 +0100)] 
[3.13] gh-124008: Fix calculation of the number of written bytes for the Windows console (GH-124059) (GH-127325)

Since MultiByteToWideChar()/WideCharToMultiByte() is not reversible if
the data contains invalid UTF-8 sequences, use binary search to
calculate the number of written bytes from the number of written
characters.

Also fix writing incomplete UTF-8 sequences.

Also fix handling of memory allocation failures.
(cherry picked from commit 3cf83d91a5baf3600dd60f7aaaf4fb6d73c4b8a9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-123967: Fix faulthandler for trampoline frames (GH-127329) (#127362)
Miss Islington (bot) [Sat, 30 Nov 2024 09:14:29 +0000 (10:14 +0100)] 
[3.13] gh-123967: Fix faulthandler for trampoline frames (GH-127329) (#127362)

gh-123967: Fix faulthandler for trampoline frames (GH-127329)

If the top-most frame is a trampoline frame, skip it.
(cherry picked from commit 58e334e1431b2ed6b70ee42501ea73e08084e769)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127217: Fix pathname2url() for paths starting with multiple slashes on...
Miss Islington (bot) [Sat, 30 Nov 2024 09:11:24 +0000 (10:11 +0100)] 
[3.13] gh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix (GH-127218) (GH-127230)

(cherry picked from commit 97b2ceaaaf88a73a45254912a0e972412879ccbf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127390)
Miss Islington (bot) [Sat, 30 Nov 2024 08:13:13 +0000 (09:13 +0100)] 
[3.13] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127390)

gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304)

---------

(cherry picked from commit dd3a87d2a8f8750978359a99de2c5cb2168351d1)

Co-authored-by: Илья Любавский <100635212+lubaskinc0de@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.13] gh-127316: fix incorrect assertion in setting `__class__` in free-threading...
Miss Islington (bot) [Fri, 29 Nov 2024 16:36:44 +0000 (17:36 +0100)] 
[3.13] gh-127316: fix incorrect assertion in setting `__class__` in free-threading (GH-127399) (#127422)

gh-127316: fix incorrect assertion in setting `__class__` in free-threading (GH-127399)
(cherry picked from commit 45c5cba318a19dda3ee6f9fc84781cc7a2fbde80)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
11 months ago[3.13] Link to correct class methods in asyncio primitives docs (GH-127270) (#127423)
Miss Islington (bot) [Fri, 29 Nov 2024 16:26:42 +0000 (17:26 +0100)] 
[3.13] Link to correct class methods in asyncio primitives docs (GH-127270) (#127423)

Link to correct class methods in asyncio primitives docs (GH-127270)
(cherry picked from commit 15d6506d175780bb29e5fcde654e3860408aa93e)

Co-authored-by: Ollanta Cuba Gyllensten <ollantaster@gmail.com>
11 months ago[3.13] gh-127208: Reject null character in _imp.create_dynamic() (GH-127400) (#127418)
Miss Islington (bot) [Fri, 29 Nov 2024 15:45:21 +0000 (16:45 +0100)] 
[3.13] gh-127208: Reject null character in _imp.create_dynamic() (GH-127400) (#127418)

gh-127208: Reject null character in _imp.create_dynamic() (GH-127400)

_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.
(cherry picked from commit b14fdadc6c620875a20b7ccc3c9b069e85d8557a)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-124873: Skip timerfd tests on Android (GH-127279) (#127290)
Miss Islington (bot) [Fri, 29 Nov 2024 11:46:47 +0000 (12:46 +0100)] 
[3.13] gh-124873: Skip timerfd tests on Android (GH-127279) (#127290)

gh-124873: Skip timerfd tests on Android (GH-127279)

* Revert "[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (GH-127105)"

This reverts commit c09366b1fed2289530581505834b2b262120a7c7.

* Skip timerfd tests on Android.

(cherry picked from commit 4ca2c82862e3810a7d68799df2bb5198a9afb219)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358)...
Miss Islington (bot) [Fri, 29 Nov 2024 11:01:59 +0000 (12:01 +0100)] 
[3.13] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358) (#127401)

gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358)

Replace the sleep(2) with a task which is blocked forever.
(cherry picked from commit bfabf96b50b7d6a9c15b298a86ba3633b05a1fd7)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] fix param type in PyObject_HasAttrWithError (docs) (GH-127403) (#127404)
Miss Islington (bot) [Fri, 29 Nov 2024 10:59:13 +0000 (11:59 +0100)] 
[3.13] fix param type in PyObject_HasAttrWithError (docs) (GH-127403) (#127404)

fix param type in PyObject_HasAttrWithError (docs) (GH-127403)
(cherry picked from commit 3afb639f39e89888194d8e74cc498c8da3a58d8e)

Co-authored-by: biggus-developerus <74741815+biggus-developerus@users.noreply.github.com>
11 months ago[3.13] gh-126881: fix finalization of dtoa state (GH-126904) (#127395)
Miss Islington (bot) [Fri, 29 Nov 2024 10:52:21 +0000 (11:52 +0100)] 
[3.13] gh-126881: fix finalization of dtoa state (GH-126904) (#127395)

gh-126881: fix finalization of dtoa state (GH-126904)
(cherry picked from commit 762c603a866146afc7db2591fb49605e0858e9b1)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
11 months ago[3.13] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (#127365) (#127393)
Hugo van Kemenade [Fri, 29 Nov 2024 09:59:57 +0000 (11:59 +0200)] 
[3.13] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (#127365) (#127393)

11 months ago[3.13] Fix indentation for contextlib.asynccontextmanager docs (GH-127333) (#127334)
Miss Islington (bot) [Wed, 27 Nov 2024 14:45:07 +0000 (15:45 +0100)] 
[3.13] Fix indentation for contextlib.asynccontextmanager docs (GH-127333) (#127334)

Fix indentation for contextlib.asynccontextmanager docs (GH-127333)
(cherry picked from commit 9328db7652677a23192cb51b0324a0fdbfa587c9)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
11 months ago[3.13] gh-122273: Support PyREPL history on Windows (#127141) (#127289)
Victor Stinner [Tue, 26 Nov 2024 11:17:13 +0000 (12:17 +0100)] 
[3.13] gh-122273: Support PyREPL history on Windows (#127141) (#127289)

gh-122273: Support PyREPL history on Windows (#127141)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
(cherry picked from commit 3c7a90a83146dc6e55f6f9ecd9af0bf9682f98a6)

11 months ago[3.13] gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055) (#127104)
Victor Stinner [Tue, 26 Nov 2024 11:01:50 +0000 (12:01 +0100)] 
[3.13] gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055) (#127104)

* gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055)

grpmodule.c is no longer built with the limited C API, since PyMutex
is excluded from the limited C API.

(cherry picked from commit 3c2bd66e21bd8de69a89ebf09ff9d8e78ddfb839)

* Revert ABI changes

Don't use Argument Clinic for grp.getgrgid() to avoid changing the
ABI (change PyInterpreterState structure by adding an "id"
identifier).

11 months ago[3.13] gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) (GH-127251)
Miss Islington (bot) [Tue, 26 Nov 2024 10:13:08 +0000 (11:13 +0100)] 
[3.13] gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184) (GH-127251)

gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184)

* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
(cherry picked from commit c7f1e3e150ca181f4b4bd1e5b59d492749f00be6)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
11 months ago[3.13] gh-101100: Fix sphinx warnings in `howto/*` (GH-127084) (#127287)
Miss Islington (bot) [Tue, 26 Nov 2024 08:27:25 +0000 (09:27 +0100)] 
[3.13] gh-101100: Fix sphinx warnings in `howto/*` (GH-127084) (#127287)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
11 months ago[3.13] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127269)
Miss Islington (bot) [Mon, 25 Nov 2024 21:39:59 +0000 (22:39 +0100)] 
[3.13] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127269)

(cherry picked from commit 26ff32b30553e1f7b0cc822835ad2da8890c180c)

Co-authored-by: funkyrailroad <funkyrailroad@users.noreply.github.com>
11 months ago[3.13] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value...
Miss Islington (bot) [Mon, 25 Nov 2024 17:56:42 +0000 (18:56 +0100)] 
[3.13] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219) (#127262)

gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219)
(cherry picked from commit a2ee89968299fc4f0da4b5a4165025b941213ba5)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610...
Miss Islington (bot) [Mon, 25 Nov 2024 12:18:27 +0000 (13:18 +0100)] 
[3.13] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610) (GH-127159)

(cherry picked from commit 7725c0371a93be3ccfaff4871014a80bdf0ea274)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
11 months ago[3.13] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127239)
Yuki Kobayashi [Mon, 25 Nov 2024 08:50:48 +0000 (17:50 +0900)] 
[3.13] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127239)

11 months ago[3.13] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127232)
Miss Islington (bot) [Sun, 24 Nov 2024 17:46:54 +0000 (18:46 +0100)] 
[3.13] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127232)

Improve `pathname2url()` and `url2pathname()` docs (GH-127125)

These functions have long sown confusion among Python developers. The
existing documentation says they deal with URL path components, but that
doesn't fit the evidence on Windows:

    >>> pathname2url(r'C:\foo')
    '///C:/foo'
    >>> pathname2url(r'\\server\share')
    '////server/share'  # or '//server/share' as of quite recently

If these were URL path components, they would imply complete URLs like
`file://///C:/foo` and `file://////server/share`. Clearly this isn't right.
Yet the implementation in `nturl2path` is deliberate, and the
`url2pathname()` function correctly inverts it.

On non-Windows platforms, the behaviour until quite recently is to simply
quote/unquote the path without adding or removing any leading slashes. This
behaviour is compatible with *both* interpretations -- 1) the value is a
URL path component (existing docs), and 2) the value is everything
following `file:` (this commit)

The conclusion I draw is that these functions operate on everything after
the `file:` prefix, which may include an authority section. This is the
only explanation that fits both the  Windows and non-Windows behaviour.
It's also a better match for the function names.
(cherry picked from commit 307c63358681d669ae39e5ecd814bded4a93443a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.13] Fix macro expansions in critical section docs (GH-127226) (#127229)
Miss Islington (bot) [Sun, 24 Nov 2024 17:26:40 +0000 (18:26 +0100)] 
[3.13] Fix macro expansions in critical section docs (GH-127226) (#127229)

(cherry picked from commit 2bb7846cacb342246aada5ed92d323e54c946063)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
11 months ago[3.13] gh-109413: Enable mypy's `disallow_any_generics` setting when checking `libreg...
Miss Islington (bot) [Sun, 24 Nov 2024 08:40:14 +0000 (09:40 +0100)] 
[3.13] gh-109413: Enable mypy's `disallow_any_generics` setting when checking `libregrtest` (GH-127033) (#127034)

gh-109413: Enable mypy's `disallow_any_generics` setting when checking `libregrtest` (GH-127033)
(cherry picked from commit 824afbf548e7128ca57c6faf45cfd6b066a6ee45)

Co-authored-by: sobolevn <mail@sobolevn.me>
11 months ago[3.13] gh-126991: Add tests for unpickling bad object state (GH-127031) (GH-127063)
Miss Islington (bot) [Sun, 24 Nov 2024 03:16:54 +0000 (04:16 +0100)] 
[3.13] gh-126991: Add tests for unpickling bad object state (GH-127031) (GH-127063)

This catches a memory leak in loading the BUILD opcode.
(cherry picked from commit addb225f3823b03774cddacce35214dd471bec46)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-126896: Fix docs about `asyncio.start_server()` (GH-126897) (GH-126934)
Miss Islington (bot) [Sun, 24 Nov 2024 02:55:58 +0000 (03:55 +0100)] 
[3.13] gh-126896: Fix docs about `asyncio.start_server()` (GH-126897) (GH-126934)

gh-126896: Fix docs about `asyncio.start_server()` (GH-126897)
(cherry picked from commit 0c5c80928c476ac0dcb9a053b15a562af899cfba)

Co-authored-by: beavailable <beavailable@proton.me>
11 months ago[3.13] Fix "useable" typo in docs (GH-127200) (#127207)
Miss Islington (bot) [Sat, 23 Nov 2024 22:50:06 +0000 (23:50 +0100)] 
[3.13] Fix "useable" typo in docs (GH-127200) (#127207)

Fix "useable" typo in docs (GH-127200)

Fix typo in docs
(cherry picked from commit dbd23790dbd662169905be6300259992639d4e69)

Co-authored-by: Stan U <89152624+StanFromIreland@users.noreply.github.com>
11 months ago[3.13] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (#127201)
Miss Islington (bot) [Sat, 23 Nov 2024 19:54:12 +0000 (20:54 +0100)] 
[3.13] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (#127201)

Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667)
(cherry picked from commit e3038e976b25a58f512d8c7083a752c89436eb0d)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
11 months ago[3.13] Enable aarch64 Ubuntu CI jobs (GH-125786) (GH-127170)
Łukasz Langa [Sat, 23 Nov 2024 09:40:25 +0000 (10:40 +0100)] 
[3.13] Enable aarch64 Ubuntu CI jobs (GH-125786) (GH-127170)

This change enables custom GHA runners for Ubuntu-24.04 that run on Arm hardware. It also prepares for Windows runners on Arm hardware, but doesn't enable that just yet, because the Arm GHA runner images for Windows need to be updated.
(cherry picked from commit 8214e0f709010a0e1fa06dc2ce004b5f6103cc6b)

11 months ago[3.13] Fix a few typos found in the docs (GH-127126) (GH-127181)
Miss Islington (bot) [Sat, 23 Nov 2024 00:09:35 +0000 (01:09 +0100)] 
[3.13] Fix a few typos found in the docs (GH-127126) (GH-127181)

Fix a few typos found in the docs (GH-127126)
(cherry picked from commit 39e60aeb3837f1f23d8b7f30d3b8d9faf805ef88)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
11 months ago[3.13] gh-109746: Make _thread.start_new_thread delete state of new thread on its...
Serhiy Storchaka [Fri, 22 Nov 2024 19:55:44 +0000 (21:55 +0200)] 
[3.13] gh-109746: Make _thread.start_new_thread delete state of new thread on its startup failure (GH-109761) (GH-127171)

If Python fails to start newly created thread
due to failure of underlying PyThread_start_new_thread() call,
its state should be removed from interpreter' thread states list
to avoid its double cleanup.

(cherry picked from commit ca3ea9ad05c3d876a58463595e5b4228fda06936)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
11 months ago[3.13] gh-122544: Change OS image in GitHub Actions to Ubuntu 24.04 (#122566) (#126619)
Damien [Fri, 22 Nov 2024 19:18:57 +0000 (03:18 +0800)] 
[3.13] gh-122544: Change OS image in GitHub Actions to Ubuntu 24.04 (#122566) (#126619)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
11 months ago[3.13] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid...
Miss Islington (bot) [Fri, 22 Nov 2024 17:08:18 +0000 (18:08 +0100)] 
[3.13] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid joining parent process' threads (GH-126098) (GH-127163)

Threads are gone after fork, so clear the queues too. Otherwise the
child process (here created via multiprocessing.Process) crashes on
interpreter exit.

(cherry picked from commit 1848ce61f349533ae5892a8c24c2e0e3c364fc8a)

Co-authored-by: Andrei Bodrov <Drino@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-109413: Fix libregrtest get_running() (GH-127153) (#127157)
Miss Islington (bot) [Fri, 22 Nov 2024 16:34:07 +0000 (17:34 +0100)] 
[3.13] gh-109413: Fix libregrtest get_running() (GH-127153) (#127157)

gh-109413: Fix libregrtest get_running() (GH-127153)

Skip threads which are not running.
(cherry picked from commit 0cb20177d667f0058f3d8d808abaf340e8345f04)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.13] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH...
Miss Islington (bot) [Fri, 22 Nov 2024 16:18:44 +0000 (17:18 +0100)] 
[3.13] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH-127156)

* Name without a PATHEXT extension is only searched if the mode does not
  include X_OK.
* Support multi-component PATHEXT extensions (e.g. ".foo.bar").
* Support files without extensions in PATHEXT contains dot-only extension
  (".", "..", etc).
* Support PATHEXT extensions that end with a dot (e.g. ".foo.").
(cherry picked from commit 8899e85de100557899da05f0b37867a371a73800)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.13] gh-127065: Make `methodcaller` thread-safe in free threading build (GH-127109...
Miss Islington (bot) [Fri, 22 Nov 2024 14:51:40 +0000 (15:51 +0100)] 
[3.13] gh-127065: Make `methodcaller` thread-safe in free threading build (GH-127109) (GH-127150)

The `methodcaller` C vectorcall implementation uses an arguments array
that is shared across calls. The first argument is modified on every
invocation. This isn't thread-safe in the free threading build. I think
it's also not safe in general, but for now just disable it in the free
threading build.
(cherry picked from commit f83ca6962af973fff6a3124f4bd3d45fea4dd5b8)

Co-authored-by: Sam Gross <colesbury@gmail.com>
11 months ago[3.13] GH-122679: Add `register()` to argparse docs (GH-126939) (GH-127149)
Miss Islington (bot) [Fri, 22 Nov 2024 14:12:05 +0000 (15:12 +0100)] 
[3.13] GH-122679: Add `register()` to argparse docs (GH-126939) (GH-127149)

(cherry picked from commit fcfdb55465636afc256bc29781b283404d88e6ca)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
11 months ago[3.13] gh-127082: Replace "Windows only" with the `availability: Windows` in `ctypes...
Jun Komoda [Fri, 22 Nov 2024 13:09:53 +0000 (22:09 +0900)] 
[3.13] gh-127082: Replace "Windows only" with the `availability: Windows` in `ctypes` doc (GH-127099) (#127144)

(cherry picked from commit 3c770e3f0978d825c5ebea98fcd654660e7e135f)

11 months ago[3.13] GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path...
Miss Islington (bot) [Fri, 22 Nov 2024 04:37:30 +0000 (05:37 +0100)] 
[3.13] GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132) (#127135)

GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132)

Decode a file URI like `file://///server/share` as a UNC path like
`\\server\share`. This form of file URI is created by software the simply
prepends `file:///` to any absolute Windows path.
(cherry picked from commit 8c98ed846a7d7e50c4cf06f823d94737144dcf6a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.13] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127130)
Miss Islington (bot) [Fri, 22 Nov 2024 03:42:26 +0000 (04:42 +0100)] 
[3.13] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127130)

GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129)

Discard any 'localhost' authority from the beginning of a `file:` URI. As a
result, file URIs like `//localhost/etc/hosts` are correctly decoded as
`/etc/hosts`.
(cherry picked from commit ebf564a1d3e2e81b9846535114e481d6096443d2)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.13] gh-126986: Stop Using _PyInterpreterState_FailIfNotRunning() (gh-127112)
Eric Snow [Thu, 21 Nov 2024 17:33:15 +0000 (10:33 -0700)] 
[3.13] gh-126986: Stop Using _PyInterpreterState_FailIfNotRunning() (gh-127112)

This is a pseudo-backport of d6b3e78 (gh-126988).  In that change for 3.14+, we dropped _PyInterpreterState_FailIfNotRunning() and added _PyErr_SetInterpreterAlreadyRunning().  Here, we replace usage of _PyInterpreterState_FailIfNotRunning() with the inlined equivalent of _PyErr_SetInterpreterAlreadyRunning(), without adding that function.  That way we avoid changing the 3.13 ABI.

11 months ago[3.13] gh-127020: Make `PyCode_GetCode` thread-safe for free threading (GH-127043...
Miss Islington (bot) [Thu, 21 Nov 2024 16:27:36 +0000 (17:27 +0100)] 
[3.13] gh-127020: Make `PyCode_GetCode` thread-safe for free threading (GH-127043) (GH-127107)

Some fields in PyCodeObject are lazily initialized. Use atomics and
critical sections to make their initializations and accesses thread-safe.
(cherry picked from commit 3926842117feffe5d2c9727e1899bea5ae2adb28)

Co-authored-by: Sam Gross <colesbury@gmail.com>
11 months ago[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (#127105)
Miss Islington (bot) [Thu, 21 Nov 2024 15:29:01 +0000 (16:29 +0100)] 
[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (#127105)

gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101)

On Android, TimerfdTests of test_os now uses 100 ms accuracy instead
of 10 ms.
(cherry picked from commit bab4b0462ebd782dd6965beb0ccae6341af43ceb)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months agogh-126780: Fix `ntpath.normpath()` for drive-relative paths (GH-126801)
Miss Islington (bot) [Thu, 21 Nov 2024 15:10:12 +0000 (16:10 +0100)] 
gh-126780: Fix `ntpath.normpath()` for drive-relative paths (GH-126801)

(cherry picked from commit 60ec854bc297e04718fe13db3605d0465bf8badb)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
11 months ago[3.13] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127097)
Serhiy Storchaka [Thu, 21 Nov 2024 11:49:19 +0000 (13:49 +0200)] 
[3.13] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127097)

It now returns multiple era description segments separated by semicolons.
Previously it only returned the first segment on platforms with Glibc.
(cherry picked from commit 4803cd0244847f286641c85591fda08b513cea52)

11 months ago[3.13] gh-126997: Fix support of non-ASCII strings in pickletools (GH-127062) (GH...
Miss Islington (bot) [Thu, 21 Nov 2024 11:40:52 +0000 (12:40 +0100)] 
[3.13] gh-126997: Fix support of non-ASCII strings in pickletools (GH-127062) (GH-127094)

* Fix support of STRING and GLOBAL opcodes with non-ASCII arguments.
* dis() now outputs non-ASCII bytes in STRING, BINSTRING and
  SHORT_BINSTRING arguments as escaped (\xXX).
(cherry picked from commit eaf217108226633c03cc5c4c90f0b6e4587c8803)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>