Commit graph

13098 commits

Author SHA1 Message Date
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)
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)
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)
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)
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)
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)
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
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
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
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)
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)
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)
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)
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)
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)
1cab726622
[3.12] gh-89819: Add argument_default and conflict_handler to add_argument_group() docs (GH-125379) (GH-125539)
(cherry picked from commit c9826c11db)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-15 16:09:55 +00:00
Miss Islington (bot)
449f2c98bd
[3.12] gh-85453: Improve variable mark up for datetime.rst (GH-120702) (#125491)
Variables and literals are marked up using backticks.
(cherry picked from commit 2a5cdb2516)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-10-14 22:09:23 +00:00
Miss Islington (bot)
20323bf733
[3.12] gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426) (#125429)
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
(cherry picked from commit cfc27bc50f)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-14 04:51:59 +00:00
Miss Islington (bot)
1d45fae26d
[3.12] gh-125289: Update sample code in asyncio-task.rst (GH-125292) (GH-125375)
gh-125289: Update sample code in asyncio-task.rst (GH-125292)

* Update sample code in asyncio-task.rst

This will change **coroutines** sample code in the **Awaitables** section and make the example clearer.

* Update Doc/library/asyncio-task.rst

Revert the added print



* Update Doc/library/asyncio-task.rst



---------

(cherry picked from commit fa52b82c91)

Co-authored-by: Ghorban M. Tavakoly <58617996+galmyk@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-12 20:44:41 +00:00
Miss Islington (bot)
e01a1784db
[3.12] gh-85935: Explicitly document the case nargs=0 in argparse (GH-125302) (GH-125358)
(cherry picked from commit 07c2d15977)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-12 16:02:14 +03:00
Miss Islington (bot)
3f38ea11c0
[3.12] gh-116938: Clarify documentation of dict and dict.update regarding the positional argument they accept (GH-125213) (#125337)
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-11 23:23:54 +00:00
Miss Islington (bot)
7c48c63021
[3.12] Add some doctest cleanups for configparser (GH-125288) (#125291)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-11 09:52:15 +00:00
Miss Islington (bot)
4c40381023
[3.12] gh-125058: update _thread docs regarding interruptibility of lock.acquire() (GH-125141) (#125307)
gh-125058: update `_thread` docs regarding interruptibility of `lock.acquire()` (GH-125141)
(cherry picked from commit 0135848059)

Co-authored-by: Jan Kaliszewski <zuo@kaliszewski.net>
2024-10-11 08:22:34 +00:00
Miss Islington (bot)
ee1257cb9c
[3.12] gh-125296: Fix strange fragment identifier for name or flags in argparse docs (GH-125297) (#125300)
gh-125296: Fix strange fragment identifier for `name or flags` in argparse docs (GH-125297)
(cherry picked from commit c1913effee)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-11 06:39:54 +00:00
Miss Islington (bot)
171ebcd4df
[3.12] [3.13] gh-124969: Fix locale.nl_langinfo(locale.ALT_DIGITS) (GH-124974) (GH-125232) (GH-125284)
(cherry picked from commit 26a93189e4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Returns a tuple of up to 100 strings for ALT_DIGITS lookup (an empty tuple on most locales).
Previously it returned the first item of that tuple or an empty string.
(cherry picked from commit 21c04e1a97)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-11 09:37:55 +03:00
Miss Islington (bot)
eb320f5ac8
[3.12] Note argparse exit code in documentation (GH-119568) (GH-125275)
(cherry picked from commit 3b87fb74c9)

Co-authored-by: Justin Kunimune <justinkunimune@gmail.com>
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-10 21:18:01 +03:00
Miss Islington (bot)
ba292cc301
[3.12] gh-121607: Edited source file import recipe to make it more clear (GH-121519) (GH-124081)
gh-121607: Edited source file import recipe to make it more clear (GH-121519)
(cherry picked from commit 38809171b8)

Co-authored-by: Chris Barker <Chris.Barker@noaa.gov>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-10-10 10:31:27 -07:00
Miss Islington (bot)
01daccff3c
[3.12] gh-71784: [doc] add usage examples for traceback.TracebackException (GH-125189) (#125248)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-10 10:37:14 +00:00
Alex Waygood
cba37762ac
[3.12] gh-101100: Consolidate documentation on ModuleType attributes (#124709) (#125211)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-09 19:18:38 +00:00
Miss Islington (bot)
046687c620
[3.12] docs: in venv table use executable name (GH-124315) (#125171)
(cherry picked from commit 7f93dbf6fe)
2024-10-09 17:54:38 +01:00
Miss Islington (bot)
7187d4f3b6
[3.12] gh-101100: Fix Sphinx warnings in library/unittest.mock.rst (GH-124106) (#125191)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-10-09 14:16:13 +00:00
Savannah Ostrowski
0dbad1d8b7
[3.12] GH-124478: Cleanup argparse documentation (GH-124877) (#125164)
(cherry picked from commit 37228bd16e)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2024-10-08 16:20:49 -07:00
Raymond Hettinger
cf2532b39d
[3.12] Tee of tee was not producing n independent iterators (gh-123884) (gh-125153) 2024-10-08 20:16:18 +00:00
Miss Islington (bot)
382ee1c7bd
[3.12] gh-124832: Add a note to indicate that datetime.now may return the same instant (GH-124834) (#125146)
gh-124832: Add a note to indicate that `datetime.now` may return the same instant (GH-124834)

* Update datetime.rst

* Update datetime.rst

replace warning with note

* Update Doc/library/datetime.rst



* Update Doc/library/datetime.rst



---------

(cherry picked from commit 760b1e103a)

Co-authored-by: spacemanspiff2007 <10754716+spacemanspiff2007@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-08 18:27:50 +00:00
Miss Islington (bot)
65272a382b
[3.12] Doc: Improve description of `GET_LEN` opcode (GH-114583) (#125103)
Doc: Improve description of ``GET_LEN`` opcode (GH-114583)
(cherry picked from commit e8773e59a8)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-10-08 12:32:04 +00:00
Miss Islington (bot)
bc237ed9a8
[3.12] gh-124653: Relax (again) detection of queue API for logging handlers (GH-124897) (GH-125060)
(cherry picked from commit 7ffe94fb24)
2024-10-08 07:24:09 +01:00
Miss Islington (bot)
d2b307171c
[3.12] gh-125018: Fix role syntax (GH-125050) (#125055)
gh-125018: Fix role syntax (GH-125050)
(cherry picked from commit 10094a533a)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-07 16:58:47 +00:00
Alyssa Coghlan
fa32f007f0
[3.12] gh-125018: Add importlib.metadata semantic link targets (GH-125027) (#125048)
This allows direct intersphinx references to APIs via references
like `` :func:`importlib.metadata.version` ``.

---------

(cherry picked from commit cda3b5a576)

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-07 14:24:45 +00:00