Commit graph

119937 commits

Author SHA1 Message Date
Miss Islington (bot)
317350ec1b
[3.12] gh-85583: Add f-string index in tutorial/inputoutput.rst (GH-21681) (GH-126192)
gh-85583: Add f-string index in tutorial/inputoutput.rst  (GH-21681)

* bpo-41411 fstring index in tutorial/inputoutput

To assist in searching for fstrings I have added an index

* Add newline

---------

(cherry picked from commit a3443c0e22)

Co-authored-by: amaajemyfren <32741226+amaajemyfren@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-30 10:36:11 -07:00
Miss Islington (bot)
679dfaeb4c
[3.12] gh-124612: Use ghcr.io/python/autoconf instead of public image (GH-124657) (#126184)
(cherry picked from commit b502573f7f)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-10-30 14:22:50 +00:00
Serhiy Storchaka
b4040c41ac
[3.12] gh-126071: Improve formatting of the argparse documentation (GH-126073) (GH-126174)
* Use appropriate roles for ArgumentParser, Action, etc.
* Remove superfluous repeated links.
* Explicitly document signatures and add index entries for some methods
  and classes.
* Make it more clear that some parameters are keyword-only.
* Fix some minor errors.
(cherry picked from commit 2ab377a47c)
2024-10-30 09:10:10 +00:00
Miss Islington (bot)
5df3c88432
[3.12] docs: restore an anchor to for/else (GH-126154) (#126158)
docs: restore an anchor to for/else (GH-126154)
(cherry picked from commit 2d9d10179f)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-10-30 08:17:16 +00:00
Brian Schubert
b69bb1e3fe
[3.12] gh-118633: Add warning regarding the unsafe usage of eval and exec (GH-118437) (#126162)
(cherry picked from commit 00e5ec0d35)

Co-authored-by: Daniel Ruf <daniel@daniel-ruf.de>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-29 23:22:31 -07:00
Brian Schubert
e5c7543f12
[3.12] gh-126139: Improve error message location for future statement with unknown feature (GH-126140) (#126160)
(cherry picked from commit 224c370a36)
2024-10-30 00:54:32 +00:00
Miss Islington (bot)
7812dc37ab
[3.12] Doc: Note that pydoc uses and prefers `MANPAGER` (GH-125362) (#126153)
Doc: Note that pydoc uses and prefers ``MANPAGER`` (GH-125362)
(cherry picked from commit 0e45b1fd0f)

Co-authored-by: Matthieu Ancellin <31126826+mancellin@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-29 23:26:29 +00:00
Miss Islington (bot)
1fc1a185ed
[3.12] gh-116938: Fix dict.update docstring and remove erraneous full stop from dict documentation (GH-125421) (#126151)
gh-116938: Fix `dict.update` docstring and remove erraneous full stop from `dict` documentation (GH-125421)
(cherry picked from commit 5527c4051c)

Co-authored-by: Prometheus3375 <35541026+Prometheus3375@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-29 23:22:20 +00:00
Miss Islington (bot)
b267b6241b
[3.12] GH-125866: Improve tests for pathname2url() and url2pathname() (GH-125993) (#126145)
GH-125866: Improve tests for `pathname2url()` and `url2pathname()` (GH-125993)

Merge `URL2PathNameTests` and `PathName2URLTests` test cases (which test
only the Windows-specific implementations from `nturl2path`) into the main
`Pathname_Tests` test case for these functions.

Copy/port some test cases for `pathlib.Path.as_uri()` and `from_uri()`.
(cherry picked from commit 6742f14dfd)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-10-29 21:02:12 +00:00
Miss Islington (bot)
db0a1b8c12
[3.12] Add lightweight comments to conf.py and update docs readme (GH-126100) (#126135)
Add lightweight comments to conf.py and update docs readme (GH-126100)

* Update contributing contact info in readme

* Add lightweight comments to improve docs workflow understanding

* Apply code review suggestions from @hugovk



* Add code review suggestion from @AA-Turner



* Update Doc/conf.py



* Update Doc/conf.py



* Update Doc/conf.py



---------

(cherry picked from commit 9effa0ff06)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-29 12:22:38 -07:00
Kirill Podoprigora
515a5d3498
[3.12] gh-126105: Fix crash in ast module, when ._fields is delet… (#126132)
[3.12] gh-126105: Fix crash in `ast` module, when `._fields` is deleted (GH-126115)

Previously, if the `ast.AST._fields` attribute was deleted, attempts to create a new `as`t node would crash due to the assumption that `_fields` always had a non-NULL value. Now it has been fixed by adding an extra check to ensure that `_fields` does not have a NULL value (this can happen when you manually remove `_fields` attribute).
(cherry picked from commit b2eaa75b17)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-10-29 20:20:40 +02:00
Miss Islington (bot)
bce9df97d5
[3.12] gh-125783: Add tests to prevent regressions with the combination of ctypes and metaclasses. (GH-125881) (GH-125988)
cherry picked from commit 1384409460
by Jun Komoda

Also: Add test_ctypes/_support.py from 3.13+
This partially backports be89ee5649
(https://github.com/python/cpython/pull/113727)
by AN Long


Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-10-29 14:15:09 +01:00
Miss Islington (bot)
bc9ae4a1ca
[3.12] gh-126106: Fix NULL possible derefrence in Modules/_ssl.c (GH-126111) (#126117)
gh-126106: Fix `NULL` possible derefrence in `Modules/_ssl.c` (GH-126111)
(cherry picked from commit a64a1c9206)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-29 09:26:28 +00:00
Miss Islington (bot)
a8472fdbcd
[3.12] Align functools.reduce() docstring with PEP-257 (GH-126045) (#126114)
Yak-shave in preparation for Argument Clinic adaption in gh-125999.

(cherry picked from commit 9b14083497)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-10-29 10:13:52 +01:00
Miss Islington (bot)
385fa83a43
[3.12] gh-126014: Ignore __pycache__-only folders in makefile tests (GH-126066) (#126110)
gh-126014: Ignore `__pycache__`-only folders in makefile tests (GH-126066)
(cherry picked from commit aeafaf4cda)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2024-10-29 08:04:50 +00:00
Miss Islington (bot)
8da17bb4f7
[3.12] gh-89762: Document strftime %G, %V, and %u format specifiers (GH-124572) (#126095)
(cherry picked from commit 85799f1ffd)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
2024-10-28 22:01:18 +00:00
Miss Islington (bot)
d89283b3e7
[3.12] gh-124594: Create and reuse the same context for the entire asyncio REPL session (GH-124595) (#124849)
* gh-124594: Create and reuse the same context for the entire asyncio REPL session (GH-124595)
(cherry picked from commit 67e01a430f)

Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>


---------

Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2024-10-28 15:25:00 +01:00
Miss Islington (bot)
1e01dcf429
[3.12] gh-121277: Allow .. versionadded:: next in docs (GH-121278) (GH-125980)
Make `versionchanged:: next`` expand to current (unreleased) version.

When a new CPython release is cut, the release manager will replace
all such occurences of "next" with the just-released version.
(See the issue for release-tools and devguide PRs.)

(cherry picked from commit 7d24ea9db3)

Also backports a minor fix-up:
gh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH-124623)

(cherry-picked from commit e349f73a5a)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-10-28 14:30:29 +01:00
Miss Islington (bot)
05214e66b0
[3.12] gh-120313: amend documentation regarding ctypes._CFuncPtr (GH-120989) (GH-125978)
gh-120313: amend documentation regarding `ctypes._CFuncPtr` (GH-120989)

(cherry picked from commit 417c130ba5)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-28 14:21:05 +01:00
Miss Islington (bot)
9f35fbc068
[3.12] gh-126035: add missing whitespace to *Py_EnterRecursiveCall() messages (GH-126036) (#126059)
(cherry picked from commit 19e93e2e26)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-27 22:12:20 +00:00
Serhiy Storchaka
4c039c0723
[3.12] gh-124295: Add translation tests for argparse (GH-124803) (GH-126046) (GH-126054)
(cherry picked from commit 0922a4ae0d)
(cherry picked from commit ff044ed800)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2024-10-27 18:57:11 +00:00
Miss Islington (bot)
4fc1da1b27
[3.12] gh-125966: fix use-after-free on fut->fut_callback0 due to an evil callback's __eq__ in asyncio (GH-125967) (#126048)
gh-125966: fix use-after-free on `fut->fut_callback0` due to an evil callback's `__eq__` in asyncio (GH-125967)
(cherry picked from commit ed5059eeb1)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-27 17:32:11 +00:00
Miss Islington (bot)
fdedb2618a
[3.12] gh-125984: fix use-after-free on fut->fut_{callback,context}0 due to an evil loop.__getattribute__ (GH-126003) (#126044)
gh-125984: fix use-after-free on `fut->fut_{callback,context}0` due to an evil `loop.__getattribute__` (GH-126003)
(cherry picked from commit f819d4301d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-27 15:23:07 +00:00
Miss Islington (bot)
67b270142d
[3.12] gh-84545: Clarify the 'extend' action documentation in argparse (GH-125870) (GH-125965)
(cherry picked from commit da8673da36)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-26 21:37:42 +03:00
Miss Islington (bot)
6a8e8f48b4
[3.12] gh-118950: Fix SSLProtocol.connection_lost not being called when OSError is thrown (GH-118960) (#125932)
gh-118950: Fix SSLProtocol.connection_lost not being called when OSError is thrown (GH-118960)

(cherry picked from commit 3f24bde0b6)

Co-authored-by: Javad Shafique <javadshafique@hotmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-10-26 22:02:07 +05:30
Miss Islington (bot)
fe4585a674
[3.12] gh-125698: Autoconf: Sync EXEEXT and ac_exeext (GH-125995) (#126007)
(cherry picked from commit 8b7cdc5e0c)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-10-26 15:27:38 +00:00
Ethan Furman
d0b2fa4804
[3.12] gh-125259: Fix error notes removal in enum initialization (GH-125647) (GH-125953)
(cherry picked from commit 34653bba64)

Co-authored-by: Mario Šaško <mariosasko777@gmail.com>
2024-10-25 16:03:52 -07:00
Miss Islington (bot)
f6682fbe49
[3.12] gh-125969: fix OOB in future_schedule_callbacks due to an evil call_soon (GH-125970) (#125992)
gh-125969: fix OOB in `future_schedule_callbacks` due to an evil `call_soon` (GH-125970)
(cherry picked from commit c5b99f5c2c)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2024-10-25 18:38:59 +00:00
Miss Islington (bot)
42927f7f25
[3.12] GH-125789: fix fut._callbacks to always return a copy of callbacks (GH-125922) (#125977)
GH-125789: fix `fut._callbacks` to always return a copy of callbacks (GH-125922)

Fix `asyncio.Future._callbacks` to always return a copy of the internal list of callbacks to avoid mutation from user code affecting the internal state.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
(cherry picked from commit cae853e3b4)
2024-10-25 19:32:46 +05:30
Miss Islington (bot)
31ff9e5ac6
[3.12] gh-125933: Add ARIA labels to select elements in the version switcher (GH-125934) (#125939)
gh-125933: Add ARIA labels to select elements in the version switcher (GH-125934)
(cherry picked from commit 1306f33c84)

Co-authored-by: Kerim Kabirov <the.privat33r+gh@pm.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-10-24 21:00:45 +00:00
Miss Islington (bot)
869119e36d
[3.12] gh-125909: Avoid a redirect when linking to the devguide (GH-125826) (#125930)
(cherry picked from commit 5003ad5c5e)

Co-authored-by: partev <petrosyan@gmail.com>
2024-10-24 16:50:16 +00:00
Tian Gao
05b11ba059
[3.12] gh-125884: Support breakpoint on functions with annotations (G… (#125903)
* [3.12] gh-125884: Support breakpoint on functions with annotations (GH-125892)
(cherry picked from commit 8f2c0f7a03)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-10-23 22:36:40 +00:00
Miss Islington (bot)
440ed18e08
[3.12] gh-124858: fix happy eyeballs refcyles (GH-124859) (#124913)
gh-124858: fix happy eyeballs refcyles (GH-124859)
(cherry picked from commit c066bf5535)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2024-10-23 12:34:11 -07:00
Serhiy Storchaka
da3d81d3ea
[3.12] gh-125355: Rewrite parse_intermixed_args() in argparse (GH-125356) (GH-125839)
* The parser no longer changes temporarily during parsing.
* Default values are not processed twice.
* Required mutually exclusive groups containing positional arguments are
  now supported.
* The missing arguments report now includes the names of all required
  optional and positional arguments.
* Unknown options can be intermixed with positional arguments in
  parse_known_intermixed_args().

(cherry picked from commit 759a54d28f)
2024-10-22 13:23:30 +00:00
Miss Islington (bot)
98a0b362b5
[3.12] Doc: Show object descriptions in the table of contents (GH-125757) (#125841)
(cherry picked from commit 91ddde4af0)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-22 13:16:03 +00:00
Zachary Ware
7a2bd3d2ad
[3.12] gh-124448: Update Windows builds to use Tcl/Tk 8.6.15 (GH-125796)
(cherry picked from commit 9d8f2d8e08)
2024-10-21 21:44:56 -05:00
Miss Islington (bot)
e6746d9a5d
[3.12] gh-53203: Fix test_strptime on Solaris (GH-125785) (GH-125807)
Use fixed timezone.
Skip roundtrip tests on locales with 2-digit year.
(cherry picked from commit 9dde4638e4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-21 19:37:34 +00:00
Miss Islington (bot)
0009651d8e
[3.12] gh-124969: Make locale.nl_langinfo(locale.ALT_DIGITS) returning a string again (GH-125774) (GH-125805)
This is a follow up of GH-124974. Only Glibc needed a fix.
Now the returned value is a string consisting of semicolon-separated
symbols on all Posix platforms.
(cherry picked from commit dcc4fb2c90)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-21 19:24:45 +00:00
Miss Islington (bot)
cea93dbd99
[3.12] gh-125766: Docs: minor rewording of installation on Linux section (GH-125794)
(cherry picked from commit d67bf2d89a)

Co-authored-by: partev <petrosyan@gmail.com>
2024-10-21 11:56:29 -05:00
Miss Islington (bot)
c3e705fbe5
[3.12] Doc: C API: Move tp_dealloc paragraph to tp_dealloc section (GH-125737) (#125799)
Doc: C API: Move `tp_dealloc` paragraph to `tp_dealloc` section (GH-125737)

It looks like commit 43cf44ddcc
(gh-31501) accidentally moved the paragraph to the `tp_finalize`
section when the intent was to move it to the `tp_dealloc` section
(according to the commit message).

(cherry picked from commit d880c83ff7)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2024-10-21 09:55:11 -07:00
Miss Islington (bot)
2746ec4ce2
[3.12] gh-125660: Reject invalid unicode escapes for Python implementation of JSON decoder (GH-125683) (GH-125695)
(cherry picked from commit df751363e3)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-10-21 16:08:10 +03:00
Miss Islington (bot)
18196fea89
[3.12] gh-125682: Reject non-ASCII digits in the Python implementation of JSON decoder (GH-125687) (GH-125693)
(cherry picked from commit d358425e69)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-10-21 16:06:02 +03:00
Erlend E. Aasland
2bc2aae386
[3.12] gh-125741: Update check_generated_files CI to use our published container image (gh-125744) (#125760)
(cherry picked from commit ed24702bd0)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-10-21 12:23:41 +02:00
Miss Islington (bot)
8cc8d7d61f
[3.12] gh-125519: Improve traceback if importlib.reload() is called with a non-module object (GH-125520) (#125769)
gh-125519: Improve traceback if `importlib.reload()` is called with a non-module object (GH-125520)
(cherry picked from commit c5c21fee7a)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-21 08:20:42 +00:00
Miss Islington (bot)
9a22ec735f
[3.12] gh-99030: Added documentation links for types and exceptions (GH-123857) (GH-125765)
gh-99030: Added documentation links for types and exceptions (GH-123857)

* Added documentation links for types and exceptions

* Shortened description sentences

* Change content

* Change documentation

* Move seealso

* Add a spaces
(cherry picked from commit 9256be7ff0)

Co-authored-by: RUANG (Roy James) <longjinyii@outlook.com>
2024-10-21 00:43:26 +00:00
Miss Islington (bot)
5f6e1120e3
[3.12] gh-125522: Fix bare except in test_math.testTan (GH-125544) (#125727)
gh-125522: Fix bare except in test_math.testTan (GH-125544)
(cherry picked from commit 4b421e8aca)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-10-19 12:07:16 +00:00
Miss Islington (bot)
2ce10b1729
[3.12] GH-125277: Increase minimum supported Sphinx to 7.2.6 (GH-125368) (#125721) 2024-10-19 04:27:44 +00:00
Miss Islington (bot)
93933782d9
[3.12] Add tests for time.strftime() with invalid format string (GH-125696) (GH-125701)
(cherry picked from commit 2e950e3419)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-18 14:13:31 +00:00
Miss Islington (bot)
aa9faee686
[3.12] gh-125620: Skip check_resource_tracker_death on NetBSD due to long wait for SIGKILL process termination (GH-125621) (#125673)
gh-125620: Skip check_resource_tracker_death on NetBSD due to long wait for SIGKILL process termination (GH-125621)

* Skip test_resource_tracker_sigkill on NetBSD
(cherry picked from commit a0f5c8e627)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2024-10-18 02:25:00 +00:00
Miss Islington (bot)
232b303e4c
[3.12] gh-52551: Fix encoding issues in strftime() (GH-125193) (GH-125657) (GH-125661)
Fix time.strftime(), the strftime() method and formatting of the
datetime classes datetime, date and time.

* Characters not encodable in the current locale are now acceptable in
  the format string.
* Surrogate pairs and sequence of surrogatescape-encoded bytes are no
  longer recombinated.
* Embedded null character no longer terminates the format string.

This fixes also gh-78662 and gh-124531.

(cherry picked from commit 08ccbb9b3f)
(cherry picked from commit ad3eac1963)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-17 20:04:48 +00:00