Commit graph

123596 commits

Author SHA1 Message Date
Miss Islington (bot)
78095c9052
[3.13] gh-127906: Test the limited C API in test_cppext (GH-127916) (#127919)
gh-127906: Test the limited C API in test_cppext (GH-127916)
(cherry picked from commit d05a4e6a0d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-13 14:12:07 +00:00
Miss Islington (bot)
0f38b897f9
[3.13] gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (GH-127872) (#127917)
gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (GH-127872)
(cherry picked from commit 6ff38fc4e2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-13 13:19:41 +00:00
Victor Stinner
b620e503eb
[3.13] gh-127906: Backport test_cppext changes from the main branch (#127914) 2024-12-13 12:51:48 +00:00
Miss Islington (bot)
8384279863
[3.13] link to the correct output method in documentation (GH-127857) (#127900)
link to the correct output method in documentation (GH-127857)
(cherry picked from commit 11ff3286b7)

Co-authored-by: Viktor Kálmán <kviktor@users.noreply.github.com>
2024-12-13 15:07:46 +05:30
Miss Islington (bot)
6023b3b01e
[3.13] Document PyObject_SelfIter (GH-127861) (#127898)
Document PyObject_SelfIter (GH-127861)
(cherry picked from commit 58942a07df)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2024-12-13 15:07:28 +05:30
Miss Islington (bot)
740e9ab545
[3.13] gh-127845: Minor improvements to iOS test runner script (GH-127846) (#127892)
Uses symlinks to install iOS framework into testbed clone, adds a verbose mode
to the iOS runner to hide most Xcode output, adds another mechanism to disable
terminal colors, and ensures that stdout is flushed after every write.
(cherry picked from commit ba2d2fda93)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-12-12 22:17:58 +00:00
Miss Islington (bot)
d3d478eff1
[3.13] Fix typo in traceback docs (GH-127884) (#127890)
Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
2024-12-12 21:51:10 +00:00
Miss Islington (bot)
d68c9416cf
[3.13] Fix typos in Lib/_pydecimal.py (GH-127700) (#127887)
Fix typos in `Lib/_pydecimal.py` (GH-127700)
(cherry picked from commit ed037d229f)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2024-12-12 20:49:09 +00:00
Miss Islington (bot)
f21b38c1a2
[3.13] gh-127865: Fix build failure for systems without thread local support (GH-127866) (GH-127882)
This PR fixes the build issue introduced by the commit 628f6eb from
GH-112207 on systems without thread local support.
(cherry picked from commit f823910bbd)

Co-authored-by: velemas <10437413+velemas@users.noreply.github.com>
2024-12-12 18:32:10 +00:00
Petr Viktorin
d51c1444e3
[3.13] gh-126937: ctypes: add test for maximum size of a struct field (GH-126938) (GH-127825)
This backports the *test* from GH-126938, with changed limit and exception class.

Co-authored-by: Melissa0x1f992 <70096546+Melissa0x1f992@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-12-12 13:02:57 +01:00
Miss Islington (bot)
2a78663870
[3.13] gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361) (GH-127812)
gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361)

From the ERR_raise manpage:

    ERR_LIB_SYS

        This "library code" indicates that a system error is
        being reported.  In this case, the reason code given
        to `ERR_raise()` and `ERR_raise_data()` *must* be
        `errno(3)`.

This PR only handles ERR_LIB_SYS for the high-lever error types
SSL_ERROR_SYSCALL and SSL_ERROR_SSL, i.e., not the ones where
OpenSSL indicates it has some more information about the issue.
(cherry picked from commit f4b31edf2d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-12-12 12:44:53 +01:00
Miss Islington (bot)
8b24d042b4
[3.13] gh-118915: C API: Document frame locals proxies. (GH-127720) (#127831)
gh-118915: C API: Document frame locals proxies. (GH-127720)
(cherry picked from commit dd9da738ad)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-12-11 16:34:35 +00:00
Miss Islington (bot)
f56da922cb
[3.13] CI: Use bash to properly expand variable (GH-127822) (#127824)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-12-11 15:42:17 +00:00
Miss Islington (bot)
a94e20e4f1
[3.13] gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (GH-123405) (#127828)
gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (GH-123405)
(cherry picked from commit 359389ed51)

Co-authored-by: Nano <nanoapezlk@gmail.com>
Co-authored-by: Wulian <1055917385@qq.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-11 15:38:09 +00:00
Peter Bierma
bcdd10d0c8
[3.13] gh-127791: Fix, document, and test PyUnstable_AtExit (GH-127793) (#127819)
* Fix merge conflicts.

* [3.13] gh-127791: Fix, document, and test `PyUnstable_AtExit` (GH-127793)
(cherry picked from commit d5d84c3f13)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-12-11 13:40:45 +00:00
Pablo Galindo Salgado
eb692d945e
[3.13] gh-126076: Account for relocated objects in tracemalloc (GH-126077) (#127823)
(cherry picked from commit 30aeb00d36)
2024-12-11 14:15:37 +01:00
Miss Islington (bot)
78dfc28ff3
[3.13] Add extern "C" around PyTraceMalloc_ functions. (GH-127772) (#127815)
Add `extern "C"` around `PyTraceMalloc_` functions. (GH-127772)

Pretty much everything else exported by Python.h has an extern "C"
annotation, yet this header appears to be missing one.
(cherry picked from commit 2cdeb61b57)

Co-authored-by: Peter Hawkins <hawkinsp@cs.stanford.edu>
2024-12-11 14:07:44 +01:00
Miss Islington (bot)
acf05aa5d8
[3.13] gh-127563: use dk_log2_index_bytes=3 in empty dicts (GH-127568) (GH-127798)
This fixes a UBSan failure (unaligned zero-size memcpy) in `dictobject.c`.
(cherry picked from commit 9af96f4406)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-11 09:24:14 +01:00
Miss Islington (bot)
8b28dedc58
[3.13] gh-126821: Add versionadded annotation to use_system_logger feature. (GH-127755) (#127806)
Add versionadded annotation to use_system_logger feature.
(cherry picked from commit 51216857ca)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-12-10 21:38:12 +00:00
Miss Islington (bot)
c6c9ff56a5
[3.13] Docs: Fix indents in xmlrpc.client.rst (GH-127782) (#127799)
Docs: Fix indents in `xmlrpc.client.rst` (GH-127782)
(cherry picked from commit 035f512046)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-12-10 17:41:01 +00:00
Hugo van Kemenade
990ea3333c
[3.13] Add zizmor to pre-commit and fix most findings (#127749) (#127786)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit ae31df354d)
2024-12-10 13:48:26 +00:00
Bénédikt Tran
8bf5b89212
[3.13] gh-127637: add tests for dis command-line interface (#127759) (#127781) 2024-12-10 12:32:32 +00:00
Miss Islington (bot)
00d60623e9
[3.13] gh-101100: Fix sphinx warnings in whatsnew/3.0.rst (GH-127662) (#127783)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-12-10 10:45:30 +00:00
Miss Islington (bot)
9d0252ff2e
[3.13] gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH-126776) (#127778)
gh-126775: make linecache.checkcache threadsafe and GC re-entrency safe (GH-126776)

(cherry picked from commit 2233c303e4)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
2024-12-10 08:06:26 +00:00
Shantanu
6441d42f92
[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 3983527c3a)
2024-12-10 05:21:55 +00:00
Miss Islington (bot)
310efdabf5
gh-127732: Add Windows Server 2025 detection to platform module (GH-127733)
(cherry picked from commit 5eb7fd4d0f)

Co-authored-by: Wulian <1055917385@qq.com>
2024-12-09 12:50:34 +00:00
Russell Keith-Magee
075c41d5f5
[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 2041a95e68)
2024-12-09 14:39:11 +08:00
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