Commit graph

27904 commits

Author SHA1 Message Date
Bénédikt Tran
ea8a85bb9e
[3.12] Link to correct class methods in asyncio primitives docs (GH-127270) (#127438) 2024-11-30 10:02:07 +00:00
Miss Islington (bot)
91399c3984
[3.12] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127391)
gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304)

---------

(cherry picked from commit dd3a87d2a8)

Co-authored-by: Илья Любавский <100635212+lubaskinc0de@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-11-29 09:22:27 +00:00
Yuki Kobayashi
16e899d589
[3.12] gh-101100: Fix sphinx warnings in howto/* (GH-127084) (#127311) 2024-11-27 11:46:42 +02:00
Miss Islington (bot)
619037af1c
[3.12] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127268)
(cherry picked from commit 26ff32b305)

Co-authored-by: funkyrailroad <funkyrailroad@users.noreply.github.com>
2024-11-25 21:42:34 +00:00
Rafael Fontenelle
3806772b3d
[3.12] Fix a few typos found in the docs (GH-127126) (GH-127185)
(cherry picked from commit 39e60aeb38)
2024-11-25 11:48:00 -08:00
Yuki Kobayashi
7e901cbdd8
[3.12] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127240) 2024-11-25 10:51:48 +02:00
Miss Islington (bot)
b52ab48a10
[3.12] Improve pathname2url() and url2pathname() docs (GH-127125) (#127233)
Improve `pathname2url()` and `url2pathname()` docs (GH-127125)

These functions have long sown confusion among Python developers. The
existing documentation says they deal with URL path components, but that
doesn't fit the evidence on Windows:

    >>> pathname2url(r'C:\foo')
    '///C:/foo'
    >>> pathname2url(r'\\server\share')
    '////server/share'  # or '//server/share' as of quite recently

If these were URL path components, they would imply complete URLs like
`file://///C:/foo` and `file://////server/share`. Clearly this isn't right.
Yet the implementation in `nturl2path` is deliberate, and the
`url2pathname()` function correctly inverts it.

On non-Windows platforms, the behaviour until quite recently is to simply
quote/unquote the path without adding or removing any leading slashes. This
behaviour is compatible with *both* interpretations -- 1) the value is a
URL path component (existing docs), and 2) the value is everything
following `file:` (this commit)

The conclusion I draw is that these functions operate on everything after
the `file:` prefix, which may include an authority section. This is the
only explanation that fits both the  Windows and non-Windows behaviour.
It's also a better match for the function names.
(cherry picked from commit 307c633586)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-11-24 17:48:12 +00:00
Miss Islington (bot)
6d2821c833
[3.12] Doc: C API: Fix Py_NewInterpreterFromConfig example code (GH-126667) (#127202)
Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667)
(cherry picked from commit e3038e976b)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2024-11-23 19:55:55 +00:00
Serhiy Storchaka
29648980d4
[3.12] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH-127158)
* Name without a PATHEXT extension is only searched if the mode does not
  include X_OK.
* Support multi-component PATHEXT extensions (e.g. ".foo.bar").
* Support files without extensions in PATHEXT contains dot-only extension
  (".", "..", etc).
* Support PATHEXT extensions that end with a dot (e.g. ".foo.").
(cherry picked from commit 8899e85de1)
2024-11-22 16:33:50 +00:00
Miss Islington (bot)
32bc8e83db
[3.12] GH-122679: Add register() to argparse docs (GH-126939) (GH-127148)
(cherry picked from commit fcfdb55465)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-11-22 14:13:43 +00:00
Jun Komoda
caad9047cb
[3.12] gh-127082: Replace "Windows only" with the availability: Windows in ctypes doc (GH-127099) (#127145)
(cherry picked from commit 3c770e3f09)
2024-11-22 14:08:37 +01:00
Serhiy Storchaka
4b4e0dbdf4
[3.12] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127098)
It now returns multiple era description segments separated by semicolons.
Previously it only returned the first segment on platforms with Glibc.
(cherry picked from commit 4803cd0244)
2024-11-21 11:44:37 +00:00
Miss Islington (bot)
cb98122df2
[3.12] Update docs 'make serve' to suggest 'make htmllive' (GH-126969) (#127016)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-11-19 17:41:41 +02:00
Miss Islington (bot)
797a6327cc
[3.12] Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659) (#126889)
Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
(cherry picked from commit d6bcc154e9)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2024-11-15 23:17:37 +00:00
Miss Islington (bot)
ef0a0059e1
[3.12] gh-123832: Adjust socket.getaddrinfo docs for better POSIX compliance (GH-126182) (GH-126824)
gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH-126182)

* gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance

This changes nothing changes for CPython supported platforms,
but hints how to deal with platforms that stick to the letter of
the spec.
It also marks `socket.getaddrinfo` as a wrapper around `getaddrinfo(3)`;
specifically, workarounds to make the function work consistently across
platforms are out of scope in its code.

Include wording similar to the POSIX's “by providing options and by
limiting the returned information”, which IMO suggests that the
hints limit the resulting list compared to the defaults, *but* can
be interpreted differently. Details are added in a note.

Specifically say that this wraps the underlying C function. So, the
details are in OS docs. The “full range of results” bit goes away.

Use `AF_UNSPEC` rather than zero for the *family* default, although
I don't think a system where it's nonzero would be very usable.

Suggest setting proto and/or type (with examples, as the appropriate
values aren't obvious). Say why you probably want to do that that
on all systems; mention the behavior on the “letter of the spec”
systems.

Suggest that the results should be tried in order, which is,
AFAIK best practice -- see RFC 6724 section 2, and its predecessor
from 2003 (which are specific to IP, but indicate how people use this):

> Well-behaved applications SHOULD iterate through the list of
> addresses returned from `getaddrinfo()` until they find a working address.

(cherry picked from commit ff0ef0a54b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-11-15 14:07:04 +01:00
Miss Islington (bot)
d79acd96e0
[3.12] Document that return-less user-defined functions return None (GH-126769) (#126823)
Document that return-less user-defined functions return None (GH-126769)
(cherry picked from commit e0692f1165)

Co-authored-by: John Marshall <jmarshall@hey.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-11-14 10:46:26 +01:00
Miss Islington (bot)
3ed99b3eb3
[3.12] gh-126731: Update outdated project information in pprint.pp doc (GH-126732) (#126819)
gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732)
(cherry picked from commit 6a93a1adbb)

Co-authored-by: Wulian <xiguawulian@gmail.com>
2024-11-14 05:08:18 +00:00
Ned Batchelder
73dedbd223
[3.12] Docs: re-create pages for removed modules to document their removal, based on GH-126622 (#126781)
[3.12] Docs: re-create pages for removed modules to document their removal, based on #126622
2024-11-13 19:02:09 -05:00
Miss Islington (bot)
5cd35fb8e0
Update documentation links to Microsoft's documentation pages (GH-126379)
(cherry picked from commit 6e25eb1541)

Co-authored-by: 谭九鼎 <109224573@qq.com>
2024-11-11 17:20:33 +00:00
Miss Islington (bot)
75d251bb04
[3.12] Add missing fullstop . to whatsnew/3.8.rst (GH-126553) (#126673)
Add missing fullstop `.` to whatsnew/3.8.rst (GH-126553)
(cherry picked from commit 82269c7d58)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-11-11 07:08:37 +00:00
Miss Islington (bot)
fb82e10ce4
[3.12] gh-126664: Use else instead of finally in "The with statement" documentation. (GH-126665) (#126671)
gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665)
(cherry picked from commit 25257d61cf)

Co-authored-by: vivodi <103735539+vivodi@users.noreply.github.com>
2024-11-11 06:57:15 +00:00
Miss Islington (bot)
55c5305690
[3.12] gh-126543: Docs: change "bound type var" to "bounded" when used in the context of the 'bound' kw argument to TypeVar (GH-126584) (#126658)
(cherry picked from commit 434b29767f)

Co-authored-by: Pedro Fonini <fonini@protonmail.ch>
2024-11-10 18:52:20 -08:00
Miss Islington (bot)
61e6f0992f
[3.12] Postpone module.__loader__ deprecation to Python 3.16 (GH-126482) (#126637)
Postpone `module.__loader__` deprecation to Python 3.16 (GH-126482)
(cherry picked from commit 450db61a78)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-11-10 00:57:54 +00:00
Miss Islington (bot)
69849ad288
gh-125298: Remove misleading text in os.kill documentation (GH-125749)
Windows has not accepted process handles in many releases.
(cherry picked from commit 75ffac296e)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
2024-11-08 15:47:46 +00:00
Miss Islington (bot)
a0866f4c81
[3.12] Doc: C API: Demote sections to subsections for consistency (GH-126535) (#126545)
Doc: C API: Demote sections to subsections for consistency (GH-126535)

The entire file should be a single section; the headings below the
first heading should be subsections.
(cherry picked from commit e3510bd3dd)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2024-11-07 15:38:57 +00:00
Miss Islington (bot)
aa5498d466
[3.12] Doc: C API: Delete claim that PyObject_Init is GC-aware (GH-126418) (#126432)
Doc: C API: Delete claim that `PyObject_Init` is GC-aware (GH-126418)
(cherry picked from commit 407c0366d9)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2024-11-05 15:31:37 +05:30
Hugo van Kemenade
94423b6be1
[3.12] gh-101865: Docs: Keep co_lnotab deprecation for at least 3.14 (GH-126392) (#126404)
(cherry picked from commit eac41c5ddf)
2024-11-04 19:47:40 +02:00
Miss Islington (bot)
70f777daea
[3.12] Docs: turn getopt examples into doctests (GH-126377) (#126386)
(cherry picked from commit 0d80777981)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-11-04 08:37:23 +00:00
Miss Islington (bot)
d1b8718934
[3.12] gh-126165: Improve docs of function math.isclose (GH-126215) (#126381)
gh-126165: Improve docs of function `math.isclose` (GH-126215)
(cherry picked from commit 081706f873)

Co-authored-by: Zhikang Yan <2951256653@qq.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-11-04 04:16:35 +00:00
Miss Islington (bot)
37dc2b2bbb
[3.12] Docs: Delist sqlite3 deprecation from "Pending removal in 3.14" (GH-126370) (#126373)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-11-03 21:31:59 +00:00
Miss Islington (bot)
f4bc64d204
[3.12] gh-125761: Clarify repeated warning suppression criteria in warnings module (gh-126331)
(cherry picked from commit 10eeec2d4f)

Co-authored-by: 고병찬 <70642609+byungchanKo99@users.noreply.github.com>
2024-11-02 11:45:36 +00:00
Miss Islington (bot)
8d4ef52802
[3.12] docs: add a more precise example in enum doc (GH-121015) (#126307)
docs: add a more precise example in enum doc (GH-121015)

* docs: add a more precise example

Previous example used manual integer value assignment in class based declaration but in functional syntax has been used auto value assignment what could be confusing for the new users. Additionally documentation doesn't show how to declare new enum via functional syntax with usage of the manual value assignment.

* docs: remove whitespace characters

* refactor: change example

---------

(cherry picked from commit ff257c7843)

Co-authored-by: Filip "Ret2Me" Poplewski <37419029+Ret2Me@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2024-11-01 16:18:00 -07:00
Miss Islington (bot)
ce5bb3ca85
[3.12] gh-123609: Clarify usage of standalone PyBUF_FORMAT (GH-123778) (GH-123904)
gh-123609: Clarify usage of standalone `PyBUF_FORMAT` (GH-123778)
(cherry picked from commit 962304a54c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-11-01 12:38:23 -07:00
Miss Islington (bot)
479e366ce3
[3.12] Docs: make a tutorial example more precise (GH-125066) (GH-125079)
Docs: make a tutorial example more precise (GH-125066)

Based on discussion here:

(cherry picked from commit 6e3c70c61b)


https: //discuss.python.org/t/omission-in-the-documentation/66816

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-11-01 12:36:51 -07:00
Miss Islington (bot)
d268bd04e9
[3.12] gh-122767: document "new style" formatting for complexes (GH-122848) (#126129)
gh-122767: document "new style" formatting for complexes (GH-122848)

(cherry picked from commit 0bbbe15f56)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-11-01 12:29:53 -07:00
Miss Islington (bot)
e8ce872191
[3.12] gh-126259: Fix "unclosed database" warning in sqlite3 doctest (GH-126260) (#126266)
(cherry picked from commit 295262c8ec)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-11-01 07:25:51 +00:00
Miss Islington (bot)
975911887d
[3.12] gh-125818: Fix incorrect signature of argument skip_file_prefixes in warnings docs (GH-125823) (GH-126217)
gh-125818: Fix incorrect signature of argument `skip_file_prefixes` in warnings docs (GH-125823)

Change documentation
(cherry picked from commit d467d9246c)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
2024-10-30 18:31:35 -07:00
Prometheus3375
6bfe5fbc19
[3.12] gh-116633: Add a note about buggy behavior of csv.QUOTE_NOTNULL and csv.QUOTE_STRINGS (GH-117235)
* Add a note about bug

* Properly link constants
2024-10-30 17:08:28 -07:00
Rafael Fontenelle
3ef8a3a900
[3.12]: gh-103484: Relink _xxsubinterpretersmodule.c in whatsnew/3.12.rst (GH-124183)
Relink _xxsubinterpretersmodule.c in whatsnew/3.12.rst
2024-10-30 13:46:13 -07:00
Miss Islington (bot)
a089adfb53
[3.12] Prefer "similar" over "equivalent" in tutorial (GH-125343) (GH-125373)
Prefer "similar" over "equivalent" in tutorial (GH-125343)

In the datastructures tutorial doc, some operations are described as
"equivalent to" others. This has led to some user-confusion -- at
least in the Discourse forums -- about cases in which the operations
differ.

This change doesn't systematically eliminate the word "equivalent"
from the tutorial. It just substitutes "similar to" in several cases
in which "equivalent to" could mislead users into expecting exact
equivalence.
(cherry picked from commit 4a2282b067)

Co-authored-by: Stephen Rosen <sirosen@globus.org>
2024-10-30 13:34:13 -07:00
Miss Islington (bot)
bda8190b89
[3.12] gh-60712: Include the "object" type in the lists of documented types (GH-103036) (GH-126198)
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:15:24 -07:00
Miss Islington (bot)
f2315ee175
[3.12] gh-126055: Add omitted command (in docs [os.walk]) for code to fulfill shutil.rmtree algorithm (GH-126067) (GH-126200)
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:14:27 -07:00
Miss Islington (bot)
76c800f751
[3.12] Fix incorrect indentation in importlib.metadata.rst (GH-126189) (GH-126194)
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:01:39 -07:00
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
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
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)
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