Commit graph

11504 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
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
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)
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)
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)
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)
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)
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
Miss Islington (bot)
125f75cc13
doc: Remove a duplicate 'versionchanged' in library/asyncio-task (gh-102677)
(cherry picked from commit 7bdb331b67)

Co-authored-by: Joongi Kim <me@daybreaker.info>
2023-03-13 19:26:24 -07:00
Miss Islington (bot)
0275b12a0f
gh-102627: Replace address pointing toward malicious web page (GH-102630)
* Replace known bad address pointing toward a malicious web page.

(cherry picked from commit 61479d4684)

Co-authored-by: Blind4Basics <32236948+Blind4Basics@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-03-13 15:42:37 -07:00
Alex Waygood
83ccaf2c09
[3.10] Fix duplicated words in the docs (#102645)
(cherry-picked from commit f6ca71a)

With grep utility found some duplicated words

Co-authored-by: Виталий Дмитриев <vitaldmit@bk.ru>
2023-03-13 14:31:25 +00:00
Miss Islington (bot)
a01ad527e7
gh-101100: Fix Sphinx warnings in turtle module (GH-102340)
(cherry picked from commit 78e4e6c3d7)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-13 04:11:34 -07:00
Miss Islington (bot)
7276ee0d12
gh-101100: Fix sphinx warnings in zipapp and zipfile modules (GH-102526)
(cherry picked from commit 1f557f94c2)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-03-08 00:44:34 -08:00
Miss Islington (bot)
3d88b4e51a
gh-101754: Document that Windows converts keys in os.environ to uppercase (GH-101840)
(cherry picked from commit 4e7c0cbf59)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2023-03-03 02:58:30 -08:00
Alex Waygood
47cc6fac4b
[3.10] Fix typos in documentation and comments (GH-102374) (#102377)
Fix typos in documentation and comments (GH-102374)

Found some duplicate `to`s in the documentation and some code comments and fixed them.

[Misc/NEWS.d/3.12.0a1.rst](ed55c69ebd/Misc/NEWS.d/3.12.0a1.rst) also contains two duplicate `to`s, but I wasn't sure if it's ok to touch that file.  Looks auto generated.  I'm happy to amend the PR if requested. :)

Automerge-Triggered-By: GH:AlexWaygood

Co-authored-by: Michael K <michael-k@users.noreply.github.com>
2023-03-02 16:45:01 +00:00
Hugo van Kemenade
a8f9a82881
[3.10] gh-90744: Fix erroneous doc links in the sys module (GH-101319) (#102322)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Brad Wolfe <brad.wolfe@gmail.com>
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Fix erroneous doc links in the sys module (#101319)
2023-03-02 07:43:50 +02:00
Miss Islington (bot)
ca1cc1484f
gh-102296 Document that inspect.Parameter kinds support ordering (GH-102297)
(cherry picked from commit 0db6f44259)

Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com>
Automerge-Triggered-By: GH:AlexWaygood
2023-02-27 07:22:07 -08:00
Miss Islington (bot)
cba52ec060
gh-101100: Fix sphinx warnings in types module (GH-102274)
(cherry picked from commit 101a12c576)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-02-26 23:34:10 -08:00
Miss Islington (bot)
601c9db455
[3.10] gh-85417: Clarify behaviour on branch cuts in cmath module (GH-102046) (#102275)
gh-85417: Clarify behaviour on branch cuts in cmath module (GH-102046)

This PR updates the cmath module documentation to reflect the reality that Python is almost always (and as far as I can tell, that "almost" can be omitted) running on a machine whose C double supports signed zeros.

* Removes misleading references to functions being continuous from above / below / the left / the right at branch cuts
* Expands the note on branch cuts at the top of the module documentation to explain the double-sided sign-of-zero-based behaviour
(cherry picked from commit b513c46d99)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2023-02-26 11:55:13 +00:00