Commit graph

125923 commits

Author SHA1 Message Date
Miss Islington (bot)
4e2285cf52
[3.13] gh-106318: Add examples to the str.isdigit() method docs (GH-144721)
(cherry picked from commit f051c68923)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-08 12:58:26 +00:00
Miss Islington (bot)
45d1ba7bb8
[3.13] gh-141623: operator.rst: don't use term "bitwise" (GH-141846) (GH-151080)
(cherry picked from commit bd5fa31c5f)

Co-authored-by: Doron Behar <doron.behar@gmail.com>
2026-06-08 12:19:22 +00:00
Miss Islington (bot)
619a12b2e5
[3.13] gh-150599: Prevent bz2 decompressor reuse after errors (GH-150600)
(cherry picked from commit 157a5df8cb)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-08 10:55:32 +01:00
Miss Islington (bot)
6e5c4c0c52
[3.13] Docs: Fix missing colon in bisect example function (GH-151061) (GH-151069)
Docs: Fix missing colon in `bisect` example function (GH-151061)
(cherry picked from commit 16ede813eb)

Co-authored-by: Sergio López Gómez <sergiolopezgmz.dam@gmail.com>
2026-06-08 09:45:49 +00:00
Miss Islington (bot)
5ca5a0af2c
[3.13] Update an error message in the 'Functional Programming HOWTO' (GH-151047)
(cherry picked from commit 81965c1683)

Co-authored-by: saber-bit <bryanventura0324@gmail.com>
2026-06-07 18:26:30 +01:00
Miss Islington (bot)
ac07245fd3
[3.13] gh-148954: Escape methodname in xmlrpc.client.dumps() to prevent XML injection (GH-148968) (GH-151035)
(cherry picked from commit ab930175e7)

