Commit graph

123354 commits

Author SHA1 Message Date
Miss Islington (bot)
00ff23f06d
[3.13] gh-60712: Include the "object" type in the lists of documented types (GH-103036) (GH-126197)
gh-60712: Include the "object" type in the lists of documented types (GH-103036)

* add test for the predefined object's attributes

* Include the "object" type in the lists of documented types

* remove 'or' from augment tuple

* 📜🤖 Added by blurb_it.

* Add cross-reference to news



* Fix format for the function parameter



* Add space



* add reference for the 'object'



* add reference for NotImplemented



* Change ref:`string <textseq>`  as class:`str`



* remove hyphen from `newly-created`

* Update Doc/reference/datamodel.rst

'dictionaries' to 'dict'



* Update predefined attribute types in testPredefinedAttrs

* Change `universal type` as `top type`

* Don't mention about the top type

* Update the description of richcmpfuncs

* Update Doc/library/stdtypes.rst



* Revert: Hierarchy Section in Data Model Documentation

* Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.

* Update Doc/reference/datamodel.rst



* Remove blank line



* Use ref:`str <textseq>` instead of :class:`str



* Revert changes the description of Other Built-in Types in stdtypes.rst

* Update Doc/reference/datamodel.rst



---------

(cherry picked from commit 4f826214b3)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-30 13:16:38 -07:00
Miss Islington (bot)
e6e140db9e
[3.13] gh-126055: Add omitted command (in docs [os.walk]) for code to fulfill shutil.rmtree algorithm (GH-126067) (GH-126199)
gh-126055:  Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm (GH-126067)

* gh-126055:  Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm.

Resolves GH-126055

* gh-126055:  Fix omitted code highlighting
(cherry picked from commit 597d814334)

Co-authored-by: Victor Wheeler <vwheeler63@users.noreply.github.com>
2024-10-30 13:16:00 -07:00
Miss Islington (bot)
56b294e431
[3.13] Fix incorrect indentation in importlib.metadata.rst (GH-126189) (GH-126193)
Fix incorrect indentation in importlib.metadata.rst (GH-126189)
(cherry picked from commit 6f512c6034)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-10-30 11:00:29 -07:00
Miss Islington (bot)
210bd2a50d
[3.13] gh-85583: Add f-string index in tutorial/inputoutput.rst (GH-21681) (GH-126191)
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:35:10 -07:00
Miss Islington (bot)
d24ea899e8
[3.13] gh-124612: Use ghcr.io/python/autoconf instead of public image (GH-124657) (#126183)
(cherry picked from commit b502573f7f)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-10-30 14:19:15 +00:00
Serhiy Storchaka
6b0ef1fd6f
[3.13] gh-126071: Improve formatting of the argparse documentation (GH-126073) (GH-126173)
* 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:21:38 +00:00
Miss Islington (bot)
de9ff23ea1
[3.13] docs: restore an anchor to for/else (GH-126154) (#126159)
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:16:33 +00:00
Miss Islington (bot)
343a7a6259
[3.13] gh-118633: Add warning regarding the unsafe usage of eval and exec (GH-118437) (#126161)
gh-118633: Add warning regarding the unsafe usage of eval and exec (GH-118437)

* Add warning regarding the unsafe usage of eval

* Add warning regarding the unsafe usage of exec

* Move warning under parameters table

* Use suggested shorter text



* Use suggested shorter text



* Improve wording as suggested

---------

(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-30 00:49:18 +00:00
Miss Islington (bot)
b9cbc58e13
[3.13] gh-126139: Improve error message location for future statement with unknown feature (GH-126140) (#126155)
gh-126139: Improve error message location for future statement with unknown feature (GH-126140)
(cherry picked from commit 224c370a36)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2024-10-30 00:36:06 +00:00
Miss Islington (bot)
f37ac53cd3
[3.13] gh-116938: Fix dict.update docstring and remove erraneous full stop from dict documentation (GH-125421) (#126150)
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:27:33 +00:00
Miss Islington (bot)
f5b1510e6b
[3.13] Doc: Note that pydoc uses and prefers `MANPAGER` (GH-125362) (#126152)
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:23:18 +00:00
Miss Islington (bot)
35108c1871
[3.13] GH-125866: Improve tests for pathname2url() and url2pathname() (GH-125993) (#126144)
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:08:17 +00:00
Miss Islington (bot)
8dc0575047
gh-126084: Fix venvwlauncher.exe to run pythonw.exe (GH-126088)
(cherry picked from commit 802d405ff1)

Co-authored-by: Christian Ullrich <chris@chrullrich.net>
2024-10-29 20:20:05 +00:00
Miss Islington (bot)
5ce23f2703
[3.13] Add lightweight comments to conf.py and update docs readme (GH-126100) (#126134)
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 19:21:41 +00:00
Miss Islington (bot)
265bc19b84
[3.13] gh-126105: Fix crash in ast module, when ._fields is deleted (GH-126115) (#126130)
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 16:07:32 +00:00
Miss Islington (bot)
e2c188455f
[3.13] gh-126106: Fix NULL possible derefrence in Modules/_ssl.c (GH-126111) (#126116)
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:29:10 +00:00
Miss Islington (bot)
e7c63107d1
[3.13] Align functools.reduce() docstring with PEP-257 (GH-126045) (#126113)
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:35 +01:00
Miss Islington (bot)
36f8184d29
[3.13] gh-126014: Ignore __pycache__-only folders in makefile tests (GH-126066) (#126109)
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:11:47 +00:00
Miss Islington (bot)
672b915ff9
[3.13] gh-89762: Document strftime %G, %V, and %u format specifiers (GH-124572) (#126094)
(cherry picked from commit 85799f1ffd)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
2024-10-28 21:59:41 +00:00
Miss Islington (bot)
ccf040896e
[3.13] gh-120313: amend documentation regarding ctypes._CFuncPtr (GH-120989) (GH-125979)
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:20:58 +01:00
Miss Islington (bot)
86ec8aa7ed
[3.13] gh-125783: Add tests to prevent regressions with the combination of ctypes and metaclasses. (GH-125881) (#125987)
gh-125783: Add tests to prevent regressions with the combination of `ctypes` and metaclasses. (GH-125881)
(cherry picked from commit 1384409460)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
2024-10-28 13:49:45 +01:00
Pablo Galindo Salgado
00b13ec050
[3.13] gh-125703: Correctly honour tracemalloc hooks on more PyDECREF specialized paths (GH-125712) (#125791)
(cherry picked from commit 3d1df3d84e)
2024-10-28 11:50:36 +00:00
Miss Islington (bot)
97c2e6ac27
[3.13] gh-126035: add missing whitespace to *Py_EnterRecursiveCall() messages (GH-126036) (#126058)
(cherry picked from commit 19e93e2e26)

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

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2024-10-27 18:35:30 +00:00
Miss Islington (bot)
ac31a2607f
[3.13] gh-125966: fix use-after-free on fut->fut_callback0 due to an evil callback's __eq__ in asyncio (GH-125967) (#126047)
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:36:10 +00:00
Miss Islington (bot)
25421c715d
[3.13] gh-125984: fix use-after-free on fut->fut_{callback,context}0 due to an evil loop.__getattribute__ (GH-126003) (#126043)
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:28:02 +00:00
Miss Islington (bot)
e4157f0fd7
[3.13] gh-126018: Avoid aborting due to unnecessary assert in sys.audit (GH-126020) (#126042)
(cherry picked from commit 80eec52fc8)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-27 15:07:33 +00:00
Miss Islington (bot)
9e37bfae5a
[3.13] gh-125593: Use colors to highlight error locations in tracebacks from exception group (GH-125681) (#126021)
gh-125593: Use colors to highlight error locations in tracebacks from exception group (GH-125681)
(cherry picked from commit 51b012b2a8)

Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
2024-10-27 01:23:00 +00:00
Miss Islington (bot)
e4204e879e
[3.13] gh-84545: Clarify the 'extend' action documentation in argparse (GH-125870) (GH-125964)
(cherry picked from commit da8673da36)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-26 21:37:06 +03:00
Miss Islington (bot)
95bcbcb7c8
[3.13] gh-118950: Fix SSLProtocol.connection_lost not being called when OSError is thrown (GH-118960) (#125931)
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:01:47 +05:30
Miss Islington (bot)
f702ea24fa
[3.13] gh-125698: Autoconf: Sync EXEEXT and ac_exeext (GH-125995) (#126006)
(cherry picked from commit 8b7cdc5e0c)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-10-26 15:36:03 +00:00
Miss Islington (bot)
f521142b47
[3.13] Fix a typo in `Doc/tutorial/errors.rst` exception output (GH-126001) (#126009)
Fix a typo in ``Doc/tutorial/errors.rst`` exception output (GH-126001)
(cherry picked from commit a78d5b3242)

Co-authored-by: Bogdana Vereha <bogdanap@github.com>
2024-10-26 15:32:37 +00:00
Miss Islington (bot)
9c6cda5ccb
[3.13] gh-125969: fix OOB in future_schedule_callbacks due to an evil call_soon (GH-125970) (#125991)
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:43:07 +00:00
Miss Islington (bot)
7b46ae92ad
[3.13] gh-125608: Trigger dictionary watchers when inline values change (GH-125611) (GH-125982)
Dictionary watchers on an object's attributes dictionary
(`object.__dict__`) were not triggered when the managed dictionary used
the object's inline values.
(cherry picked from commit 5989eb7446)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-10-25 14:35:04 +00:00
Petr Viktorin
dba992b03b
[3.13] gh-121277: Allow .. versionadded:: next in docs (GH-121278) (#124718)
* gh-121277: Allow `.. versionadded:: next` in docs (GH-121278)

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.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
(cherry picked from commit 7d24ea9db3)

* gh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH-124623)

(cherry-picked from e349f73a5a)
2024-10-25 15:34:20 +02:00
Kumar Aditya
f54e1a2d64
[3.13] GH-125789: fix fut._callbacks to always return a copy of callbacks (#125922) (#125976)
GH-125789: fix `fut._callbacks` to always return a copy of callbacks (#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.

(cherry picked from commit cae853e3b4)
2024-10-25 13:19:31 +00:00
Miss Islington (bot)
b67358125c
[3.13] gh-123930: Correct test of attribute failure to account for iOS (GH-125959) (#125960)
gh-123930: Correct test of attribute failure to account for iOS (GH-125959)

Update a test of importing attributes from binary modules to account for iOS conditions.
(cherry picked from commit 75401febc9)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-10-25 07:42:20 +00:00
Miss Islington (bot)
32830cf703
[3.13] gh-125259: Fix error notes removal in enum initialization (GH-125647) (GH-125858)
gh-125259: Fix error notes removal in enum initialization (GH-125647)
(cherry picked from commit 34653bba64)

Co-authored-by: Mario Šaško <mariosasko777@gmail.com>
2024-10-24 20:24:23 -07:00
Miss Islington (bot)
083c5814c8
[3.13] gh-125942: Android: set stdout to errors="backslashreplace" (GH-125943) (#125950)
gh-125942: Android: set stdout to `errors="backslashreplace"` (GH-125943)

Android stdout/err streams now use `backslashreplace` encoding to ensure readability of the Android log.
(cherry picked from commit b08570c90e)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-10-25 00:59:23 +00:00
Miss Islington (bot)
904634b258
[3.13] gh-125940: Android: support 16 KB pages (GH-125941) (#125948)
gh-125940: Android: support 16 KB pages (GH-125941)

Modify Android build tooling to use 16kB pages.
(cherry picked from commit e68d4b08ff)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-10-25 08:37:38 +08:00
Miss Islington (bot)
d46d291bd3
[3.13] gh-125245: Fix race condition when importing collections.abc (GH-125415) (GH-125944)
If multiple threads concurrently imported `collections.abc`, some of the
threads might incorrectly see the "shim" `Lib/collections/abc.py` module
instead of the correct `Lib/_collections_abc.py` module.  This affected
both the free threading build and the default GIL-enabled build.
(cherry picked from commit fed501d724)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-10-24 22:38:45 +00:00
Miss Islington (bot)
92d301eb67
[3.13] gh-125933: Add ARIA labels to select elements in the version switcher (GH-125934) (#125938)
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 20:57:52 +00:00
Shantanu
3d8b6f0977
[3.13] gh-123930: Better error for "from imports" when script shadows module (GH-123929) (#125937)
gh-123930: Better error for "from imports" when script shadows module (#123929)

(cherry picked from commit 500f5338a8)
2024-10-24 19:37:31 +00:00
Sam Gross
4b55d53316
[3.13] gh-125268: Use static string for "1e309" in AST (GH-125272) (GH-125280)
When formatting the AST as a string, infinite values are replaced by
1e309, which evaluates to infinity. The initialization of this string
replacement was not thread-safe in the free threading build.
(cherry picked from commit 427dcf24de)
2024-10-24 13:59:23 -04:00
Miss Islington (bot)
f27ba61e56
[3.13] gh-125909: Avoid a redirect when linking to the devguide (GH-125826) (#125929)
(cherry picked from commit 5003ad5c5e)

Co-authored-by: partev <petrosyan@gmail.com>
2024-10-24 16:47:01 +00:00
Miss Islington (bot)
52b57eee64
[3.13] gh-125842: Fix sys.exit(0xffff_ffff) on Windows (GH-125896) (GH-125925)
On Windows, `long` is a signed 32-bit integer so it can't represent
`0xffff_ffff` without overflow. Windows exit codes are unsigned 32-bit
integers, so if a child process exits with `-1`, it will be represented
as `0xffff_ffff`.

Also fix a number of other possible cases where `_Py_HandleSystemExit`
could return with an exception set, leading to a `SystemError` (or
fatal error in debug builds) later on during shutdown.
(cherry picked from commit ad6110a93f)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-10-24 16:27:30 +00:00
Miss Islington (bot)
5c2696bc26
[3.13] gh-125859: Fix crash when gc.get_objects is called during GC (GH-125882) (GH-125921)
This fixes a crash when `gc.get_objects()` or `gc.get_referrers()` is
called during a GC in the free threading build.

Switch to `_PyObjectStack` to avoid corrupting the `struct worklist`
linked list maintained by the GC. Also, don't return objects that are frozen
(`gc.freeze()`) or in the process of being collected to more closely match
the behavior of the default build.
(cherry picked from commit e545ead66c)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-10-24 14:08:15 +00:00
Tian Gao
e334022de0
[3.13] gh-125884: Support breakpoint on functions with annotations (G… (#125902)
[3.13] gh-125884: Support breakpoint on functions with annotations (GH-125892)
(cherry picked from commit 8f2c0f7a03)
2024-10-23 22:37:24 +00:00
Miss Islington (bot)
e596740399
[3.13] gh-124858: fix happy eyeballs refcyles (GH-124859) (#124912)
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:35:56 -07:00
Miss Islington (bot)
77d79989fd
[3.13] gh-123978: Remove broken time.thread_time() on NetBSD (GH-124116) (GH-124425)
(cherry picked from commit e670a113b5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-23 19:39:34 +03:00