Commit graph

123569 commits

Author SHA1 Message Date
Miss Islington (bot)
b56100c77a
[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 a03efb533a)

Co-authored-by: Stephen Morton <git@tungol.org>
2024-12-08 12:15:35 -08:00
Miss Islington (bot)
2ba5190f01
[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 27d0d21413)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2024-12-07 16:41:23 +00:00
Miss Islington (bot)
d95df6a75b
[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 e59caf67cd)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2024-12-06 18:14:12 +00:00
Miss Islington (bot)
652a0eb6d1
[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 51cfa569e3)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
2024-12-06 09:17:32 -08:00
Miss Islington (bot)
8d50e0320b
[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 a353455fca)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-12-06 16:14:26 +00:00
Miss Islington (bot)
5d35d279a5
[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 77a61c0465)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-12-06 14:19:08 +00:00
Miss Islington (bot)
71e8429ac8
[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 e991ac8f20)

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-12-06 10:42:23 +05:30
Sam Gross
69bb1c6c41
[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 f4f530804b)
2024-12-05 18:49:33 -05:00
Miss Islington (bot)
304111e967
[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 657d0e99aa)

Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
2024-12-05 20:58:36 +00:00
Miss Islington (bot)
2da829ba97
[3.13] GH-126727: Fix test_era_nl_langinfo with Japanese ERAs on Solaris (GH-127327) (GH-127645)
(cherry picked from commit d958d9f4a1)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2024-12-05 19:08:12 +00:00
Miss Islington (bot)
468e8dad7e
[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 208b0fb645)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-05 18:15:44 +01:00
Miss Islington (bot)
3e11b5c2ba
[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 fcbe6ecdb6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-05 10:02:17 +00:00
Russell Keith-Magee
1182c64181
[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 6cf77949fb)

Co-authored-by: Feodor Fitsner <feodor@appveyor.com>
2024-12-05 03:28:21 +00:00
Sam Gross
4060ef36e1
[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 e51da64ac3)
2024-12-04 15:17:19 -05:00
Miss Islington (bot)
a1c52d1265
[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>
2024-12-04 10:28:14 +02:00
Miss Islington (bot)
bb46b74d9d
[3.13] Itertool recipe additions (gh-127483) (gh-127585) 2024-12-03 18:34:42 -06:00
Thomas Wouters
b90161f62c Merge branch '3.13' of https://github.com/python/cpython into 3.13 2024-12-03 22:43:45 +01:00
Thomas Wouters
fd81351186 Post 3.13.1 2024-12-03 22:43:25 +01:00
Miss Islington (bot)
0b266aaa39
[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 13b68e1a61)

Co-authored-by: mpage <mpage@meta.com>
2024-12-03 10:30:08 -08:00
Thomas Wouters
0671451779 Python 3.13.1 2024-12-03 18:59:52 +01:00
Miss Islington (bot)
dddea7c232
[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 ee1b8ce26e)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-12-03 16:46:30 +00:00
Miss Islington (bot)
ae3f347dc0
[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 ac918ccad7)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-12-03 17:17:25 +01:00
Miss Islington (bot)
a63e06d95b
[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 76a1c5d183)

Co-authored-by: Seth Michael Larson <seth@python.org>
2024-12-03 17:12:36 +01:00
Miss Islington (bot)
3479a719b8
[3.13] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) (GH-127557)
(cherry picked from commit 35d37d6592)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-12-03 13:57:42 +01:00
Miss Islington (bot)
e546876d83
[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 c7dec02de2)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-12-02 19:22:05 -05:00
Miss Islington (bot)
a853610282
gh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)
(cherry picked from commit 4b00aba42e)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-12-02 20:11:16 +00:00
Eric Snow
219b8266db
[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.
2024-12-02 18:41:57 +00:00
Miss Islington (bot)
059114c0a0
[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 b3687ad454)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-02 16:25:55 +00:00
Peter Bierma
cab2ef5125
[3.13] gh-126890: Restore stripped ssl docstrings (GH-127281) (#127513)
(cherry picked from commit c112de1da2)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-12-02 16:05:27 +01:00
Miss Islington (bot)
f41d8d89e7
[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 f7bb658124)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-12-02 15:42:02 +01:00
Miss Islington (bot)
511c588f5d
[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 2a373da770)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
2024-12-02 15:19:21 +01:00
Carol Willing
2d458b16e6
[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 94a7a4e22f)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
2024-12-02 15:10:59 +01:00
Miss Islington (bot)
a5672bec68
[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 feb3e0b19c)

Co-authored-by: Stephen Morton <github@tungol.org>
2024-12-02 15:10:25 +01:00
Miss Islington (bot)
d9bbb52c7e
[3.13] gh-122838: Document missing opcodes (GH-123073) (#126492)
gh-122838: Document missing opcodes (GH-123073)
(cherry picked from commit 9cba47d9f1)

Co-authored-by: Kamil Turek <kamil.turek@hotmail.com>
2024-12-02 15:07:38 +01:00
Miss Islington (bot)
23ab1f9ff1
[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 7d7d56d8b1)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-02 15:05:13 +01:00
Miss Islington (bot)
fd48d98df9
[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 44becb8cba)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2024-12-02 15:04:51 +01:00
Peter Bierma
b1051577de
[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 4c53b25775)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-02 15:03:44 +01:00
Miss Islington (bot)
d9ac6b3ef7
[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 f8ba9fb2ce)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-12-02 15:02:20 +01:00
Miss Islington (bot)
26f1e88aae
[3.13] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127511)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-12-02 13:57:40 +00:00
Miss Islington (bot)
4bafce0912
[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 930ba0ce60)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-02 13:38:13 +00:00
Bénédikt Tran
943e57e1ce
[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>
2024-12-02 13:24:03 +01:00
Miss Islington (bot)
585d48f001
[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 1f8267b85d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-02 08:28:15 +00:00
Tian Gao
dd2ad70b29
[3.13] gh-127321: Avoid stopping at an opcode without an associated line number for breakpoint() (GH-127457) (#127487)
(cherry picked from commit 1bc4f076d1)
2024-12-01 17:58:08 -05:00
Miss Islington (bot)
3b31f8c7e8
[3.13] gh-127356: Fix prepend doctrees directory for gettext target (GH-127357) (#127470)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-12-01 09:21:34 +00:00
Yuki Kobayashi
a2814b984e
[3.13] Docs: Fix incorrect indents in c-api/type.rst (GH-127449) (#127460)
(cherry picked from commit 33ce8dcf79)
2024-12-01 10:50:51 +02:00
Miss Islington (bot)
06acb95856
[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 11c01092d5)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-11-30 23:50:01 -08:00
Miss Islington (bot)
2813a61675
[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 46bfd26fb2)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-12-01 06:55:55 +00:00
Miss Islington (bot)
5017c81824
[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 20657fbdb1)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-01 06:48:04 +00:00
Peter Bierma
a442c87c4c
[3.13] gh-127341: Argument Clinic: fix compiler warnings for getters with docstrings (GH-127310) (#127431)
(cherry picked from commit 99490913a0)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-11-30 23:25:51 +01:00
Miss Islington (bot)
c54b9ae199
[3.13] summarize: Fix typo in stats (GH-127450) (#127454)
Co-authored-by: alm <alonme@users.noreply.github.com>
2024-11-30 16:32:13 +00:00