Commit graph

123623 commits

Author SHA1 Message Date
Serhiy Storchaka
c30cad0638
[3.13] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199) (GH-128272)
(cherry picked from commit 5c814c83cd)

Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
2024-12-26 10:39:47 +00:00
Miss Islington (bot)
32adae1a10
[3.13] gh-126664: revert: Use else instead of finally in docs explaining "with" (GH-128169) (#128170)
gh-126664: revert: Use `else` instead of `finally` in docs explaining "with" (GH-128169)

Revert "gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665)"

This reverts commit 25257d61cf.
(cherry picked from commit 228f275737)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-12-24 10:55:57 -08:00
Ethan Furman
875e49fb63
[3.13] gh-112328: Make EnumDict usable on its own and document it (GH-123669) (GH-128142)
Co-authored-by: Petr Viktorin <pviktori@redhat.com>
2024-12-24 10:50:23 -08:00
Miss Islington (bot)
a52d663d0c
[3.13] gh-128227: Regenerate Doc/requirements-oldest-sphinx.txt (GH-128228) (#128229)
gh-128227: Regenerate `Doc/requirements-oldest-sphinx.txt` (GH-128228)
(cherry picked from commit 7985d460c7)

Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
2024-12-24 18:06:12 +00:00
Miss Islington (bot)
e1a0c40658
[3.13] gh-127847: Fix position in the special-cased zipfile seek (GH-127856) (#128225)
gh-127847: Fix position in the special-cased zipfile seek (GH-127856)

---------
(cherry picked from commit 7ed6c5c696)

Co-authored-by: Dima Ryazanov <dima@bucket.xxx>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-12-24 16:20:58 +00:00
Miss Islington (bot)
40c46f08e2
gh-128217: Validate the normalized_environment variable instead of the similarly named function (GH-128220)
(cherry picked from commit 3ddd70ceaa)

Co-authored-by: Sergey Muraviov <smurav@mail.ru>
2024-12-24 13:29:56 +00:00
Miss Islington (bot)
6f3c2c8d04
[3.13] gh-126180: Remove getopt and optparse deprecation notices (GH-128191)
* Remove getopt and optparse deprecation notices
* Add new docs sections for command line app helper libraries
* Add guidance on choosing a CLI parsing library to the optparse docs
* Link to the new guidance from the argparse and getopt docs
* Reword intro in docs section for superseded stdlib modules
* Reframe the optparse->argparse guide as a migration guide
  rather than as an upgrade guide

---------
(cherry picked from commit 831b6de6d7)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-12-23 04:40:59 +00:00
Miss Islington (bot)
09d15aa9a8
[3.13] gh-128049: Fix type confusion bug with the return value of a custom ExceptionGroup split function (GH-128079) (#128139)
gh-128049: Fix type confusion bug with the return value of a custom ExceptionGroup split function (GH-128079)
(cherry picked from commit 3879ca0100)

Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
2024-12-20 20:18:44 +00:00
Miss Islington (bot)
43586a4804
[3.13] gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120) (#128123)
gh-128116: Skip test_socket VSOCK testStream() on PermissionError (GH-128120)
(cherry picked from commit cbfe3023e4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-20 13:32:58 +00:00
Miss Islington (bot)
f320f747da
[3.13] gh-128030: Avoid error from PyModule_GetFilenameObject for non-module (GH-128047) (#128114)
gh-128030: Avoid error from PyModule_GetFilenameObject for non-module (GH-128047)

I missed the extra `PyModule_Check` in GH-127660 because I was looking at
3.12 as the base implementation for import from. This meant that I
missed the `PyModuleCheck` introduced in GH-112661.
(cherry picked from commit 45e6dd63b8)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-12-20 08:46:54 +00:00
Peter Bierma
3a8bdaf698
[3.13] gh-128083: Fix macro redefinition warning in clinic. (GH-127950) (#128102)
(cherry picked from commit b5d1e4552f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-12-19 21:29:14 +00:00
Miss Islington (bot)
a0f1f120f2
[3.13] gh-128062: Fix the font size and shortcut display of the turtledemo menu (GH-128063) (#128101)
gh-128062: Fix the font size and shortcut display of the turtledemo menu (GH-128063)

Leave the font of the menu bar the default to keep it consistent with the rest of the world. Display the shortcut keys in the right way, using the 'accelerator' option.
---------

(cherry picked from commit e163e8d4e1)

Co-authored-by: Zhikang Yan <2951256653@qq.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-12-19 20:47:24 +00:00
Miss Islington (bot)
08f9b7cb2a
[3.13] gh-128069: brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version (GH-128090) (#128096)
gh-128069: brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version (GH-128090)

brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version
(cherry picked from commit 46dc1ba9c6)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-12-19 15:20:07 +00:00
Miss Islington (bot)
d699ce3961
[3.13] gh-126742: add NEWS entry for fix of localized error messages (GH-128025) (GH-128059)
(cherry picked from commit 2610bccfdf)
2024-12-19 14:52:32 +01:00
Miss Islington (bot)
f8e7b5cc8d
[3.13] gh-122706: fix docs for asyncio ssl sockets (GH-128092) (#128094)
gh-122706: fix docs for asyncio ssl sockets (GH-128092)
(cherry picked from commit 19c5134d57)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-12-19 18:26:05 +05:30
Miss Islington (bot)
2ff3e95ad5
[3.13] gh-126742: Avoid checking for library filename in test_ctypes (GH-128034) (#128056)
gh-126742: Avoid checking for library filename in test_ctypes (GH-128034)

Avoid checking for library filename in `dlerror()` error messages of test_ctypes.
(cherry picked from commit 335e24fb0a)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-12-18 08:49:13 +00:00
Miss Islington (bot)
f8b4e20137
[3.13] gh-127060: Disable traceback colors in IDLE (GH-128028) (#128052)
Set TERM environment variable to "dumb" to disable traceback colors
in IDLE, since IDLE doesn't understand ANSI escape sequences.

(cherry picked from commit 559b0e7013)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-18 05:58:57 +00:00
Miss Islington (bot)
fe08cdf265
[3.13] gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror messages (GH-126746) (GH-128023)
- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages
(cherry picked from commit 7303f06846)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-12-17 11:45:29 +00:00
Miss Islington (bot)
367ea89384
[3.13] Free arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-128006)
Free arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-127910)

After commit 10a91d7e9 introduced arena cleanup, commit 2dfbd4f36
removed the free call when _PyCompile_AstOptimize fails.

(cherry picked from commit cfeaa992ba)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2024-12-16 23:26:39 +02:00
Miss Islington (bot)
71a1e79134
[3.13] Minor readability improvements for the itertools recipes (gh-127928) (gh-127999) 2024-12-16 17:33:20 +00:00
Miss Islington (bot)
28e684b330
[3.13] Simplify and speed-up an itertools recipe (gh-127848) (gh-127998) 2024-12-16 11:26:58 -06:00
Miss Islington (bot)
231c93923d
[3.13] Fix typo in itertools docs (gh-127995) (gh-127996) 2024-12-16 11:20:14 -06:00
Victor Stinner
8e143b2886
[3.13] gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows (#127994)
gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows

Change Py_BUILD_ASSERT_EXPR implementation on Windows to avoid a
compiler warning about an unnamed structure.
2024-12-16 17:17:01 +00:00
Miss Islington (bot)
89f4b23f9e
[3.13] Clarify ast docs to use a less confusing example for ast.ParamSpec (GH-127955) (#127959)
Clarify ast docs to use a less confusing example for `ast.ParamSpec` (GH-127955)

Fix typo in ast docs: ParamSpec defaults
(cherry picked from commit 7900a85019)

Co-authored-by: Steve C <diceroll123@gmail.com>
2024-12-15 12:35:25 +00:00
Miss Islington (bot)
90ae4b6f5a
[3.13] gh-127353: Allow to force color output on Windows V2 (GH-127926) (#127944)
gh-127353: Allow to force color output on Windows V2 (GH-127926)
(cherry picked from commit 0ac40acec0)

Co-authored-by: Andrey Efremov <duxus@yandex.ru>
2024-12-15 10:41:11 +02:00
Miss Islington (bot)
9c6bd272b4
[3.13] gh-127852: add remark about ',' separator (GH-127854) (#127941)
Specify that it is valid for floats and ints with 'd' presentation and an error otherwise.
---------

(cherry picked from commit e2325c9db0)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-12-14 13:34:18 +00:00
Victor Stinner
2996a2bed3
[3.13] gh-127906: Backport test_cext changes from the main branch (#127923) 2024-12-13 15:04:08 +00:00
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