Commit graph

123236 commits

Author SHA1 Message Date
Miss Islington (bot)
bcadaf2321
[3.13] gh-86673: Loosen test_ttk.test_identify() requirements (GH-125335) (#125390)
In aeca373b3 (PR gh-12011, issue gh-71500), test_identify() was changed to expect different results on Darwin. Ned's fix was later adjusted by e52f9bee8. This workaround is only needed for some variants of Tk/Tcl on macOS, so we now allow both the workaround and the generic results for these tests.
(cherry picked from commit 4197a796ec)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-10-13 08:04:22 +00:00
Miss Islington (bot)
801ef7de08
[3.13] Trivial change: Update comments in activate about what running hash -r does (GH-125385) (GH-125387)
(cherry picked from commit 82bcaf1589)
2024-10-13 08:56:09 +01:00
Miss Islington (bot)
e47dd93262
[3.13] Doc: Fix suggested usage of -X gil=0 in the glossary (GH-125366) (#125382)
Doc: Fix suggested usage of `-X gil=0` in the glossary (GH-125366)

Currently, the "global interpreter lock" entry in the glossary mentions
that `-X gil 0` can be used to disable the GIL [1]. However, this is
invalid; the correct usage should be `-X gil=0`.

    $ python -X gil 0 -c 'print("Hello, world")'
    Fatal Python error: config_read_gil: PYTHON_GIL / -X gil must be "0" or "1"
    Python runtime state: preinitialized

    $ python -X gil=0 -c 'print("Hello, world")'
    Hello, world

[1]: https://docs.python.org/3/using/cmdline.htmlGH-cmdoption-X

(cherry picked from commit a8fa4ad9e9)

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
Co-authored-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2024-10-13 00:59:05 +00:00
Miss Islington (bot)
6afdb09859
[3.13] gh-125289: Update sample code in asyncio-task.rst (GH-125292) (GH-125374)
gh-125289: Update sample code in asyncio-task.rst (GH-125292)

* Update sample code in asyncio-task.rst

This will change **coroutines** sample code in the **Awaitables** section and make the example clearer.

* Update Doc/library/asyncio-task.rst

Revert the added print



* Update Doc/library/asyncio-task.rst



---------

(cherry picked from commit fa52b82c91)

Co-authored-by: Ghorban M. Tavakoly <58617996+galmyk@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-12 20:43:30 +00:00
Miss Islington (bot)
06285be22b
[3.13] gh-53203: Fix strptime() for %c and %x formats on many locales (GH-124946) (GH-125369)
In some locales (like French or Hebrew) the full or abbreviated names of
the default month and weekday used in __calc_date_time can be part of
other name or constant part of the %c format. The month name can also
match %m with constant suffix (like in Japanese). So the code failed to
correctly distinguish formats %a, %A, %b, %B and %m.

Cycle all month and all days of the week to find the variable part
and distinguish %a from %A and %b from %B or %m.

Fixed locales for the following languges:
Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish,
Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol,
Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi,
Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese.

(cherry picked from commit c05f9dde8a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Eli Bendersky <eliben@gmail.com>
2024-10-12 18:11:48 +00:00
Miss Islington (bot)
0542645354
[3.13] gh-85935: Explicitly document the case nargs=0 in argparse (GH-125302) (GH-125357)
(cherry picked from commit 07c2d15977)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-12 16:02:26 +03:00
Miss Islington (bot)
33c41360c8
[3.13] gh-125254: Fix error report about ambiguous option in argparse (GH-125273) (GH-125359)
This was a regression introduced in gh-58573. It was only tested for the
case when the ambiguous option is the last argument in the command line.
(cherry picked from commit 63cf4e914f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-12 16:00:41 +03:00
Miss Islington (bot)
b4c504d76f
[3.13] gh-124309: fix staggered race on eager tasks (GH-124847) (#125339)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-10-11 20:11:53 -07:00
Miss Islington (bot)
a314026cfe
[3.13] Doc: Fix a typo in "Function Examples" in the control-flow tutorial (GH-125338) (#125341)
Doc: Fix a typo in "Function Examples" in the control-flow tutorial (GH-125338)
(cherry picked from commit 5a074aab84)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-10-12 00:45:50 +00:00
Miss Islington (bot)
21764ec5ab
[3.13] gh-116938: Clarify documentation of dict and dict.update regarding the positional argument they accept (GH-125213) (#125336)
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-11 23:29:01 +00:00
Jelle Zijlstra
e646cc369e
[3.13] gh-124917: Allow keyword args to os.path.exists/lexists on Windows (GH-124918) (#125332)
(cherry picked from commit cc2938a189)
2024-10-11 15:18:33 -07:00
Miss Islington (bot)
488807a52a
[3.13] Fix typo in `Doc/library/functions.rst` (GH-125327) (#125333)
Fix typo in ``Doclibrary/functions.rst`` (GH-125327)
(cherry picked from commit 76b29d271b)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-10-11 20:06:19 +00:00
Miss Islington (bot)
f589513334
[3.13] gh-116738: Make _csv module thread-safe (GH-118344) (#125328)
gh-116738: Make `_csv` module thread-safe (GH-118344)
(cherry picked from commit a00221e5a7)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-10-11 18:22:56 +00:00
Miss Islington (bot)
73c152b346
[3.13] Add some doctest cleanups for configparser (GH-125288) (#125290)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-11 09:48:32 +00:00
Miss Islington (bot)
66b8cb1142
[3.13] gh-125235: Keep _tkinter TCL paths pointing to base installation on Windows (GH-125250) (#125312)
gh-125235: Keep `_tkinter` TCL paths pointing to base installation on Windows (GH-125250)
(cherry picked from commit b3aa1b5fe2)

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com>
2024-10-11 09:34:04 +00:00
Miss Islington (bot)
079bf1c31c
[3.13] gh-61011: Fix inheritance of nested mutually exclusive groups in argparse (GH-125210) (GH-125308)
Previously, all nested mutually exclusive groups lost their connection
to the group containing them and were displayed as belonging directly
to the parser.

(cherry picked from commit 18c7449768)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Danica J. Sutherland <djsutherland@users.noreply.github.com>
2024-10-11 09:14:04 +00:00
Miss Islington (bot)
b3badabcd9
[3.13] gh-125221: Fix free-threading data race in object.__reduce_ex__ (GH-125267) (#125305)
gh-125221: Fix free-threading data race in `object.__reduce_ex__` (GH-125267)
(cherry picked from commit b12e99261e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-10-11 08:26:23 +00:00
Miss Islington (bot)
49f171d9ea
[3.13] gh-125058: update _thread docs regarding interruptibility of lock.acquire() (GH-125141) (#125306)
gh-125058: update `_thread` docs regarding interruptibility of `lock.acquire()` (GH-125141)
(cherry picked from commit 0135848059)

Co-authored-by: Jan Kaliszewski <zuo@kaliszewski.net>
2024-10-11 08:20:46 +00:00
Miss Islington (bot)
1fe27103e0
[3.13] gh-125296: Fix strange fragment identifier for name or flags in argparse docs (GH-125297) (#125299)
gh-125296: Fix strange fragment identifier for `name or flags` in argparse docs (GH-125297)
(cherry picked from commit c1913effee)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-11 06:35:49 +00:00
Serhiy Storchaka
26a93189e4
[3.13] gh-124969: Fix locale.nl_langinfo(locale.ALT_DIGITS) (GH-124974) (#125232)
Returns a tuple of up to 100 strings for ALT_DIGITS lookup (an empty tuple on most locales).
Previously it returned the first item of that tuple or an empty string.
(cherry picked from commit 21c04e1a97)
2024-10-11 05:56:22 +08:00
Miss Islington (bot)
2019362d95
[3.13] Doc: Upgrade Sphinx to 8.1 (GH-125276) (#125278)
Doc: Upgrade Sphinx to 8.1 (GH-125276)
(cherry picked from commit dd0ee201da)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-10 20:31:40 +00:00
Miss Islington (bot)
319305c0bf
[3.13] Note argparse exit code in documentation (GH-119568) (GH-125274)
(cherry picked from commit 3b87fb74c9)

Co-authored-by: Justin Kunimune <justinkunimune@gmail.com>
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-10 21:18:17 +03:00
Miss Islington (bot)
2f87976926
[3.13] GH-122578: update to WASI SDK 24 (GH-122960) (GH-122961)
GH-122578: update to WASI SDK 24 (GH-122960)
(cherry picked from commit 0e207f3e7a)

Co-authored-by: Brett Cannon <brett@python.org>
2024-10-10 17:46:01 +00:00
Miss Islington (bot)
cc1892d3cf
[3.13] GH-121634: have wasi.py accept the host target triple as an argument (GH-123030) (GH-123042)
GH-121634: have `wasi.py` accept the host target triple as an argument (GH-123030)
(cherry picked from commit b15b81ed4f)

Co-authored-by: Brett Cannon <brett@python.org>
2024-10-10 17:44:31 +00:00
Miss Islington (bot)
9aa85f524f
[3.13] gh-122765: make prompt in activate.csh robust against unbalanced quotes and newlines (GH-123751) (GH-124185)
gh-122765: make prompt in activate.csh robust against unbalanced quotes and newlines (GH-123751)
(cherry picked from commit a15a584bf3)

Co-authored-by: Jacek <jacek.duszenko@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
2024-10-10 17:39:39 +00:00
Sergey B Kirpichev
c2cb1a89b7
[3.13] gh-125118: don't copy arbitrary values to _Bool in the struct module (GH-125169) (#125263)
memcopy'ing arbitrary values to _Bool variable triggers undefined
behaviour. Avoid this.
We assume that `false` is represented by all zero bytes.

Credits to Alex Gaynor.

(cherry picked from commit 87d7315ac5)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-10-10 14:58:57 +00:00
Miss Islington (bot)
0c43d60e7d
[3.13] gh-124471: Set name for unnamed reusable workflow (GH-124475) (gh-125256)
gh-124471: Set name for unnamed reusable workflow (GH-124475)
(cherry picked from commit e4cab488d4)

Co-authored-by: Donghee Na <donghee.na@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-10-10 13:03:45 +00:00
Miss Islington (bot)
47ad32d158
[3.13] gh-71784: [doc] add usage examples for traceback.TracebackException (GH-125189) (#125247)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-10 10:46:31 +00:00
Adam Turner
abb01fd938
[3.13] GH-121970: Extract `availability` into a new extension (GH-125082) (#125237)
(cherry picked from commit cbfd392479)
2024-10-10 10:43:43 +00:00
Miss Islington (bot)
288a0692ed
[3.13] Pin the doctest workflow to Ubuntu 22.04 (GH-125236) (#125240)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-10 10:27:48 +00:00
Miss Islington (bot)
85cf3a9dbe
[3.13] gh-125140: Remove the current directory from sys.path when using pyrepl (GH-125212) (#125224) 2024-10-10 10:35:47 +01:00
Alex Waygood
aa4da1e468
[3.13] gh-101100: Consolidate documentation on ModuleType attributes (#124709) (#125208)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-09 20:03:30 +01:00
Miss Islington (bot)
47fa3f44ef
[3.13] docs: in venv table use executable name (GH-124315) (GH-125172)
(cherry picked from commit 7f93dbf6fe)
2024-10-09 17:54:15 +01:00
Miss Islington (bot)
ab5f1790d0
[3.13] gh-101100: Fix Sphinx warnings in library/unittest.mock.rst (GH-124106) (#125190)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-10-09 14:13:23 +00:00
Miss Islington (bot)
b6c17eb76f
[3.13] Fix importlib.resources issue reference in 3.13 What's New (GH-125175) (#125184)
Previous link was to the PR that removed the
mentioned importlib.resources APIs, rather than
the issue that added back their improved forms.

(cherry picked from commit 7a303fc78a)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-10-09 22:45:03 +10:00
Miss Islington (bot)
dde8805d51
[3.13] gh-125150: Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation issues (GH-125151) (#125173)
gh-125150: Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation issues (GH-125151)

Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation issues
(cherry picked from commit 92760bd85b)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-10-09 09:05:57 +00:00
Savannah Ostrowski
5f2a5ac9dc
[3.13] GH-124478: Cleanup argparse documentation (GH-124877) (#125162)
(cherry picked from commit 37228bd16e)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2024-10-08 16:20:01 -07:00
Miss Islington (bot)
21a99add45
[3.13] Misc improvements to the itertools docs (gh-125147) (gh-125149) 2024-10-08 14:37:13 -05:00
Raymond Hettinger
988cdccbe0
[3.13] Itertool docs: Minor clarifications, wording tweaks, spacing, and active voice. (gh-124690) (gh-125148)
Minor clarifications, wording tweaks, spacing, and active voice.
2024-10-08 14:29:15 -05:00
Raymond Hettinger
7bc99dd49e
[3.13] Tee of tee was not producing n independent iterators (gh-123884) (gh-125081) 2024-10-08 14:11:43 -05:00
Miss Islington (bot)
f5fea4dec6
[3.13] gh-124832: Add a note to indicate that datetime.now may return the same instant (GH-124834) (#125145)
gh-124832: Add a note to indicate that `datetime.now` may return the same instant (GH-124834)

* Update datetime.rst

* Update datetime.rst

replace warning with note

* Update Doc/library/datetime.rst



* Update Doc/library/datetime.rst



---------

(cherry picked from commit 760b1e103a)

Co-authored-by: spacemanspiff2007 <10754716+spacemanspiff2007@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-08 18:26:07 +00:00
Kumar Aditya
20242a437c
[3.13] gh-117721: use PyMutex in _thread.lock (#125110) (#125116)
* gh-117721: use PyMutex in `_thread.lock` (#125110)

(cherry picked from commit fca552993d)
2024-10-08 21:16:48 +05:30
Jelle Zijlstra
089c6d2961
[3.13] gh-112433 add versionadded for ctypes.Structure._align_ (GH-125087) (#125113)
(cherry picked from commit 5967dd8a4d)

Co-authored-by: monkeyman192 <monkey_man_192@yahoo.com.au>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-10-08 14:24:27 +00:00
Victor Stinner
5df6a756a5
[3.13] gh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL (#125097) (#125111)
gh-125096: Don't import _pyrepl in site if PYTHON_BASIC_REPL (#125097)

If the PYTHON_BASIC_REPL environment variable is set, the site module
no longer imports the _pyrepl module.

Moreover, the site module now respects -E and -I command line
options: ignore PYTHON_BASIC_REPL in this case.

(cherry picked from commit 65ce228d63)
2024-10-08 14:20:05 +00:00
Miss Islington (bot)
0a63c66035
[3.13] Doc: Improve description of `GET_LEN` opcode (GH-114583) (#125102)
Doc: Improve description of ``GET_LEN`` opcode (GH-114583)
(cherry picked from commit e8773e59a8)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-10-08 12:30:52 +00:00
Miss Islington (bot)
84991153da
[3.13] gh-123378: fix a crash in UnicodeError.__str__ (GH-124935) (#125099)
gh-123378: fix a crash in `UnicodeError.__str__` (GH-124935)
(cherry picked from commit ba14dfafd9)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-08 12:06:57 +00:00
Felix Fontein
4eab6e8d29
[3.13] gh-118658: Modify cert generation script to extract cert3.pem (GH-124598) (GH-124972)
(cherry picked from commit 480354dc23)
2024-10-08 13:37:30 +02:00
Alyssa Coghlan
64391363ed
[3.13] bpo-34206: Improve docs and test coverage for pre-init functions (GH-8023) (#125092)
- move the Py_Main documentation from the very high level API section
  to the initialization and finalization section
- make it clear that it encapsulates a full Py_Initialize/Finalize
  cycle of its own
- point out that exactly which settings will be read and applied
  correctly when Py_Main is called after a separate runtime
  initialization call is version dependent
- be explicit that Py_IsInitialized can be called prior to
  initialization
- actually test that Py_IsInitialized can be called prior to
  initialization
- flush stdout in the embedding tests that run code so it appears
  in the expected order when running with "-vv"
- make "-vv" on the subinterpreter embedding tests less spammy

---------

(cherry picked from commit 7c4b6a68f2)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-08 09:30:06 +00:00
Miss Islington (bot)
9e61aa9b38
[3.13] gh-53203: Improve tests for strptime() (GH-125090) (GH-125091)
Run them with different locales and different date and time.

Add the @run_with_locales() decorator to run the test with multiple
locales.

Improve the run_with_locale() context manager/decorator -- it now
catches only expected exceptions and reports the test as skipped if no
appropriate locale is available.
(cherry picked from commit 19984fe024)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-08 12:12:15 +03:00
Serhiy Storchaka
ea2ccb3d43
[3.13] gh-85935: Improve tests for invalid arguments in test_argparse (GH-124891) (GH-124901)
Check also specific error messages.
(cherry picked from commit 2c050d4bc2)
2024-10-08 11:19:30 +03:00