summaryrefslogtreecommitdiff
path: root/Lib
AgeCommit message (Collapse)AuthorLines
2025-06-03Python 3.11.13v3.11.13Pablo Galindo-1/+1
2025-06-03[3.11] gh-135034: Normalize link targets in tarfile, add ↵T. Wouters-134/+928
`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 3612d8f51741b11f36f8fb0494d79086bac9390a) (cherry picked from commit c358142cab7ce621a2745262a90df967b357f61c) 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[3.11] gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address ↵Miss Islington (bot)-6/+23
(GH-134836) (GH-135091) (cherry picked from commit d83576bf48d07d5e29d5d171c4e25afb048622aa) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-06-03[3.11] gh-123409: fix `IPv6Address.reverse_pointer` for IPv4-mapped ↵Miss Islington (bot)-12/+51
addresses (GH-123419) (GH-135087) Fix functionality that was broken with better textual representation for IPv4-mapped addresses (gh-87799) (cherry picked from commit 77a2fb4bf1a1b160d6ce105508288fc77f636943) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-03[3.11] gh-128840: Limit the number of parts in IPv6 address parsing ↵Miss Islington (bot)-2/+20
(GH-128841) (GH-134613) Limit length of IP address string to 39 (cherry picked from commit 47f1161d3a2bec52b5b5e952150141709c247da2) 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[3.11] gh-87799: Improve the textual representation of IPv4-mapped IPv6 ↵Miss Islington (bot)-1/+44
addresses (GH-29345) (GH-135080) Represent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.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 f22bf8e3cf899896cf587099d29290cb43aa9724) Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2025-06-02[3.11] gh-134062: Fix hash collisions in IPv4Network and IPv6Network ↵Miss Islington (bot)-1/+29
(GH-134063) (GH-134479) (cherry picked from commit f3fc0c16e08b317cb201cf1073e934e6909f1251) Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>
2025-06-02[3.11] gh-133767: Fix use-after-free in the unicode-escape decoder with an ↵Serhiy Storchaka-11/+79
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 9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e) (cherry picked from commit 6279eb8c076d89d3739a6edb393e43c7929b429d) (cherry picked from commit a75953b347716fff694aa59a7c7c2489fa50d1f5) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-14[3.11] gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ↵Miss Islington (bot)-5/+12
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 (5b95eb90a7167285b6544b50865227c584943c9a) 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 c9cda1608edf7664c10f4f467e24591062c2fe62) (cherry picked from commit aee80cd5e7c6be90c69b9aa9c09faa19b91cdccd) Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-04-08Python 3.11.12v3.11.12Pablo Galindo-1/+1
2025-04-03[3.11] gh-121284: Fix email address header folding with parsed encoded-word ↵Miss Islington (bot)-5/+30
(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 295b53df2aa18deb625a7da41f7e4babfe6ef34b) 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-03-14[3.11] gh-106883: Make test_current_frames_exceptions_deadlock faster (#131182)Diego Russo-8/+4
2025-03-11[3.11] gh-106883 Fix deadlock in threaded application (#117332)Diego Russo-0/+74
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-02-27[3.11] GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550) ↵Miss Islington (bot)-1/+5
(GH-130573) (#130593)
2025-02-19[3.11] gh-119511: Fix a potential denial of service in imaplib (GH-119514) ↵Miss Islington (bot)-1/+24
(#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 735f25c5e3a0f74438c86468ec4dfbe219d93c91) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-02-19[3.11] gh-105704: Disallow square brackets (`[` and `]`) in domain names for ↵Miss Islington (bot)-3/+54
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[3.11] gh-80222: Fix email address header folding with long quoted-string ↵Miss Islington (bot)-3/+47
(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 5aaf41685834901e4ed0a40f4c055b92991a0bb5) Co-authored-by: Mike Edmunds <medmunds@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-02-19[3.11] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) (#130276)Miss Islington (bot)-9/+22
Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-02-13[3.11] gh-119461: Restore the testSocket VSOCK skipUnless removed by PR ↵Miss Islington (bot)-0/+2
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 e1006ce1ded1b18972888ef057718dba6f2c7edd) Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-01-23[3.11] gh-119461: Fix ThreadedVSOCKSocketStreamTest (#129171)Victor Stinner-5/+10
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 e94dbe4ed83460f18bd72563c5f09f6cdc71f604) (cherry picked from commit c750061047ee520d8299334df4b112fd983d7e48) (cherry picked from commit cbfe3023e46b544b80ea1a38a8c900c6fb881554)
2024-12-03Python 3.11.11v3.11.11Pablo Galindo-1/+1
2024-12-03[3.11] gh-122792: Make IPv4-mapped IPv6 address properties consistent with ↵Miss Islington (bot)-5/+46
IPv4 (GH-122793) (GH-123818) Make IPv4-mapped IPv6 address properties consistent with IPv4. (cherry picked from commit 76a1c5d18312712baed4699fe7333abb050ec9b7) 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-11-06[3.11] gh-87846: test_io: Ignore OpenWrapper in test___all__ (#126478)Petr Viktorin-1/+5
2024-11-01[3.11] gh-124651: Quote template strings in `venv` activation scripts ↵Victor Stinner-21/+134
(GH-124712) (GH-126185) (#126269)
2024-10-22[3.11] gh-125041: test_zlib: For s390x HW acceleration, only skip checking ↵Petr Viktorin-10/+15
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 cc5a225cdc2a5d4e035dd08d59cef39182c10a6c)
2024-09-07Python 3.11.10v3.11.10Pablo Galindo-5/+5
2024-09-06[3.11] [CVE-2023-27043] gh-102988: Reject malformed addresses in ↵Petr Viktorin-17/+338
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 4a153a1d3b18803a684cd1bcc2cdf3ede3dbae19) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Thomas Dwyer <github@tomd.tel>
2024-09-04[3.11] gh-123270: Replaced SanitizedNames with a more surgical fix. ↵Jason R. Coombs-67/+74
(GH-123354) (#123425) Applies changes from zipp 3.20.1 and jaraco/zippGH-124 (cherry picked from commit 2231286d78d328c2f575e0b05b16fe447d1656d6) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> * Restore the slash-prefixed paths in the malformed_paths test.
2024-09-04[3.11] gh-123067: Fix quadratic complexity in parsing "-quoted cookie values ↵Miss Islington (bot)-26/+46
with backslashes (GH-123075) (#123105) This fixes CVE-2024-7592. (cherry picked from commit 44e458357fca05ca0ae2658d62c8c595b048b5ef) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-04[3.11] gh-67693: Fix urlunparse() and urlunsplit() for URIs with path ↵Serhiy Storchaka-4/+68
starting with multiple slashes and no authority (GH-113563) (#119025) (cherry picked from commit e237b25a4fa5626fcd1b1848aa03f725f892e40e)
2024-09-04[3.11] gh-121650: Encode newlines in headers, and verify headers are sound ↵Łukasz Langa-4/+121
(GH-122233) (#122608) 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. Verify that email headers are well-formed. This should fail for custom fold() implementations that aren't careful about newlines. (cherry picked from commit 097633981879b3c9de9a1dd120d3aa585ecc2384) 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-03[3.11] gh-121285: Remove backtracking when parsing tarfile headers ↵Seth Michael Larson-38/+109
(GH-121286) (#123639) * Remove backtracking when parsing tarfile headers * Rewrite PAX header parsing to be stricter * Optimize parsing of GNU extended sparse headers v0.0 (cherry picked from commit 34ddb64d088dd7ccc321f6103d23153256caa5d4) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-08-20[3.11] gh-122905: Sanitize names in zipfile.Path. (GH-122906) (#122925)Jason R. Coombs-1/+77
* gh-122905: Sanitize names in zipfile.Path. (#122906) Ported from zipp 3.19.1; ref jaraco/zipp#119. (cherry picked from commit 9cd03263100ddb1657826cc4a71470786cab3932) * [3.11] gh-122905: Sanitize names in zipfile.Path. (GH-122906) Ported from zipp 3.19.1; ref jaraco/zippGH-119. (cherry picked from commit 9cd03263100ddb1657826cc4a71470786cab3932) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-08-09[3.11] gh-119506: fix _io.TextIOWrapper.write() write during flush (#119507) ↵Inada Naoki-0/+22
(#120314) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> fix _io.TextIOWrapper.write() write during flush (#119507)
2024-08-02[3.11] gh-122133: Rework pure Python socketpair tests to avoid use of ↵Miss Islington (bot)-77/+64
importlib.reload. (GH-122493) (GH-122506) (cherry picked from commit f071f01b7b7e19d7d6b3a4b0ec62f820ecb14660) Co-authored-by: Russell Keith-Magee <russell@keith-magee.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-07-30[3.11] gh-122133: Authenticate socket connection for `socket.socketpair()` ↵Miss Islington (bot)-3/+142
fallback (GH-122134) (#122426) Authenticate socket connection for `socket.socketpair()` fallback when the platform does not have a native `socketpair` C API. We authenticate in-process using `getsocketname` and `getpeername` (thanks to Nathaniel J Smith for that suggestion). (cherry picked from commit 78df1043dbdce5c989600616f9f87b4ee72944e5) Co-authored-by: Seth Michael Larson <seth@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-07-22[3.11] gh-121957: Emit audit events for python -i and python -m asyncio ↵Łukasz Langa-0/+2
(GH-122118)
2024-05-24[3.11] gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488) (GH-118739)Steve Dower-0/+40
2024-05-23[3.11] gh-118643: Fix AttributeError in the email module (GH-119099) (#119393)Serhiy Storchaka-5/+23
Fix regression introduced in gh-100884: AttributeError when re-fold a long address list. Also fix more cases of incorrect encoding of the address separator in the address list missed in gh-100884. (cherry picked from commit 858b9e85fcdd495947c9e892ce6e3734652c48f2)
2024-04-25[3.11] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges ↵Petr Viktorin-20/+100
(GH-113179) (GH-113186) (GH-118177) (#118227)
2024-04-03[3.11] gh-109120: Fix syntax error in handlinh of incorrect star ↵Grigoriev Semyon-7/+19
expressions… (#117464) gh-109120: Fix syntax error in handlinh of incorrect star expressions (#117444) (cherry picked from commit c97d3af2391e62ef456ef2365d48ab9b8cdbe27b)
2024-04-02Merge remote-tracking branch 'upstream/3.11' into 3.11Pablo Galindo-1/+2
2024-04-02[3.11] gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076)Miss Islington (bot)-1/+2
gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076) (cherry picked from commit 52f5b7f9e05fc4a25e385c046e0b091641674556) Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-04-02Python 3.11.9v3.11.9Pablo Galindo-60/+88
2024-03-29[3.11] [3.12] gh-117347: Fix test_clinic side effects (GH-117363) ↵Miss Islington (bot)-0/+18
(GH-117365) (#117366) [3.12] gh-117347: Fix test_clinic side effects (GH-117363) (GH-117365) gh-117347: Fix test_clinic side effects (GH-117363) Save/restore converters in ClinicWholeFileTest and ClinicExternalTest. (cherry picked from commit c80d13838dbcfe239eeabfd950bc524d797e6db1) Co-authored-by: Victor Stinner <vstinner@python.org> (cherry picked from commit 35b6c4a4da201a947b2ceb96ae4c0d83d4d2df4f) Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-29[3.11] gh-117110: Fix subclasses of typing.Any with custom constructors ↵Miss Islington (bot)-1/+21
(GH-117111) (#117358) gh-117110: Fix subclasses of typing.Any with custom constructors (GH-117111) (cherry picked from commit 8eec7ed714e65d616573b7331780b0aa43c6ed6a) Co-authored-by: 傅立业(Chris Fu) <17433201@qq.com>
2024-03-28[3.11] gh-114331: Skip decimal test_maxcontext_exact_arith on s390x ↵Victor Stinner-1/+10
(#117326) (#117331) gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (#117326) Add test.support.skip_on_s390x decorator. (cherry picked from commit 6702d2bf6edcd5b5415e17837383623b9d76a5b8)
2024-03-28[3.11] gh-117178: Recover lazy loading of self-referential modules ↵Miss Islington (bot)-6/+23
(GH-117179) (#117320) Co-authored-by: Chris Markiewicz <effigies@gmail.com>
2024-03-27[3.11] gh-104242: Enable test_is_char_device_true in pathlib test on all ↵Miss Islington (bot)-5/+5
platform (GH-116983) (GH-117277) (GH-117280) (cherry picked from commit 17a82a1d16a46b6c008240bcc698619419ce5554) (cherry picked from commit af1b0e94400d1bf732466d675054df8cf7dfb62d) Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-03-26[3.11] [3.12] gh-115538: Use isolate mode when running venv ↵Miss Islington (bot)-1/+1
test_multiproces… (GH-117264) (#117265) [3.12] gh-115538: Use isolate mode when running venv test_multiproces… (GH-117264) [3.12] gh-115538: Use isolate mode when running venv test_multiprocessing_recursion() (GH-117116) (cherry picked from commit 4ec347760f98b156c6a2d42ca397af6b0b6ecc50) (cherry picked from commit ca0793980b90a6a0f9a91f1a5303a1f27b235f83) Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>