Commit graph

116755 commits

Author SHA1 Message Date
Serhiy Storchaka
f3c6f882cd
[3.11] gh-135462: Fix quadratic complexity in processing special input in HTMLParser (GH-135464) (GH-135484)
Some checks failed
Tests / Check for source changes (push) Has been cancelled
Lint / lint (push) Has been cancelled
Tests / Docs (push) Has been cancelled
Tests / Check if the ABI has changed (push) Has been cancelled
Tests / Check if generated files are up to date (push) Has been cancelled
Tests / Windows (push) Has been cancelled
Tests / macOS (push) Has been cancelled
Tests / Ubuntu (push) Has been cancelled
Tests / Ubuntu SSL tests with OpenSSL (push) Has been cancelled
Tests / Address sanitizer (push) Has been cancelled
Tests / All required checks pass (push) Has been cancelled
End-of-file errors are now handled according to the HTML5 specs --
comments and declarations are automatically closed, tags are ignored.
(cherry picked from commit 6eb6c5dbfb)
2025-07-03 23:05:46 +02:00
Miss Islington (bot)
313544eb03
[3.11] gh-127563: use dk_log2_index_bytes=3 in empty dicts (GH-127568) (GH-127813) (#135463)
Some checks failed
Lint / lint (push) Has been cancelled
Tests / Check for source changes (push) Has been cancelled
Tests / Docs (push) Has been cancelled
Tests / Check if the ABI has changed (push) Has been cancelled
Tests / Check if generated files are up to date (push) Has been cancelled
Tests / Windows (push) Has been cancelled
Tests / macOS (push) Has been cancelled
Tests / Ubuntu (push) Has been cancelled
Tests / Ubuntu SSL tests with OpenSSL (push) Has been cancelled
Tests / Address sanitizer (push) Has been cancelled
Tests / All required checks pass (push) Has been cancelled
[3.12] gh-127563: use `dk_log2_index_bytes=3` in empty dicts (GH-127568) (GH-127813)

This fixes a UBSan failure (unaligned zero-size memcpy) in `dictobject.c`.
(cherry picked from commit 9af96f4406)

(cherry picked from commit 320a1dcd97)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-16 14:51:04 +02:00
Łukasz Langa
c96ab19ae4
[3.11] gh-135374: Update the bundled copy of setuptools to 79.0.1 (#135396)
Some checks failed
Tests / Check for source changes (push) Has been cancelled
Lint / lint (push) Has been cancelled
Verify bundled pip and setuptools / verify (push) Has been cancelled
Tests / Windows (push) Has been cancelled
Tests / macOS (push) Has been cancelled
Tests / Ubuntu (push) Has been cancelled
Tests / Docs (push) Has been cancelled
Tests / Check if the ABI has changed (push) Has been cancelled
Tests / Check if generated files are up to date (push) Has been cancelled
Tests / Ubuntu SSL tests with OpenSSL (push) Has been cancelled
Tests / Address sanitizer (push) Has been cancelled
Tests / All required checks pass (push) Has been cancelled
2025-06-11 17:57:25 +02:00
Pablo Galindo
c79b99d1a4
Post 3.11.13 2025-06-03 20:31:21 +01:00
Pablo Galindo
498b971ea3
Python 3.11.13 2025-06-03 19:38:25 +01:00
T. Wouters
4633f3f497
[3.11] gh-135034: Normalize link targets in tarfile, add os.path.realpath(strict='allow_missing') (GH-135037) (GH-135068)
Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.
(cherry picked from commit 3612d8f517)
(cherry picked from commit c358142cab)

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:58:39 +02:00
Miss Islington (bot)
2c6ca1a9ad
[3.11] gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (GH-134836) (GH-135091)
(cherry picked from commit d83576bf48)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-03 16:24:20 +02:00
Miss Islington (bot)
9df171dbba
[3.11] gh-123409: fix IPv6Address.reverse_pointer for IPv4-mapped addresses (GH-123419) (GH-135087)
Fix functionality that was broken with better textual representation for IPv4-mapped addresses (gh-87799)
(cherry picked from commit 77a2fb4bf1)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-03 16:03:49 +02:00
Miss Islington (bot)
da3755557a
[3.11] gh-128840: Limit the number of parts in IPv6 address parsing (GH-128841) (GH-134613)
Limit length of IP address string to 39

(cherry picked from commit 47f1161d3a)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-06-03 15:55:00 +02:00
Miss Islington (bot)
f38f9cf7f8
[3.11] gh-87799: Improve the textual representation of IPv4-mapped IPv6 addresses (GH-29345) (GH-135080)
Represent IPv4-mapped IPv6 address as xxxd.d.d.d,
where the 'x's are the hexadecimal values
of the six high-order 16-bit pieces of the address,
and the 'd's are the decimal values
of the four low-order 8-bit pieces of the address
(standard IPv4 representation).

(cherry picked from commit f22bf8e3cf)

Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2025-06-03 15:43:36 +02:00
Miss Islington (bot)
f8b4421bc5
[3.11] gh-134062: Fix hash collisions in IPv4Network and IPv6Network (GH-134063) (GH-134479)
(cherry picked from commit f3fc0c16e0)

Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>
2025-06-02 17:53:12 +02:00
Serhiy Storchaka
73b3040f59
[3.11] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944) (GH-134341)
If the error handler is used, a new bytes object is created to set as
the object attribute of UnicodeDecodeError, and that bytes object then
replaces the original data. A pointer to the decoded data will became invalid
after destroying that temporary bytes object. So we need other way to return
the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal().

_PyBytes_DecodeEscape() does not have such issue, because it does not
use the error handlers registry, but it should be changed for compatibility
with _PyUnicode_DecodeUnicodeEscapeInternal().
(cherry picked from commit 9f69a58623)
(cherry picked from commit 6279eb8c07)
(cherry picked from commit a75953b347)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-02 17:52:52 +02:00
Miss Islington (bot)
461ca2cbfb
[3.11] gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (GH-126503) (GH-126572) (GH-133148)
gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (GH-126503)

If `read()` in the ConnectionHandler thread raises `OSError` (except `ConnectionError`),
the ConnectionHandler shuts down the entire ThreadedEchoServer,
preventing further connections.
It also does that for `EPROTOTYPE` in `wrap_conn`.

As far as I can see, this is done to avoid the server thread getting stuck,
forgotten, in its accept loop. However, since 2011 (5b95eb90a7)
the server is used as a context manager, and its `__exit__` does `stop()` and `join()`.
(I'm not sure if we *always* used `with` since that commit, but currently we do.)

Make sure that the context manager *is* used, and remove the `server.stop()`
calls from ConnectionHandler.

(cherry picked from commit c9cda1608e)
(cherry picked from commit aee80cd5e7)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-05-14 20:31:04 +02:00
Pablo Galindo
ab47462618
Post 3.11.12 2025-04-08 16:09:30 +01:00
Pablo Galindo
da1f6c61dd
Python 3.11.12 2025-04-08 15:15:29 +01:00
Seth Michael Larson
553d7069e2
[3.11] gh-131809: Upgrade vendored expat to 2.7.1 (GH-132192) (#132240)
(cherry picked from commit c0de650024)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-04-08 11:36:51 +02:00
Seth Michael Larson
ba49eab9aa
[3.11] gh-131261: Update libexpat to 2.7.0 (CVE-2024-8176) (GH-131272) (GH-131362)
(cherry picked from commit bb0268f60d)
(cherry picked from commit 6af54d298d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-04-03 18:32:11 +02:00
Miss Islington (bot)
0a66052d8d
[3.11] gh-121284: Fix email address header folding with parsed encoded-word (GH-122754) (GH-131405)
Email generators using email.policy.default may convert an RFC 2047
encoded-word to unencoded form during header refolding. In a structured
header, this could allow 'specials' chars outside a quoted-string,
leading to invalid address headers and enabling spoofing. This change
ensures a parsed encoded-word that contains specials is kept as an
encoded-word while the header is refolded.

[Better fix from @bitdancer.]

(cherry picked from commit 295b53df2a)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: R David Murray <rdmurray@bitdance.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-04-03 18:27:02 +02:00
Victor Stinner
4588712773
[3.11] gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361) (GH-127905) (GH-131970)
gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361)

From the ERR_raise manpage:

    ERR_LIB_SYS

        This "library code" indicates that a system error is
        being reported.  In this case, the reason code given
        to `ERR_raise()` and `ERR_raise_data()` *must* be
        `errno(3)`.

This PR only handles ERR_LIB_SYS for the high-lever error types
SSL_ERROR_SYSCALL and SSL_ERROR_SSL, i.e., not the ones where
OpenSSL indicates it has some more information about the issue.

(cherry picked from commit f4b31edf2d)
(cherry picked from commit 7f707fa6c6)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-04-03 18:25:51 +02:00
Diego Russo
f576d31d1c
[3.11] gh-106883: Make test_current_frames_exceptions_deadlock faster (#131182) 2025-03-14 01:59:59 +00:00
Diego Russo
6b37486184
[3.11] gh-106883 Fix deadlock in threaded application (#117332)
When using threaded applications, there is a high risk of a deadlock in
the interpreter. It's a lock ordering deadlock with HEAD_LOCK(&_PyRuntime); and the GIL.

By disabling the GC during the _PyThread_CurrentFrames() and
_PyThread_CurrentExceptions() calls fixes the issue.
2025-03-11 15:31:03 +00:00
Miss Islington (bot)
f1897d312e
[3.11] GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550) (GH-130573) (#130593) 2025-02-27 12:43:48 +00:00
Miss Islington (bot)
3abcace681
[3.11] gh-119511: Fix a potential denial of service in imaplib (GH-119514) (#129357)
The IMAP4 client could consume an arbitrary amount of memory when trying
to connect to a malicious server, because it read a "literal" data with a
single read(size) call, and BufferedReader.read() allocates the bytes
object of the specified size before reading. Now the IMAP4 client reads data
by chunks, therefore the amount of used memory is limited by the
amount of the data actually been sent by the server.
(cherry picked from commit 735f25c5e3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-02-19 14:16:30 +01:00
Miss Islington (bot)
526617ed68
[3.11] gh-105704: Disallow square brackets ([ and ]) in domain names for parsed URLs (GH-129418) (#129528)
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-02-19 14:13:52 +01:00
Miss Islington (bot)
7cff053efe
[3.11] gh-80222: Fix email address header folding with long quoted-string (GH-122753) (#129009)
Email generators using email.policy.default could incorrectly omit the
quote ('"') characters from a quoted-string during header refolding,
leading to invalid address headers and enabling header spoofing. This
change restores the quote characters on a bare-quoted-string as the
header is refolded, and escapes backslash and quote chars in the string.
(cherry picked from commit 5aaf416858)

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-02-19 14:12:34 +01:00
Miss Islington (bot)
9d727fe739
[3.11] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) (#130276)
Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-02-19 10:51:35 +02:00
Hugo van Kemenade
b2c3a95c97
[3.11] gh-122544: Change OS image in GitHub Actions to Ubuntu 24.04 (#122566) (#130260) 2025-02-18 21:40:16 +00:00
Hugo van Kemenade
2e01a7124a
[3.11] CI: Use ImageOS (ubuntu24) instead of runner.os (Linux) in cache keys (GH-130200) (#130252) 2025-02-18 14:16:23 +02:00
Adam Turner
77ca2f66ea
[3.11] Docs: pin python-docs-theme to 2025.2 (#129576)
* [3.11] Pin python-docs-theme

* Use today's release

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-13 01:33:04 +00:00
Miss Islington (bot)
552ec42331
[3.11] gh-119461: Restore the testSocket VSOCK skipUnless removed by PR GH-119465 (GH-129561) (#129566)
gh-119461: Restore the testSocket VSOCK skipUnless removed by PR GH-119465 (GH-129561)

Restore the skipUnless removed by GH-119465.

This test can only pass on virtual machines, not actual machines.

actual machines see:

```
    self.cli.connect((cid, VSOCKPORT))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: [Errno 19] No such device
```

Reproduced on (Linux) Ubuntu 24.04.1 running 6.8.0-52-generic.
(cherry picked from commit e1006ce1de)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-02-13 01:32:37 +00:00
Adam Turner
2068b03973
[3.11] Docs: pin python-docs-theme to 2025.2 (#129576) 2025-02-13 01:31:11 +00:00
Victor Stinner
45db419c31
[3.11] gh-119461: Fix ThreadedVSOCKSocketStreamTest (#129171)
Fix ThreadedVSOCKSocketStreamTest: if get_cid() returns the host
address or the "any" address, use the local communication address
(loopback): VMADDR_CID_LOCAL.

On Linux 6.9, apparently, the /dev/vsock device is now available but
get_cid() returns VMADDR_CID_ANY (-1).

(cherry picked from commit e94dbe4ed8)
(cherry picked from commit c750061047)
(cherry picked from commit cbfe3023e4)
2025-01-23 22:14:08 +01:00
Miss Islington (bot)
49edb990a5
[3.11] gh-128069: brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version (GH-128090) (#129172) 2025-01-22 12:25:24 +00:00
Miss Islington (bot)
a83a7cfff4
[3.11] gh-128874: Fix the documentation for blurb 2.0 (GH-128875) (#128879)
gh-128874: Fix the documentation for blurb 2.0 (GH-128875)
(cherry picked from commit 40a4d88a14)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-21 19:26:25 +00:00
Petr Viktorin
f0895aa9c1
[3.11] gh-121277: Allow .. versionadded:: next in docs (GH-121278) (#124718) (#127827)
* [3.11] gh-121277: Allow `.. versionadded:: next` in docs (GH-121278) (#124718)

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)

* Import VersionChange

sphinx.domains.changeset.VersionChange exists at least since Sphinx 2.1,
according to: https://www.sphinx-doc.org/en/master/extdev/deprecated.html

* Get config from env

* Use version, not arguments directly
2024-12-11 14:58:46 +00:00
Pablo Galindo
976c4f2a9d Post 3.11.11 2024-12-03 13:25:54 -05:00
Pablo Galindo
d03b868578 Python 3.11.11 2024-12-03 12:20:40 -05:00
Miss Islington (bot)
66a01b068b
[3.11] gh-122792: Make IPv4-mapped IPv6 address properties consistent with IPv4 (GH-122793) (GH-123818)
Make IPv4-mapped IPv6 address properties consistent with IPv4.
(cherry picked from commit 76a1c5d183)

Co-authored-by: Seth Michael Larson <seth@python.org>

---------

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-12-03 17:57:10 +01:00
Seth Michael Larson
2e161e2499
[3.11] gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792) (GH-126798)
Update libexpat to 2.6.4, make future updates easier.
(cherry picked from commit 3c99969094)
2024-12-03 17:42:23 +01:00
Hugo van Kemenade
7f71003b22
[3.11] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (GH-127365) (#127407) 2024-11-30 18:38:21 +02:00
Petr Viktorin
e33b6fccd3
[3.11] gh-111942: Remove an extra incref in textiowrapper_change_encoding (#126542) 2024-11-08 13:26:57 +01:00
Petr Viktorin
8c6885d636
[3.11] gh-87846: test_io: Ignore OpenWrapper in test___all__ (#126478) 2024-11-06 13:39:30 +00:00
Victor Stinner
ae961ae94b
[3.11] gh-124651: Quote template strings in venv activation scripts (GH-124712) (GH-126185) (#126269) 2024-11-01 13:11:47 +00:00
Zachary Ware
e84015f846
[3.11] gh-123418: Update CI to use fresh OpenSSL releases (GH-123675) (#123699)
* [3.11] gh-123418: Update CI to use fresh OpenSSL releases (GH-123675)

Also adds openssl/openssl GitHub URL template for newer OpenSSL downloads
(cherry picked from commit 56b00f4705)

Co-authored-by: Zachary Ware <zach@python.org>

* Adjust build_ubuntu_ssltests job to use cache for the correct OS version
2024-10-22 15:48:51 +00:00
Zachary Ware
affa2a9503
[3.11] Adjust build_ubuntu_ssltests job to use cache for the correct OS version (#124484) 2024-10-22 16:05:48 +01:00
Petr Viktorin
8630002c5c
[3.11] gh-125041: test_zlib: For s390x HW acceleration, only skip checking the compressed bytes (GH-125042) (#125577)
gh-125041: test_zlib: For s390x HW acceleration, only skip checking the compressed bytes (#125042)

(cherry picked from commit cc5a225cdc)
2024-10-22 12:11:14 +01:00
Pablo Galindo
8b275e77d2 Post 3.11.10 2024-09-07 02:34:11 +01:00
Pablo Galindo
0c47759eee Python 3.11.10 2024-09-07 02:03:31 +01:00
Petr Viktorin
2e2b1b5f99
[3.11] gh-102988: Adjust version numbers in versionadded directives (#123772) 2024-09-06 14:29:04 +02:00
Petr Viktorin
bc4a703a93
[3.11] [CVE-2023-27043] gh-102988: Reject malformed addresses in email.parseaddr() (GH-111116) (#123767)
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 12:46:23 +02:00