Commit graph

25226 commits

Author SHA1 Message Date
Pablo Galindo
88663ef89b
Python 3.10.18 2025-06-03 19:23:41 +01:00
T. Wouters
9c1110ef66
[3.10] gh-135034: Normalize link targets in tarfile, add os.path.realpath(strict='allow_missing') (GH-135037) (#135070)
Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.
(cherry picked from commit 3612d8f517)
(cherry picked from commit c358142cab)
(cherry picked from commit 371b4eaadc)

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 19:02:29 +02:00
Hugo van Kemenade
457b2cac73
[3.10] gh-122544: Change OS image in GitHub Actions to Ubuntu 22.04 (GH-122566) (#130268)
Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
2025-02-19 14:19:52 +01:00
Adam Turner
1d4db86b4d
[3.10] Docs: pin python-docs-theme to 2025.2 (GH-129576) (#130067)
[3.10] [3.11] Docs: pin python-docs-theme to 2025.2 (GH-129576)

* [3.11] Pin python-docs-theme

* Use today's release



---------
(cherry picked from commit 77ca2f66ea)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-13 01:39:02 +00:00
Petr Viktorin
7b0351cf6a
[3.10] gh-129641: Docs GHA build: use upload-artifact@v4 & Python 3.12 (#129642)
* [3.10] gh-129641: Switch Docs GHA build to actions/upload-artifact@v4

Add options for backwards compatibility, from the docs at:
https://github.com/actions/upload-artifact?tab=readme-ov-file#breaking-changes

* Python Tutorial typo fix (#128077)

Backported form commit: 5a584c8f54

This is a trivial change meant to trigger a Docs build.

* Use Python 3.12 for the 3.10 docs build

The pinned version of Sphinx requires `imghdr`, removed in Python 3.13.

---------

Co-authored-by: shallow-beach <96891913+shallow-beach@users.noreply.github.com>
2025-02-13 01:31:51 +00:00
Petr Viktorin
8773554b71
[3.10] gh-121277: Allow .. versionadded:: next in docs (GH-121278) (#127867)
Make `versionchanged:: next`` expand to current (unreleased) version.

When a new CPython release is cut, the release manager will replace
all such occurences of "next" with the just-released version.
(See the issue for release-tools and devguide PRs.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
(cherry picked from commit 7d24ea9db3)

gh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH-124623)

(cherry-picked from e349f73a5a)

Updates for 3.10

(cherry-picked from 3.11: f0895aa9c1)

* Use version, not arguments directly
2024-12-13 22:00:34 +00:00
Petr Viktorin
2a9273a0e4
[3.10] [CVE-2023-27043] gh-102988: Reject malformed addresses in email.parseaddr() (GH-111116) (#123768)
Detect email address parsing errors and return empty tuple to
indicate the parsing error (old API). Add an optional 'strict'
parameter to getaddresses() and parseaddr() functions. Patch by
Thomas Dwyer.

(cherry picked from commit 4a153a1d3b)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-Authored-By: Thomas Dwyer <github@tomd.tel>
2024-09-06 13:14:22 +02:00
Łukasz Langa
06f28dc236
[3.10] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233) (#122609)
Per RFC 2047:

> [...] these encoding schemes allow the
> encoding of arbitrary octet values, mail readers that implement this
> decoding should also ensure that display of the decoded data on the
> recipient's terminal will not cause unwanted side-effects

It seems that the "quoted-word" scheme is a valid way to include
a newline character in a header value, just like we already allow
undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.

This should fail for custom fold() implementations that aren't careful
about newlines.

(cherry picked from commit 0976339818)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-04 17:38:31 +02:00
Łukasz Langa
d86ab5dde2
[3.10] gh-121957: Emit audit events for python -i and python -m asyncio (GH-122119) 2024-07-22 13:48:50 +02:00
Steve Dower
c8f868dc52
[3.10] gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488) (GH-118740)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-24 19:26:44 +02:00
Petr Viktorin
c62c9e518b
[3.10] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges (GH-113179) (GH-113186) (GH-118177) (GH-118229)
The _private_networks variables, used by various is_private
implementations, were missing some ranges and at the same time had
overly strict ranges (where there are more specific ranges considered
globally reachable by the IANA registries).

This patch updates the ranges with what was missing or otherwise
incorrect.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

The _address_exclude_many() call returns 8 networks for IPv4, 121
networks for IPv6.

[1] https://github.com/python/cpython/issues/61602

In 3.10 and below, is_private checks whether the network and broadcast
address are both private.
In later versions (where the test wss backported from), it checks
whether they both are in the same private network.

For 0.0.0.0/0, both 0.0.0.0 and 255.225.255.255 are private,
but one is in 0.0.0.0/8 ("This network") and the other in
255.255.255.255/32 ("Limited broadcast").

---------

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2024-05-07 11:56:13 +02:00
Miss Islington (bot)
9b33629f96
[3.10] gh-114539: Clarify implicit launching of shells by subprocess (GH-117996) (GH-118004)
(cherry picked from commit a4b44d39cd)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-05-07 10:47:46 +02:00
Sebastian Pipping
516a6d4237
[3.10] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (GH-116270)
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:

- `xml.etree.ElementTree.XMLParser.flush`
- `xml.etree.ElementTree.XMLPullParser.flush`
- `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
- `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
- `xml.sax.expatreader.ExpatParser.flush`

Based on the "flush" idea from https://github.com/python/cpython/pull/115138#issuecomment-1932444270 .

Includes code suggested-by: Snild Dolkow <snild@sony.com>
and by core dev Serhiy Storchaka.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-07 00:02:55 +01:00
Miss Islington (bot)
b612ec6b19
[3.10] gh-115399: Document CVE-2023-52425 under "XML vulnerabilities" (GH-115400) (GH-115762)
Doc/library/xml.rst: Document CVE-2023-52425 under "XML vulnerabilities"
(cherry picked from commit fbd40ce46e)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2024-02-21 12:43:27 +01:00
Łukasz Langa
c3108e1214
[3.10] gh-46968: Fix invalid reference to Sound eXchange (SoX) 12.17.7 license (GH-115094) (GH-115096)
(cherry picked from commit b39119916c)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-02-06 19:53:23 +01:00
Adam Turner
6661b228ba
[3.10] gh-114021: Pin various sphinxcontrib extensions to older versions (GH-114022) (GH-114038)
(cherry picked from commit 94b1d1fa38)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2024-01-17 14:50:24 +01:00
Miss Islington (bot)
7d445511f8
[3.10] gh-107845: Fix symlink handling for tarfile.data_filter (GH-107846) (#108210) 2023-08-22 18:02:30 +01:00
Eric Snow
917439d4d9
[3.10] gh-98154: Clarify Usage of "Reference Count" In the Docs (#107754) 2023-08-11 13:41:56 +00:00
Miss Islington (bot)
a9e5e59b7d
[3.10] gh-105090: Replace incorrect TLSv1.2 with TLSv1.3 (GH-105404) (#107039)
Co-authored-by: Jocelyn Castellano <admin@malwarefight.gq>
2023-07-22 16:30:09 +02:00
Miss Islington (bot)
f91dfdf5ff
[3.10] gh-105993: Add possible None return type to asyncio.EventLoop.start_tls docs (GH-105995) (#106190)
(cherry picked from commit 6b52a581c1)

Co-authored-by: Sam Bull <git@sambull.org>
2023-07-05 13:21:19 +02:00
Miss Islington (bot)
1851443157
[3.10] [3.11] Add single value agen.athrow(value) signature to the 3.11 docs gh-105269 (GH-105468) (#105480)
(cherry picked from commit acf3916e84)

Co-authored-by: Federico Caselli <CaselIT@users.noreply.github.com>
2023-07-05 13:18:39 +02:00
Miss Islington (bot)
45de31db9c
[3.10] Clarify the supported cases in the tokenize module (GH-105569) (#105575)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-06-09 16:00:59 +00:00
Miss Islington (bot)
b7fd286c3b
[3.10] gh-89412: Add missing attributes (added in 3.10) to traceback module docs (GH-105046) (#105329)
(cherry picked from commit a4f72fa39a)

Co-authored-by: Jakub Kuczys <me@jacken.men>
2023-06-05 19:02:31 +02:00
Miss Islington (bot)
f12502b2b3
[3.10] gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185) (#105220)
(cherry picked from commit ee26ca13a1)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-06-05 18:06:43 +02:00
Miss Islington (bot)
f48a96a280
[3.10] [3.11] gh-102153: Start stripping C0 control and space chars in urlsplit (GH-102508) (GH-104575) (#104592)
gh-102153: Start stripping C0 control and space chars in `urlsplit` (GH-102508)

`urllib.parse.urlsplit` has already been respecting the WHATWG spec a bit GH-25595.

This adds more sanitizing to respect the "Remove any leading C0 control or space from input" [rule](https://url.spec.whatwg.org/GH-url-parsing:~:text=Remove%20any%20leading%20and%20trailing%20C0%20control%20or%20space%20from%20input.) in response to [CVE-2023-24329](https://nvd.nist.gov/vuln/detail/CVE-2023-24329).

I simplified the docs by eliding the state of the world explanatory
paragraph in this security release only backport.  (people will see
that in the mainline /3/ docs)

---------

(cherry picked from commit 2f630e1ce1)
(cherry picked from commit 610cc0ab1b)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
2023-05-17 16:06:06 -07:00
Matěj Cepl
425065bb00
[3.10] gh-102950: Implement PEP 706 – Filter for tarfile.extractall (GH-102953) (GH-104128)
- Backport b52ad18a76
- Backport c8c3956d90
- Remove the DeprecationWarning
- Adjust docs
- Remove new `__all__` entries

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-05-10 13:43:00 +02:00
Miss Islington (bot)
18d825be8c
gh-102899: Fix doc link for getting filesystem error handler (GH-102901)
(cherry picked from commit fdd0fff277)

Co-authored-by: Olivier Gayot <olivier.gayot@sigexec.com>
2023-04-05 08:03:45 -07:00
Miss Islington (bot)
8693ec214c
gh-81762: Clarify and simplify description of print's flush param (GH-103264)
(cherry picked from commit c396b6ddf3)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-04-05 04:24:43 -07:00
Miss Islington (bot)
d76a5c6f7b
Improve some grammar in the socket docs (GH-103254)
(cherry picked from commit bceb9e00ad)

Co-authored-by: Tim Burke <tim.burke@gmail.com>
2023-04-04 15:55:11 -07:00
Miss Islington (bot)
9a8ce95748
gh-103109: Document ignore_warnings() test support helper (GH-103110)
(cherry picked from commit 32937d6aa4)

Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-04-02 15:38:58 -07:00
Miss Islington (bot)
d58ff6a616
Minor docs improvements fix for codeop (GH-103123)
(cherry picked from commit c1e71ce56f)

Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
2023-03-30 15:58:36 -07:00
Miss Islington (bot)
ba755a245b
gh-103099: Link mypy docs from typing.rst (GH-103100)
(cherry picked from commit fda95aa194)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-03-30 01:41:04 -07:00
Miss Islington (bot)
473fd7bbf0
[3.10] gh-102582: Fix invalid JSON in Doc/howto/logging-cookbook.rst (GH-102635) (GH-103107)
(cherry picked from commit d835b3f05d)
Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2023-03-29 10:05:29 +01:00
Miss Islington (bot)
ae8a721c2b
Update pdb docs for arguments (GH-102965)
(cherry picked from commit 027223db96)

Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
2023-03-25 14:38:26 -07:00
Miss Islington (bot)
db5bf52469
[3.10] gh-103025: fix a ctypes doc typo (GH-103026) (#103030)
* gh-103025: fix two ctypes doc issues  (GH-103026)
(cherry picked from commit 0708437ad0)
2023-03-25 10:00:03 +00:00
Hugo van Kemenade
7513c6b6fe
[3.10] gh-101100: Document PyObject_ClearWeakRefs and gzip's name (#103002) 2023-03-25 09:44:05 +02:00
Miss Islington (bot)
cbffc3ad38
gh-102873: logging.LogRecord docs: improve description of msg parameter (GH-102875)
(cherry picked from commit f2e5a6ee62)

Co-authored-by: Amin Alaee <mohammadamin.alaee@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-24 08:07:46 -07:00
Miss Islington (bot)
0a2b63f6ad
[3.10] gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (GH-96932) (#102919)
gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (GH-96932)
(cherry picked from commit af9c34f6ef)

Co-authored-by: Benjamin Fogle <benfogle@gmail.com>
2023-03-24 13:33:32 +01:00
Miss Islington (bot)
77e54fe98a
gh-98239: Document that inspect.getsource() can raise TypeError (GH-101689)
(cherry picked from commit b6132085ca)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-03-23 12:41:50 -07:00
Miss Islington (bot)
6c667d025a
gh-102936: typing: document performance pitfalls of protocols decorated with @runtime_checkable (GH-102937)
(cherry picked from commit 58d2b30c01)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-03-23 11:28:11 -07:00
Miss Islington (bot)
3c2a7bb6b5
Docs: improve accuracy of sqlite3.Connection.interrupt() (GH-102904)
(cherry picked from commit 7b2d53dacc)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-22 04:59:56 -07:00
Miss Islington (bot)
2e0505a1d9
Docs: improve the accuracy of the sqlite3.connect() timeout param (GH-102900)
(cherry picked from commit c24f1f1e87)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-22 04:49:32 -07:00
Miss Islington (bot)
00b50606c0
Docs: improve accuracy of pdb alias example (GH-102892)
(cherry picked from commit e0c63b7267)

Co-authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
2023-03-22 04:41:54 -07:00
Miss Islington (bot)
eaafea86a0
gh-102595: Document PyObject_Format c-api function (GH-102596)
(cherry picked from commit 910a64e301)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Def: 5ffdaf748d/Include/abstract.hGH-L389
2023-03-22 02:32:08 -07:00
Miss Islington (bot)
21b94028ef
Add link to sys.exit function documentation (GH-102805)
* Add link to `sys.exit` function documentation

* Update Doc/library/os.rst

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

* Update Doc/library/os.rst

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

---------

(cherry picked from commit 41ef502d74)

Co-authored-by: David Poirier <1152277+david-poirier@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-21 15:05:32 -07:00
Miss Islington (bot)
99b38bebfd
[3.10] Fix outdated note about 'int' rounding or truncating (GH-102736) (#102767)
Fix outdated note about 'int' rounding or truncating (GH-102736)
(cherry picked from commit 405739f916)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2023-03-16 20:43:03 +00:00
Miss Islington (bot)
bef189b5c7
gh-101100: Documenting --prefix and --exec-prefix. (GH-102695)
(cherry picked from commit 61b9ff35cb)

Co-authored-by: Julien Palard <julien@palard.fr>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-03-15 15:14:00 -07:00
Hugo van Kemenade
087fb56b9d
[3.10] Remove misformatted exclamation marks in docs (GH-102694) (#102717)
Remove the exclamation mark from :program:`!foo` in .rst files because
it inadvertently shows up in the rendered HTML.

(Sphinx's cross-referencing roles use a '!' prefix to suppress
hyperlinking[1], but :program: is not a cross-referencing role so the
'!' is displayed verbatim.)

The exclamation marks in venv.rst were introduced in #98350. See
comments [2] and [3] for additional discussion.

[1]: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#cross-referencing-syntax
[2]: https://github.com/python/cpython/pull/98350#issuecomment-1285965759
[3]: https://github.com/python/cpython/pull/98350#issuecomment-1286394047

Reported-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Tom Levy <tomlevy93@gmail.com>
2023-03-15 09:26:46 +02:00
Miss Islington (bot)
95fd2dfd3f
gh-102703: Fix typo in modules tutorial documentation (GH-102707)
**Before**
This prevents directories with a common name, such as ``string``, unintentionally hiding ...
**After**
This prevents directories with a common name, such as ``string``, from unintentionally hiding ...
(cherry picked from commit 0a539b5db3)

Co-authored-by: Robert Prater (B. Eng) <robcprater@gmail.com>
2023-03-14 17:10:39 -07:00
Miss Islington (bot)
df38f7c577
[3.10] gh-102354: change python3 to python in docs examples (GH-102696) (#102698)
gh-102354: change python3 to python in docs examples (GH-102696)
(cherry picked from commit 80abd62647)

Co-authored-by: Paul Watson <paul.hermeneutic@gmail.com>
2023-03-14 12:52:27 -06:00