Commit graph

13606 commits

Author SHA1 Message Date
Miss Islington (bot)
aef7edaf23
[3.13] gh-123726: Document caveats of zipfile.Path around name sanitization (GH-130537) (#130986)
gh-123726: Document caveats of zipfile.Path around name sanitization (GH-130537)

Add a note to the `zipfile.Path` class documentation clarifying that it does not sanitize filenames. This emphasizes the caller's responsibility to validate or sanitize inputs, especially when handling untrusted ZIP archives, to prevent path traversal vulnerabilities. The note also references the `extract` and `extractall` methods for comparison and suggests using `os.path.abspath` and `os.path.commonpath` for safe filename resolution.
(cherry picked from commit a3990df612)

Co-authored-by: Affan Shaikhsurab <51104750+AffanShaikhsurab@users.noreply.github.com>
2025-03-08 21:43:12 +00:00
Miss Islington (bot)
ab749678e5
[3.13] Update links from typing.readthedocs.io to typing.python.org (GH-130877) (#130883)
Update links from typing.readthedocs.io to typing.python.org (GH-130877)
(cherry picked from commit 4f6218959e)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2025-03-05 15:34:17 +00:00
Miss Islington (bot)
418021e229
[3.13] gh-129567: Add a note to typing.TypedDict docs about name mangling (GH-130233) (#130841)
gh-129567: Add a note to `typing.TypedDict` docs about name mangling (GH-130233)
(cherry picked from commit 63ffb406bb)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-03-04 15:21:11 +00:00
Miss Islington (bot)
57dcbfd7da
[3.13] Docs: Fix a misplaced statement in the document for ServerProxy (GH-130616) (GH-130640)
Docs: Fix a misplaced statement in the document for `ServerProxy` (GH-130616)

The sentence "If an HTTPS URL ..." explains what the parameter means,
so moved it to the paragraph explaining what the other parameters mean.
(cherry picked from commit b26286ca49)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-03-03 15:09:26 +01:00
Miss Islington (bot)
36e696738b
[3.13] gh-101100: Fix sphinx warnings in library/email.errors.rst (GH-130774) (#130781)
gh-101100: Fix sphinx warnings in `library/email.errors.rst` (GH-130774)
(cherry picked from commit a105f99019)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-03-03 12:04:51 +02:00
Miss Islington (bot)
f51a7483f5
[3.13] gh-101100: Fix Sphinx documentation warnings in collections.rst (GH-130629) (#130779)
gh-101100: Fix Sphinx documentation warnings in `collections.rst` (GH-130629)
(cherry picked from commit 373eb1b47a)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
2025-03-03 09:57:28 +00:00
Miss Islington (bot)
e96f914328
[3.13] gh-129015: Improve disambiguation between NotImplemented and NotImplementedError (GH-129562) (#130776)
gh-129015: Improve disambiguation between `NotImplemented` and `NotImplementedError` (GH-129562)

---------

(cherry picked from commit a85eeb9771)

Co-authored-by: Mike Castle <dalgoda+github@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-03 08:29:29 +00:00
Miss Islington (bot)
3bef4af301
[3.13] gh-128481: indicate that the default value for FrameSummary.end_lineno changed in 3.13 (GH-130755) (#130767)
gh-128481: indicate that the default value for `FrameSummary.end_lineno` changed in 3.13 (GH-130755)

The value taken by `FrameSummary.end_lineno` when passing `end_lineno=None` changed in gh-112097.

Previously, a `end_lineno` could be specified to be `None` directly but since 939fc6d, passing None makes
the constructor use the value of `lineno` instead.
(cherry picked from commit c6513f7a62)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-02 17:22:48 +00:00
Miss Islington (bot)
ff14c1e7a9
[3.13] Add link in the importlib.metadata.version() docs (GH-130739) (#130761)
Add link in the `importlib.metadata.version()` docs (GH-130739)

Link the specification for the returned data makes it clearer what this is
and what the format of the version string can be.
(cherry picked from commit c71e55869e)

Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
2025-03-02 10:42:15 +00:00
Miss Islington (bot)
dca599eaad
[3.13] gh-128481: Improve documentation for traceback.FrameSummary (GH-128484) (#130753)
* gh-128481: Improve documentation for `traceback.FrameSummary` (GH-128484)

Complete the `traceback.FrameSummary` signature and add missing
documentation for the `colno` and `end_{col,line}no` attributes.
(cherry picked from commit 051f0e5683)

Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
2025-03-02 09:48:30 +00:00
Miss Islington (bot)
8edf17f260
[3.13] gh-130160: use .. program:: directive for documenting cProfile CLI (GH-130314) (#130745)
gh-130160: use `.. program::` directive for documenting `cProfile` CLI (GH-130314)
(cherry picked from commit 5181ddb29f)

Co-authored-by: Apostol Fet <90645107+ApostolFet@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-01 20:45:33 +00:00
Miss Islington (bot)
75358a8e95
[3.13] Docs: Fix some semantic usages of iterator.__iter__ (GH-130172) (GH-130543)
These references to an `__iter__` method mean `object.__iter__`, not `iterator.__iter__`.
(cherry picked from commit 4d3a7ea354)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-02-26 11:02:53 +01:00
Miss Islington (bot)
3d64fd8896
[3.13] gh-130433: Update documentation for MultipartConversionError (GH-130436) (GH-130565)
(cherry picked from commit b536e37104)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-02-26 09:59:12 +01:00
Kanishk Pachauri
28bfc1c996
[3.13] gh-130461: Remove unnecessary usages of .. index:: directives in Doc/library/uuid.rst (#130526) (#130548)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-02-25 15:24:46 +02:00
Miss Islington (bot)
3161f01760
[3.13] gh-46236: Add docs for PyUnicode_GetDefaultEncoding() doc (GH-130335) (GH-130511)
* Clarify sys.getdefaultencoding() documentation

* Add missing documentation for PyUnicode_GetDefaultEncoding,
  the C equivalent of sys.getdefaultencoding
(cherry picked from commit 9f25c1f012)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
2025-02-24 17:10:17 +01:00
Miss Islington (bot)
10dd9725b8
[3.13] gh-127522: wsgiref: indicate that start_response objects should follow a specific protocol (GH-127525) (GH-130504)
(cherry picked from commit 39ba4b6619)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-02-24 15:08:07 +01:00
Miss Islington (bot)
bbfae4a912
[3.13] gh-127805: Clarify Formatter initialization in logging.rst. (GH-127850) (#130392)
(cherry picked from commit 5d66c55c8a)

Co-authored-by: UV <yuvrajpradhan667@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-24 07:23:16 +02:00
Miss Islington (bot)
766170405e
[3.13] gh-130160: use .. program:: directive for documenting idle CLI (GH-130278) (#130494)
gh-130160: use `.. program::` directive for documenting `idle` CLI (GH-130278)

---------




(cherry picked from commit 0ff1611574)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
2025-02-23 22:58:28 -05:00
Miss Islington (bot)
c68a8722be
[3.13] gh-121970: Replace .. coroutine{method,function} with :async: (GH-130448) (#130465)
(cherry picked from commit 5ec4bf86b7)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-22 18:00:49 +00:00
Miss Islington (bot)
27a28eef87
[3.13] Add measuring unit to sys.getswitchinterval docs (GH-130457) (#130458)
Add measuring unit to `sys.getswitchinterval` docs (GH-130457)
(cherry picked from commit 89d8b2d14b)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-02-22 16:12:45 +00:00
Adam Turner
c7d6aa5b51
[3.13] GH-121970: Replace custom abstract method directive with the `:abstract:` option (#129311) (#130439)
(cherry picked from commit 30e892473e)
2025-02-22 02:04:54 +00:00
Miss Islington (bot)
bb4cd89d7a
[3.13] gh-130159: Fix list indentation in collections.abc (GH-130165) (#130437)
gh-130159: Fix list indentation in collections.abc (GH-130165)
(cherry picked from commit 8e96adf453)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-02-22 01:47:18 +00:00
Miss Islington (bot)
8db3eee4cd
[3.13] gh-124234: Improve docs for Mock.reset_mock (GH-124237) (#130408)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-02-21 14:58:08 +00:00
sobolevn
2a978e16d6
[3.13] Add .. versionadded directive to dis CLI options (GH-130267) (#130401)
(cherry picked from commit 9bf73c032f)
2025-02-21 13:14:27 +00:00
Miss Islington (bot)
c05d0d8425
[3.13] gh-101100: Fix sphinx warnings in readline.rst (GH-130300) (#130346)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-02-20 15:06:33 +02:00
Miss Islington (bot)
178b2ec81f
[3.13] Fix some ctypes docs typos (GH-130307) (GH-130343)
Fix some ctypes docs typos (GH-130307)
(cherry picked from commit 417372bd43)

Co-authored-by: Alcaro <floating@muncher.se>
2025-02-20 11:05:23 +00:00
Miss Islington (bot)
6041dba911
[3.13] gh-130130: Clarify hash=False docs in dataclasses.field (GH-130324) (#130337)
gh-130130: Clarify `hash=False` docs in `dataclasses.field` (GH-130324)
(cherry picked from commit 47ace53995)

Co-authored-by: Sabfo <alpha.sabfo@gmail.com>
2025-02-20 07:51:39 +00:00
Miss Islington (bot)
d172415a4e
[3.13] gh-130250: fix regression in traceback.print_last (GH-130318) (#130325)
gh-130250: fix regression in traceback.print_last (GH-130318)
(cherry picked from commit 6c982aeb54)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-02-19 22:06:43 +00:00
sobolevn
57e8b0cbee
[3.13] gh-130160: use option instead of cmdoption in dis.rst (GH-130255) (#130264)
(cherry picked from commit 97d0011e7e)
2025-02-18 13:55:30 +00:00
Miss Islington (bot)
a273543444
[3.13] gh-130160: use .. program:: directive for documenting ensurepip CLI (gh-130253) (gh-130259)
gh-130160: use `.. program::` directive for documenting `ensurepip` CLI (gh-130253)
(cherry picked from commit 8cd7f8bf8d)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
2025-02-18 12:51:33 +00:00
Stan Ulbrych
320316ef7e
[3.13] gh-82045: Correct and deduplicate "isprintable" docs; add test. (GH-130127)
We had the definition of what makes a character "printable" documented in three places, giving two different definitions.
The definition in the comment on `_PyUnicode_IsPrintable` was inverted; correct that.

With that correction, the two definitions turn out to be equivalent -- but to confirm that, you have to go look up, or happen to know, that those are the only five "Other" categories and only three "Separator" categories in the Unicode character database.  That makes it hard for the reader to tell whether they really are the same, or if there's some subtle difference in the intended semantics.

Fix that by cutting the C API docs' and the C comment's copies of the subtle details, in favor of referring to the Python-level docs. That ensures it's explicit that these are all meant to agree, and also lets us concentrate improvements to the wording in one place.

Speaking of which, borrow some ideas from the C comment, along with other tweaks, to hopefully add a bit more clarity to that one newly-centralized copy in the docs.

Also add a thorough test that the implementation agrees with this definition.

Author:    Greg Price <gnprice@gmail.com>

Co-authored-by: Greg Price <gnprice@gmail.com>
(cherry picked from commit 3402e133ef)
2025-02-17 15:02:39 +01:00
Miss Islington (bot)
e5ee784a7c
[3.13] gh-130106: Fix a typo in unittest.mock doc (GH-130107) (#130143)
gh-130106: Fix a typo in unittest.mock doc (GH-130107)
(cherry picked from commit d2e60d8e59)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
2025-02-15 03:37:05 +00:00
Andrew Svetlov
7b0543ebe6
[3.13] gh-128308: pass **kwargs to asyncio task_factory (GH-128768) (#130084)
* [3.13] gh-128308: pass `**kwargs` to asyncio task_factory (GH-128768)
(cherry picked from commit 38a9956876)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>


---------

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-02-14 22:04:17 +05:30
Miss Islington (bot)
36790830cb
[3.13] gh-101100: Docs: Fix some typos in the document (GH-129988) (#129997)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-11 21:37:25 +00:00
Miss Islington (bot)
e5c522e895
[3.13] gh-97850: Update the deprecation warning of importlib.abc.Loader.load_module (GH-129855) (GH-130013)
gh-97850: Update the deprecation warning of `importlib.abc.Loader.load_module` (GH-129855)
(cherry picked from commit aa81a6f6e4)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-02-11 19:28:25 +00:00
Miss Islington (bot)
a00f5a84fd
[3.13] gh-129143: Fix incorrect documentation for logging.Handler.close(). (GH-129950) (GH-129951)
(cherry picked from commit 7c156a63d3)
2025-02-10 11:26:50 +00:00
Miss Islington (bot)
f7d885a8ff
[3.13] gh-129873: IDLE: Improve help.py's method of parsing HTML (GH-129859) (#129884)
gh-129873: IDLE: Improve help.py's method of parsing HTML (GH-129859)

In `help.copy_strip`, only copy the text `<section>`.  In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html.  Add a reminder at the top of idle.rst to run copy_strip after changes.
---------

(cherry picked from commit 6fbf15f98e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-02-09 04:19:36 -05:00
Miss Islington (bot)
3cf859056a
[3.13] gh-129699: Add description to IDLE doc title (GH-129727) (#129864)
gh-129699: Add description to IDLE doc title (GH-129727)

Also extend the 'idlelib' section header. These additions affect both the displayed idle.html file and the contents.html file displayed by clicking the Complete table of contents link on the main docs.python.org page. (The module index entries are generated from the module name and synopsis within module files.)
---------

(cherry picked from commit 33a7094aa6)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-02-08 20:14:47 +00:00
Miss Islington (bot)
9497e9d77d
[3.13] gh-64414: mention AF_INET6 and IPv6 in socketserver docs. (GH-129866) (#129868)
gh-64414: mention AF_INET6 and IPv6 in socketserver docs. (GH-129866)

mention AF_INET6 and IPv6 in socketserver docs.
(cherry picked from commit 5ce70ad129)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-02-08 20:12:22 +00:00
Miss Islington (bot)
aae0a1f904
[3.13] Add multinomial to the itertools recipes docs (gh-129760) (gh-129762) 2025-02-06 18:45:15 -06:00
Miss Islington (bot)
de84531a3e
[3.13] gh-112020: Rework socketserver examples to be correct (GH-129741) (#129743)
gh-112020: Rework socketserver examples to be correct.

Outdated code updated, the BaseRequestHandler example is now much more
illustrative instead of the bad idea of a single recv() call for TCP.

tested, they now work.
(cherry picked from commit 78377c788e)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-02-06 17:49:19 +00:00
Miss Islington (bot)
0f7e6d78ea
[3.13] Remove an inaccurate note from socket.recv (GH-129733) (#129734)
Remove an inaccurate note from `socket.recv` (GH-129733)

Remove an inaccurate note from socket.recv.
(cherry picked from commit ded54c3baa)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-02-06 09:45:28 -08:00
Serhiy Storchaka
4cf3e80eee
[3.13] Use roles :data: and :const: for referencing module variables (GH-129507) (GH-129649)
(cherry picked from commit 078ab828b9)
2025-02-04 14:25:18 +00:00
Miss Islington (bot)
646bd7958e
[3.13] gh-128696: Add arm64 to the get_platform return val description (GH-128701) (#128774)
gh-128696: Add arm64 to the get_platform return val description (GH-128701)
(cherry picked from commit 553cdc6d68)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
2025-02-03 23:56:23 +00:00
Miss Islington (bot)
85e162087f
[3.13] gh-129407: Clarify that a SystemError isn't always CPython's fault (GH-129410) (#129610)
gh-129407: Clarify that a `SystemError` isn't always CPython's fault (GH-129410)
(cherry picked from commit 39b754a359)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-02-03 11:52:29 +00:00
Miss Islington (bot)
332426b4af
[3.13] gh-85046: Document errno constants (GH-126420) (#129383)
(cherry picked from commit 1c3bb200da)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
2025-01-28 00:19:06 +00:00
Miss Islington (bot)
eed7865cee
[3.13] gh-97850: Remove the mention of removal from ResourceReader docs (GH-128602) (#128654)
gh-97850: Remove the mention of removal from `ResourceReader` docs (GH-128602)

Remove the mention of removal from ResourceReader docs
(cherry picked from commit a1284e9797)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-23 22:17:32 +01:00
Miss Islington (bot)
080d17e945
[3.13] gh-129020: Remove ambiguous sentence from tokenize.untokenize docs (GH-129021) (#129035)
gh-129020: Remove ambiguous sentence from `tokenize.untokenize` docs (GH-129021)
(cherry picked from commit bca35f0e78)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-01-20 00:11:27 +00:00
Miss Islington (bot)
b7ddcc3efb
[3.13] gh-121542: Document trailing newline behavior in set_content() (GH-121543) (#128995)
gh-121542: Document trailing newline behavior in `set_content()` (GH-121543)
(cherry picked from commit fba475ae6f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Yizheng Meng <dev@rapidcow.org>
2025-01-18 18:40:30 +00:00
Miss Islington (bot)
fff334e538
[3.13] gh-125997: suggest efficient alternatives for time.sleep(0) (GH-128752) (#128984)
gh-125997: suggest efficient alternatives for `time.sleep(0)` (GH-128752)
(cherry picked from commit f4afaa6f11)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-01-18 11:08:42 +00:00