Commit graph

28094 commits

Author SHA1 Message Date
Miss Islington (bot)
2750f3c9b5
[3.12] Use `sphinxext-opengraph` v0.13.0 (GH-140425) (#140430)
Use ``sphinxext-opengraph`` v0.13.0 (GH-140425)
(cherry picked from commit b4d2307367)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-22 14:51:52 +01:00
Sebastian Pipping
0e4cd89781
[3.12] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234) (#139527)
* [3.12] gh-90949: add Expat API to prevent XML deadly allocations (CVE-2025-59375) (GH-139234)

Expose the XML Expat 2.7.2 mitigation APIs to disallow use of
disproportional amounts of dynamic memory from within an Expat
parser (see CVE-2025-59375 for instance).

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetAllocTrackerActivationThreshold(threshold)`, and
- `parser.SetAllocTrackerMaximumAmplification(max_factor)`.

(cherry picked from commit f04bea44c3)
(cherry picked from commit 68a1778b77)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-17 15:58:59 +01:00
Serhiy Storchaka
a183a11db8
[3.12] gh-137836: Support more RAWTEXT and PLAINTEXT elements in HTMLParser (GH-137837) (GH-140842) (GH-140850)
(cherry picked from commit a17c57eee5)
(cherry picked from commit 0329bd11c7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-10-31 17:57:28 +01:00
Miss Islington (bot)
ba738f46a7
[3.12] gh-139436: Remove `dist-pdf` from the docs archives rebuild target (GH-139437) (GH-139694)
(cherry picked from commit 0e2cdd313b)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-08 13:49:10 +02:00
Miss Islington (bot)
f9f8cb92c9
[3.12] gh-139436: Remove link to the PDF downloads (GH-139142) (GH-139428)
(cherry picked from commit 6b5f15698a)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-07 13:48:45 +02:00
Hugo van Kemenade
71c84fadf4
[3.12] GH-136155: Use `sphinxext-opengraph` v0.12.0 (GH-137393) (#138741)
(cherry picked from commit 39bd7c3156)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-24 12:27:40 +01:00
Hugo van Kemenade
1793b7291f
[3.12] gh-136155: Use `sphinxext-opengraph` v0.12.0 (#136406)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-09-08 11:31:44 +03:00
Thomas Wouters
55fee9cf21 Python 3.12.11 2025-06-03 17:41:47 +02:00
T. Wouters
19de092deb
[3.12] gh-135034: Normalize link targets in tarfile, add os.path.realpath(strict='allow_missing') (GH-135037) (GH-135066)
Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.

(cherry picked from commit 3612d8f517)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Signed-off-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-03 16:00:21 +02:00
Miss Islington (bot)
0c92fc364c
[3.12] Docs: remove link elements in builders other than HTML (GH-133720) (#134007)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
2025-05-14 18:23:12 +03:00
Miss Islington (bot)
95d9dea1c4
[3.12] Docs: Migrate entirely to PSF hosted plausible for analytics (GH-132648) (#132664)
Docs: Migrate entirely to PSF hosted plausible for analytics (GH-132648)
(cherry picked from commit 1d529cbc89)

Co-authored-by: Ee Durbin <ewdurbin@gmail.com>
2025-04-18 07:21:14 +03:00
Miss Islington (bot)
936dc2d443
[3.12] gh-102136: Add -m to options that work with -i (GH-119271) (GH-119286)
(cherry picked from commit 172690227e)

Co-authored-by: Melanie Arbor <hellomelaniec@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2025-04-08 12:32:06 +02:00
Miss Islington (bot)
aab69a8214
[3.12] gh-132021: Add bool type to the list of allowed JSON key types (GH-132048) (#132256)
gh-132021: Add bool type to the list of allowed JSON key types (GH-132048)
(cherry picked from commit 403886c28d)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2025-04-08 08:43:45 +00:00
Thomas Grainger
3fc57f86b1
[3.12] gh-116608: undeprecate functional importlib.resources API (#132206)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-04-08 10:36:29 +02:00
David Lowry-Duda
4c5e84dbbe
[3.12] gh-115684: Clarify datetime replace documentation (GH-116519) (#131694)
* Clarify datetime `replace` documentation

In GH-115684, HopedForLuck noted that `datetime.date.replace()`
documentation was confusing because it looked like it would be changing
immutable objects.

This documentation change specifies that the `replace()` methods in
`datetime` return new objects. This uses similar wording to the
documentation for `datetime.combine()`, which specifies that a new
datetime is returned. This is also similar to wording for
`string.replace()`, except `string.replace()` emphasizes that a "copy"
is returned.

Resolves GH-115684.

* Include reviewer comments

Thanks Privat33r-dev for the comments!

---------
(cherry picked from commit d2d886215c)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2025-04-08 10:30:12 +02:00
Miss Islington (bot)
d00c6a3c63
[3.12] Add psfhosted Plausible instance to analytics (GH-132252) (#132254)
Add psfhosted Plausible instance to analytics (GH-132252)
(cherry picked from commit 40844164b1)

Co-authored-by: Ee Durbin <ewdurbin@gmail.com>
2025-04-08 07:53:44 +00:00
Miss Islington (bot)
4d1ab712cc
[3.12] gh-130521: Add Open Graph meta tags to template pages (GH-130523) (#132238)
gh-130521: Add Open Graph meta tags to template pages (GH-130523)
(cherry picked from commit f5639d87f5)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-07 21:06:29 +00:00
Hugo van Kemenade
6c9ece3e03
[3.12] Docs HTML: Remove self-closing tags (GH-132220) (#132229)
(cherry picked from commit ce724571b3)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-04-07 22:06:08 +01:00
Miss Islington (bot)
0875dcbe7c
[3.12] gh-132221: Fix __match_args__ generation docs in dataclasses.rst (GH-132222) (#132227)
gh-132221: Fix `__match_args__` generation docs in `dataclasses.rst` (GH-132222)
(cherry picked from commit 8b62374b34)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-07 14:54:53 +00:00
Miss Islington (bot)
ab78a37f6f
[3.12] gh-131912: Improve description of grouping options in the format specification docs (GH-132030) (#132203)
(cherry picked from commit 06a110f522)

Co-authored-by: Prometheus3375 <35541026+Prometheus3375@users.noreply.github.com>
2025-04-07 07:26:34 +00:00
Miss Islington (bot)
0c429ac002
[3.12] Docs: Add a single table summary for `cmath` (GH-131887) (#132180)
Docs: Add a single table summary for ``cmath`` (GH-131887)
(cherry picked from commit 6eaa4aeef2)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-04-06 23:43:06 +00:00
Miss Islington (bot)
82b3939daf
[3.12] Fix numbered list syntax in programming.rst (GH-130158) (#132141)
Fix numbered list syntax in programming.rst (GH-130158)
(cherry picked from commit 376631829a)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-04-05 19:27:05 +00:00
Miss Islington (bot)
0c110439b3
[3.12] Docs: document plistlib.InvalidFileException (GH-132069) (#132117)
Docs: document `plistlib.InvalidFileException` (GH-132069)
(cherry picked from commit 99e9798d61)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-04-05 10:53:06 +02:00
Miss Islington (bot)
6cdd3a4e91
[3.12] Minor improvements to the programming FAQ (GH-127261) (#131965)
Minor improvements to the programming FAQ (GH-127261)
(cherry picked from commit 23a658b9af)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-01 07:26:36 +00:00
Miss Islington (bot)
ce85eb544d
[3.12] gh-125957: sync argument naming in sphinx docs of the cmath and help() (GH-125958) (#131963)
gh-125957: sync argument naming in sphinx docs of the cmath and help() (GH-125958)
(cherry picked from commit 0a3eb8855c)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-01 07:23:33 +00:00
Miss Islington (bot)
525eddf220
[3.12] gh-131885: Document that dict.setdefault and dict.get take no keyword arguments (GH-128208) (#131894)
gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (GH-128208)
(cherry picked from commit edfbd8c062)

Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
2025-03-30 09:29:49 +00:00
Miss Islington (bot)
f1b65d757d
[3.12] gh-129994: update docs when using dualstack_ipv6 in socket.create_server (GH-129996) (#131891)
gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server` (GH-129996)
(cherry picked from commit 044a1e13d5)

Co-authored-by: Alexander Ershov <150328014+AEErshov@users.noreply.github.com>
2025-03-30 10:28:26 +02:00
Miss Islington (bot)
3cd04d47dd
[3.12] gh-127541: Update os.walk example (GH-127765) (#131873)
gh-127541: Update os.walk example (GH-127765)

Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs.
(cherry picked from commit a5949986d6)

Co-authored-by: Totosuki <116938397+totosuki@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-29 10:34:35 +00:00
Miss Islington (bot)
b2dbc4f3a7
[3.12] Fix typo in importlib.metadata.rst (gh-131596) (#131631)
Fix typo in importlib.metadata.rst (gh-131596)
(cherry picked from commit 5fc889ffbf)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
2025-03-27 15:43:03 +02:00
Miss Islington (bot)
b7c5371621
[3.12] gh-131741: Add documentation for Windows version detection change in platform (GH-131742) (#131768)
gh-131741: Add documentation for Windows version detection change in `platform` (GH-131742)

Document the behavior change between 3.11 & 3.12, where ``platform`` now correctly detects Windows 11 and Windows Server releases past Windows Server 2012.
(cherry picked from commit b9ca438daa)

Co-authored-by: Idan Noiman <idann@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wulian <1055917385@qq.com>
2025-03-26 15:00:08 +00:00
Miss Islington (bot)
3911bd5cc3
[3.12] gh-130283: update deprecated links and examples in urllib.request docs (GH-130284) (#131627)
gh-130283: update deprecated links and examples in `urllib.request` docs (GH-130284)
(cherry picked from commit fd459b1153)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-23 13:36:32 +00:00
Miss Islington (bot)
7d5b8131b1
[3.12] gh-121529: Document from_ parameter in _mboxMMDF public methods (GH-121530) (#131622)
gh-121529: Document `from_` parameter in `_mboxMMDF` public methods (GH-121530)
(cherry picked from commit 557d2d20d4)

Co-authored-by: Sebb <sebbASF@users.noreply.github.com>
2025-03-23 12:18:32 +00:00
Miss Islington (bot)
b1e2384335
[3.12] gh-131457: Fix typo in BNF description of function signatures (GH-131460) (#131576)
gh-131457: Fix typo in BNF description of function signatures (GH-131460)
(cherry picked from commit 8b7d20d3a9)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
2025-03-22 08:01:47 +00:00
Gregory P. Smith
3eb7a9024b
[3.12] gh-70647: update docs to mention the datetime 1900 year default 2/29 issue (#131534)
* gh-70647: Better promote how to safely parse yearless dates in datetime.

Every four years people encounter this because it just isn't obvious.
This moves the footnote up to a note with a code example.

We'd love to change the default year value for datetime but doing
that could have other consequences for existing code.  This documented
workaround *always* works.

* doctest code within note is bad, dedent.
2025-03-20 21:50:10 -07:00
Adam Turner
e1626c3b70
[3.12] GH-121970: Extract pydoc_topics into a new extension (GH-131256) (#131512)
(cherry picked from commit c1a02f9101)
2025-03-20 15:40:37 +00:00
Miss Islington (bot)
caa73883f9
[3.12] Docs: Fix documentation for "PyTypeObject Definition" (GH-130936) (GH-131459)
The structure definition for `PyTypeObject` is in `Include/cpython/object.h`,
not in `Include/object.h`.
(cherry picked from commit a0478c9f0c)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-03-20 13:41:22 +01:00
Miss Islington (bot)
105bc83b78
[3.12] gh-131417: Mention asyncio Future and Task in docs for generic classes list (GH-131422) (#131446)
gh-131417: Mention asyncio Future and Task in docs for generic classes list (GH-131422)

Mention asyncio Future and Task in docs for generic classes list
(cherry picked from commit 61b4b2c57c)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2025-03-19 10:24:16 +01:00
Miss Islington (bot)
981566e399
[3.12] Docs: fix shell command formatting (GH-131310) (#131444)
Docs: fix shell command formatting (GH-131310)

replace "zypper in" with "zypper install" to avoid incorrect highlighting
(cherry picked from commit 267c06d6a8)

Co-authored-by: partev <petrosyan@gmail.com>
2025-03-19 07:52:17 +00:00
Miss Islington (bot)
7a8097c57a
[3.12] gh-116666: Add "token" glossary term (GH-130888) (GH-131368)
gh-116666: Add "token" glossary term (GH-130888)

Add glossary entry for `token`, and link to it.
Avoid talking about tokens in the SyntaxError intro (errors.rst); at this point
tokenization is too much of a technical detail. (Even to an advanced reader,
the fact that a *single* token is highlighted isn't too relevant. Also, we don't
need to guarantee that it's a single token.)
(cherry picked from commit 30d5205849)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-18 12:51:09 +01:00
Miss Islington (bot)
9d23a6d57b
[3.12] gh-131002: clarify how to enforce sqlite3 column types for generated fields (GH-131006) (#131386)
(cherry picked from commit f48887fb97)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-03-18 12:10:01 +01:00
Miss Islington (bot)
2601dae183
[3.12] gh-130132: properly free resources in urrlib.urlopen examples (GH-130280) (#131395)
gh-130132: properly free resources in `urrlib.urlopen` examples (GH-130280)
(cherry picked from commit 77d2fd4413)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-18 09:34:45 +00:00
Miss Islington (bot)
c23a2d3bdc
[3.12] gh-131094: Refine math.isclose docs (GH-131139) (#131393)
gh-131094: Refine `math.isclose` docs (GH-131139)
(cherry picked from commit 3f50f96586)

Co-authored-by: Guy Jacoby <49398101+guyjacoby@users.noreply.github.com>
2025-03-18 09:20:52 +00:00
Miss Islington (bot)
040583387b
[3.12] gh-129675: Update documentation for tp_basicsize & tp_itemsize (GH-129850) (GH-131078)
- Add alignment requirement
- Mention that ob_size is unreliable if you don't control it
- Add some links for context
- basicsize should include the base type in generaly not just PyObject
- suggest Py_SIZE & Py_SET_SIZE

This adds a “by-the-way” link to `PyObject_New`, which shouldn't be
used for GC types. In order to be comfortable linking to it, I also
add a link to `PyObject_GC_New` from its docs. And the same for
`*Var` variants, while I'm here.

(cherry picked from commit ad0f618ab3)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-03-17 16:18:14 +01:00
Hugo van Kemenade
4c1d52934d
[3.12] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (#130549)
(cherry picked from commit 425587a110)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-03-17 14:59:12 +02:00
Hugo van Kemenade
3983fcad95
[3.12] gh-109961: Docs: Fix incorrect rendering of __replace__ in copy.rst (GH-109968) (#130909)
(cherry picked from commit 0baf72696e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2025-03-17 14:58:14 +02:00
donBarbos
baea0e2b05
[3.12] gh-130160: use .. program:: directive for documenting http.server CLI (GH-131010) (#131294)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-17 10:28:11 +02:00
Miss Islington (bot)
c5a23ab9a6
[3.12] gh-131327: Document winsound.SND_APPLICATION (GH-131328) (#131329)
gh-131327: Document winsound.SND_APPLICATION (GH-131328)
(cherry picked from commit bf4c1bf344)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-16 15:45:57 +00:00
Miss Islington (bot)
1d17f1a979
[3.12] gh-130160: use .. program:: directive for documenting doctest CLI (GH-131034) (#131321)
gh-130160: use `.. program::` directive for documenting `doctest` CLI (GH-131034)
(cherry picked from commit 9558d22ac3)

Co-authored-by: donBarbos <donbarbos@proton.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-16 12:00:39 +00:00
Miss Islington (bot)
77ece5aed8
[3.12] gh-130814: Enhance documentation for Python C API type objects (GH-130817) (#131224)
gh-130814: Enhance documentation for Python C API type objects (GH-130817)

The "Type Objects" title in `c-api/typeobj.rst`, duplicating the title of `c-api/type.rst`,
has been changed to "Type Objects Structures", thereby slightly improving Sphinx
search.
(cherry picked from commit 6b932edc52)

Co-authored-by: sharktide <meherrihaan@gmail.com>
2025-03-14 10:01:05 +00:00
Miss Islington (bot)
39b4f8b6ed
[3.12] gh-124269: Simplify typing.Annotated docs (GH-130770) (#131223)
gh-124269: Simplify `typing.Annotated` docs (GH-130770)

---------
(cherry picked from commit e4ac196aaa)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-14 09:54:08 +00:00