Co-authored-by: Sanyam Kumat <124618873+sanyamk23@users.noreply.github.com>
2026-06-07 10:53:16 +03:00
Miss Islington (bot)
2fa0d4bc5d
[3.13] gh-50948: IDLE: Warn if saving a file will overwrite a newer version (GH-17578) (GH-151028)
(cherry picked from commit 69851a6407)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Guilherme Polo <ggpolo@gmail.com>
Co-authored-by: Priya Pappachan <priyapappachan010@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-07 00:12:20 +03:00
Miss Islington (bot)
8a69d89600
[3.13] Delete mention encoding and errors for importlib.resources.path() (GH-143111) (GH-151016)
(cherry picked from commit fded34d6fe)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
2026-06-06 11:58:49 +00:00
Miss Islington (bot)
73f9188587
[3.13] gh-149835: Use realpath() instead of abspath() in shutil.move() (GH-149986) (GH-151011)
(cherry picked from commit fab449bddb)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
2026-06-06 13:29:32 +03:00
Miss Islington (bot)
6a40e1c8d0
[3.13] gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing (GH-150275) (#150998)
gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing (GH-150275)
(cherry picked from commit 262625fa30)

Co-authored-by: Grant Herman <grantlouisherman041@gmail.com>
2026-06-06 03:47:00 +01:00
Miss Islington (bot)
b9ea60c38e
[3.13] Use time.monotonic in OrderedDict LRU cache example (GH-150986) (#150993)
Use `time.monotonic` in OrderedDict LRU cache example (GH-150986)
(cherry picked from commit ea4c85552b)

Co-authored-by: Ilya Nikolaev <65247719+ilya-nikolaev@users.noreply.github.com>
2026-06-06 01:59:53 +03:00
Miss Islington (bot)
fd1b5c638a
[3.13] gh-150907: Fix dynamic_annotations.h when built with C++ and Valgrind (GH-150914) (#150964)
gh-150907: Fix dynamic_annotations.h when built with C++ and Valgrind (GH-150914)

Add extern "C++" scope for the C++ template.

Fix test_cppext when Python is built with --with-valgrind.
(cherry picked from commit c32501261a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-05 12:29:28 +00:00
Miss Islington (bot)
0918ad4b0f
[3.13] gh-129011: Update docs for Raw I/O read, readinto, and write (GH-135328) (#150959)
gh-129011: Update docs for Raw I/O read, readinto, and write (GH-135328)

Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.

In particular:

 - They may make more than one system call (PEP-475)
 - Add warnings if `.write()` requires a wrapping retry loop (see: gh-126606)
    - "Raw I/O" `.write`` may not write all bytes
    - `buffering=0` example results in a "Raw I/O"
(cherry picked from commit e4db68b9c9)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-05 12:07:39 +00:00
Miss Islington (bot)
68250323fc
[3.13] gh-150913: Fix sqlite3.Blob validation for empty slice assignment (GH-150915) (GH-150925)
ass_subscript_slice() returned early when the computed slice length
was zero, bypassing validation performed for non-empty slices.
(cherry picked from commit fc9c4db130)

Co-authored-by: Jiseok CHOI <jiseok.dev@gmail.com>
2026-06-04 13:59:11 +00:00
Miss Islington (bot)
d7beb9c06d
[3.13] gh-106318: Add doctest role and a 'See also' to the str.split() docs (GH-144367)
(cherry picked from commit a96cba5c4a)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-06-04 14:23:07 +01:00
Miss Islington (bot)
a6f3b6144d
[3.13] Correct Stable ABI documentation for METH_FASTCALL (GH-149593) (GH-150851)
The current documentation says:

>
> METH_FASTCALL
>    Part of the Stable ABI since version 3.7.
>
> [...]
>
>   Added in version 3.7.
>
>    Changed in version 3.10: METH_FASTCALL is now part of the stable ABI.

so is contradictory about when it was added to the Stable ABI.  Looking at the header it seems like 3.10 is right.
(cherry picked from commit 58beae7319)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2026-06-04 11:50:19 +02:00
Miss Islington (bot)
64b982071b
[3.13] gh-140553: Mark *gettext parameters as positionaly only in documentation (GH-140598)
(cherry picked from commit 1837c17bc7)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-04 09:19:56 +01:00
Hugo van Kemenade
26e3ca4160
[3.13] Docs: Replace hardcoded SOURCE_URI with patchlevel check (GH-150850) (#150857) 2026-06-03 16:50:07 +03:00
Miss Islington (bot)
ba91d8792a
[3.13] gh-91099: fix[imaplib]: call Exception with string instance (GH-31823) (#150809)
* bpo-46943: fix[imaplib]: call Exception with string instance

Adjust the behavior of 'login' to be similar to `authenticate()`,
where self.error is called with a str() instance.
(cherry picked from commit 29805f00a1)

Co-authored-by: Florian Best <spaceone@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2026-06-03 09:12:00 -04:00
Miss Islington (bot)
d229764d1e
[3.13] Fix a typo in SSLSocket docs (GH-150839) (GH-150847)
Fix a typo in `SSLSocket` docs (GH-150839)
(cherry picked from commit 5553e003ca)

Co-authored-by: Robsdedude <dev@rouvenbauer.de>
2026-06-03 12:26:03 +00:00
Alex Waygood
7c5734c791
[3.13] gh-150319: Replace all documentation which says "See PEP 585" (#150325) (#150814)
gh-150319: Replace all documentation which says "See PEP 585" (#150325)

* Replace all documentation which says "See PEP 585"

The following classes in the stdlib get simple updates:

- array.array
- asyncio.Future
- asyncio.Task
- collections.defaultdict
- collections.deque
- contextvars.ContextVar
- contextvars.Token
- ctypes.Array
- os.DirEntry
- re.Match
- re.Pattern
- string.templatelib.Interpolation
- string.templatelib.Template
- types.MappingProxyType
- queue.SimpleQueue
- weakref.ref

The following classes are documented publicly as functions, and are
therefore updated internally (`__class_getitem__.__doc__`) but not in the
public docs:

- functools.partial
- itertools.chain

The following builtin types have updates to `__class_getitem__.__doc__`
but not to any documentation pages:

- BaseExceptionGroup
- coroutines (from generators)
- dict
- enumerate
- frozendict
- frozenset
- generators (and async generators)
- list
- memoryview
- set
- slice
- tuple

Special cases:

- union objects are now documented as "supporting class-level []",
  rather than anything to do with generics.

- Templates might be generic over a single type (union, in theory) or
  over a TypeVarTuple. As this is not currently fully settled, it is
  marked with a comment and a mild hint that it is a single type is used
  (namely, "type" is singular rather than "types", plural)

* Apply suggestions from code review



* Correct several class getitem docs

And expand the text for tuples.



* Add notes on generic typing of builtins

* Fix typo in tuple.__class_getitem__ docstring

* Typo fix: malformed refs

Fix `generic` links which weren't marked as `:ref:`.

* Strike unnecessary docs on generic-ness



* Apply suggestions from code review

These are applied at both the originally indicated locations and in the
corresponding docstring definitions.



* Update Doc/library/re.rst



* Update Objects/enumobject.c



* Remove tuple generic doc in 'stdtypes' page

This is covered in more detail in the cross-linked typing documentation.
The other copy of this documentation -- in the docstring for
`tuple.__class_getitem__` -- is left in place.

* Fix whitespace around new doc of generics

Per review, do not introduce or remove whitespace such that section
breaks are altered by the introduction of doc on various generic types.

In most cases, this is a removal of an extra line.

In one case (Arrays), it is the reintroduction of a line.

Additionally, two other minor fixes are included:
- incorrect indent on 'defaultdicts'
- make `mappingproxy.__class_getitem__.__doc__` consistent with other
  mapping type generic docs



* Move placement of memoryview generic note

Previous placement was at the end of the main docstring, which is
consistent with other types but places it after a section on various
methods (which makes it read somewhat inconsistently). Moving it up
helps resolve.



* Ensure sphinxdoc does not start sentences lowercase

Lowercase class names at the start of sentences are marked out with the
`class` role. In the case of `deque`, documentation already refers to
these as `Deques`, so this form is preferred.

* Apply suggestions from code review



* Fix line endings and wrap more tightly

Line endings fixed by pre-commit ; also re-wrapped the MappingProxyType
text which was too long.

* Use 'ContextVars' style in sphinx doc

---------

Co-authored-by: Stephen Rosen <sirosen@globus.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-02 22:26:33 +00:00
Miss Islington (bot)
d3bfccdbd5
[3.13] gh-141627: Fix BufferedRandom inheritance documentation (GH-141629) (GH-150803)
BufferedRandom does not inherit from BufferedReader and BufferedWriter
in the C implementation.
(cherry picked from commit 551bc2cb5e)

Co-authored-by: Mohsin Mehmood <55545648+mohsinm-dev@users.noreply.github.com>
2026-06-02 22:22:45 +03:00
Miss Islington (bot)
590d8c95b5
[3.13] Fix description of the function parameter of shutil.register_archive_format() (GH-145087) (GH-150806)
(cherry picked from commit 18c6d3ccc3)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2026-06-02 19:20:16 +00:00
Miss Islington (bot)
fa3af11739
[3.13] gh-101913: changed wording of docstring for _parsedate_tz (GH-134446) (#150798)
Fixed incorrect word.
(cherry picked from commit f7e0fb60cf)

Co-authored-by: Gustaf <79180496+gostak-dd@users.noreply.github.com>
Co-authored-by: Gustaf <79180496+GGyll@users.noreply.github.com>
2026-06-02 13:52:09 -04:00
Petr Viktorin
ba785b88ad
[3.13] gh-149079: Fix O(n^2) canonical ordering in unicodedata.normalize() (GH-149080) (#150780)
Replace the insertion sort used for canonical ordering of combining
characters with a hybrid approach: insertion sort for short runs (< 20)
and counting sort for longer runs, reducing worst-case complexity from
O(n^2) to O(n). This prevents denial of service via crafted Unicode
strings with many combining characters in alternating CCC order.
(cherry picked from commit 991224b1e8)

Co-authored-by: Seth Larson <seth@python.org>
Co-authored-by: ch4n3-yoon <ch4n3.yoon@gmail.com>
Co-authored-by: Seokchan Yoon <13852925+ch4n3-yoon@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
2026-06-02 16:12:42 +00:00
Victor Stinner
13d8f452a1
[3.13] gh-89554: Document _thread.LockType as a class (#150684) (#150786)
gh-89554: Document _thread.LockType as a class (#150684)

_thread.LockType is a class (the type of lock objects), but was documented
with the ".. data::" directive, so ":class:" cross-references to it cannot
resolve against a py:class target.

Switch the entry to ".. class::", move it next to the lock methods, and
document acquire(), release() and locked() as methods of the class.  Keep
the old _thread.lock.* URL fragments working with raw HTML anchors.

(cherry picked from commit e37ce56977)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-02 15:13:35 +02:00
Victor Stinner
b8ce8a38d1
[3.13] gh-149738: Fix segmentation fault bug in sqllite3 (#149754) (#150770)
gh-149738: Fix segmentation fault bug in sqllite3 (#149754)

Deleting the `row_factory` or `text_factory` attribute is no longer allowed.

(cherry picked from commit 60fdb3192b)

Co-authored-by: Sepehr Rasouli <sepehrrasouli06@gmail.com>
2026-06-02 14:52:30 +02:00
Manoj K M
3db8872021
[3.13] Fix a typo in 'Exception Handling' C-API documentation (GH-150674)
(cherry picked from commit cee3327b92)
2026-06-02 12:28:12 +01:00
Miss Islington (bot)
7d1998d2d5
[3.13] gh-123138: Updated email.headerregistry docs to include required keyword parse_tree (GH-134450) (GH-150625)
(cherry picked from commit 2c20f9ce17)

Co-authored-by: Gustaf <79180496+gostak-dd@users.noreply.github.com>
2026-06-02 09:26:18 +00:00
Miss Islington (bot)
17bb3eac52
[3.13] gh-89554: Document typing.ParamSpecArgs and ParamSpecKwargs as classes (GH-150677) (GH-150765)
Use the directive "class" instead of "data" for ParamSpecArgs and ParamSpecKwargs.
(cherry picked from commit 35c314d2b7)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-02 08:14:43 +00:00
Miss Islington (bot)
8b9997d82c
[3.13] gh-89554: Document weakref type objects as classes (GH-150678) (GH-150758)
Use the "class" directive instead of "data" for ReferenceType,
ProxyType and CallableProxyType.
(cherry picked from commit 10c421970b)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-02 08:06:04 +00:00
Miss Islington (bot)
c301ea034c
[3.13] gh-89554: Document NoneType, NotImplementedType and EllipsisType as classes (GH-150682) (GH-150757)
Always use the directive and the role "class" instead of "data" for
NoneType, NotImplementedType and EllipsisType.
(cherry picked from commit e40190e104)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-02 08:02:01 +00:00
Miss Islington (bot)
3eab77f28f
[3.13] gh-150644: Tag Apple system log messages as public. (GH-150645) (#150740)
macOS 26 changed the default visibility of "dynamic" system messages. This
changes the logging strategy to tag all messages as "public" so they are
visible in the system log without special configuration.
(cherry picked from commit 71fc4c66d3)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-06-01 22:48:28 +00:00
Miss Islington (bot)
542e01c526
[3.13] gh-148508: Add another common pattern for iOS SSL failures to test_ssl (GH-150442) (#150699)
gh-148508: Add another common pattern for iOS SSL failures to test_ssl (GH-150442)

Match also '[SSL: HTTP_REQUEST] http request (_ssl.c:1143)'.
(cherry picked from commit 540b3d0a7f)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-06-01 22:19:53 +00:00
Miss Islington (bot)
92a1c8bf14
[3.13] gh-148672: Document namespace subpackages inside regular packages (GH-150056) (#150731)
gh-148672: Document namespace subpackages inside regular packages (GH-150056)
(cherry picked from commit 9ba2a89179)

Co-authored-by: Taeknology <20297177+Taeknology@users.noreply.github.com>
2026-06-01 19:29:31 +00:00
Victor Stinner
ff9c8dea8f
[3.13] gh-150436: Skip subprocess test on STATUS_DLL_INIT_FAILED (#150704) (#150721)
gh-150436: Skip subprocess test on STATUS_DLL_INIT_FAILED (#150704)

If a subprocess spawned with CREATE_NEW_CONSOLE creation flag fails
with STATUS_DLL_INIT_FAILED return code, skip the test. It's likely a
memory allocation failure in the desktop heap memory which caused the
DLL init failure.

(cherry picked from commit e8034dd841)
2026-06-01 15:44:54 +00:00
Miss Islington (bot)
62bd651d16
[3.13] gh-150685: update bundled pip to 26.1.2 (gh-150686) (gh-150689) 2026-05-31 21:13:21 +01:00
Senthil Kumaran
66b940c2f1
[3.13] gh-141444:fix broken URLs and examples in urllib.request.rst (GH-144863) (#150647)
* Doc: fix broken URLs and examples in urllib.request.rst (gh-141444)

* Doc: update urllib.request examples to handle gzip compression

---------
(cherry picked from commit 0f1f7c7889)

Co-authored-by: Paper Moon <tangyuan0821@email.cn>
2026-05-31 12:57:53 -07:00
Miss Islington (bot)
ca2fdca948
[3.13] Clarify docs for scheduler.run(blocking=False) (GH-129575) (GH-150670)
(cherry picked from commit 2f8f569ba9)

Co-authored-by: M. Greyson Christoforo <grey@christoforo.net>
2026-05-31 12:18:09 +00:00
Miss Islington (bot)
e10a8ba821
[3.13] gh-150636: Clarify difference between copy.copy() and the copy() methods (GH-150637) (GH-150667)
(cherry picked from commit 1de909b324)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-05-31 12:15:28 +00:00
Miss Islington (bot)
ac0fe8a757
[3.13] gh-150372: Add missing null check on completer_word_break_characters in readline.c (GH-150251) (GH-150630)
(cherry picked from commit 56bd9ea676)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
2026-05-31 14:59:05 +03:00
Sergey B Kirpichev
70a4e191e6
[3.13] Correct frexp() docs for zero and non-finite numbers (GH-149753) (GH-150654)
0.5 <= abs(m) < 1 is only true for finite nonzero numbers
(cherry picked from commit 5b5ffce05c)
2026-05-31 07:58:24 +00:00
Miss Islington (bot)
7afe574643
[3.13] gh-117291: Explain usage of null bytes in Array(c_char).value (GH-117292) (GH-150651)
(cherry picked from commit 73d8e9a47c)

Co-authored-by: Patrick Rauscher <prauscher@prauscher.de>
2026-05-31 07:27:33 +00:00
Miss Islington (bot)
42f3fbf595
[3.13] gh-149857: Clarify multiprocessing Process argument wording (GH-149919) (#149935)
gh-149857: Clarify multiprocessing Process argument wording (GH-149919)

Use consistent 'picklable' wording
(cherry picked from commit 1bab6c9192)

Co-authored-by: Mani Salahmand <78011313+ManiSalahmand@users.noreply.github.com>
2026-05-31 04:22:18 +00:00
Miss Islington (bot)
8494bcf69e
[3.13] gh-129851: Fix the documentation for -m command (GH-129862) (GH-150619) (GH-150620)
[3.14] gh-129851: Fix the documentation for -m command (GH-129862) (GH-150619)

(cherry picked from commit 9baa7c63be)
(cherry picked from commit 088c8ea188)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Dhruv Singla <68206552+d-s-dc@users.noreply.github.com>
2026-05-30 20:44:52 +03:00
Miss Islington (bot)
4d91835af5
[3.13] gh-150406: Check result of PyThread_allocate_lock() for netdb_lock (GH-150407) (GH-150618)
(cherry picked from commit 1e18c45495)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
2026-05-30 19:56:46 +03:00
Miss Islington (bot)
b46df7fe42
[3.13] gh-149489: Fix ElementTree serialization to HTML (GH-149490) (GH-150596) (GH-150609)
* The content of elements "xmp", "iframe", "noembed", "noframes",
  and "plaintext" is no longer escaped.
* The "plaintext" element no longer have the closing tag.
(cherry picked from commit c42e6d3f1a)


(cherry picked from commit bcd29e466f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-05-30 11:16:32 +00:00
Miss Islington (bot)
3a15d1602a
[3.13] gh-150501: Correct inspect.getattr_static docs signature (GH-150504) (#150603)
gh-150501: Correct `inspect.getattr_static` docs signature (GH-150504)
(cherry picked from commit 678fd8452c)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
2026-05-30 09:26:59 +00:00
Miss Islington (bot)
6e9da0919c
[3.13] Add a security warning about pydoc's HTTP server (GH-150409)
(cherry picked from commit 5535c1f9c0)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-05-29 20:08:16 +01:00
Miss Islington (bot)
ad3a39654f
[3.13] gh-150107: Fix asyncio sendfile fallback ignoring non-zero offset (GH-150270) (#150571)
gh-150107: Fix asyncio sendfile fallback ignoring non-zero offset (GH-150270)
(cherry picked from commit c72d5ea638)

Co-authored-by: Grant Herman <grantlouisherman041@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-05-29 18:40:40 +05:30