Commit graph

120531 commits

Author SHA1 Message Date
Serhiy Storchaka
c555f889c3
[3.12] gh-135661: Fix parsing start and end tags in HTMLParser according to the HTML5 standard (GH-135930) (GH-136268)
Some checks failed
Tests / Change detection (push) Has been cancelled
Lint / lint (push) Has been cancelled
Tests / (push) Has been cancelled
Tests / Docs (push) Has been cancelled
Tests / Check if the ABI has changed (push) Has been cancelled
Tests / All required checks pass (push) Has been cancelled
Tests / Check if Autoconf files are up to date (push) Has been cancelled
Tests / Check if generated files are up to date (push) Has been cancelled
Tests / Windows MSI (push) Has been cancelled
Tests / Ubuntu SSL tests with OpenSSL (push) Has been cancelled
Tests / Hypothesis tests on Ubuntu (push) Has been cancelled
Tests / Address sanitizer (push) Has been cancelled
* Whitespaces no longer accepted between `</` and the tag name.
  E.g. `</ script>` does not end the script section.

* Vertical tabulation (`\v`) and non-ASCII whitespaces no longer recognized
  as whitespaces. The only whitespaces are `\t\n\r\f `.

* Null character (U+0000) no longer ends the tag name.

* Attributes and slashes after the tag name in end tags are now ignored,
  instead of terminating after the first `>` in quoted attribute value.
  E.g. `</script/foo=">"/>`.

* Multiple slashes and whitespaces between the last attribute and closing `>`
  are now ignored in both start and end tags. E.g. `<a foo=bar/ //>`.

* Multiple `=` between attribute name and value are no longer collapsed.
  E.g. `<a foo==bar>` produces attribute "foo" with value "=bar".

* Whitespaces between the `=` separator and attribute name or value are no
  longer ignored. E.g. `<a foo =bar>` produces two attributes "foo" and
  "=bar", both with value None; `<a foo= bar>` produces two attributes:
  "foo" with value "" and "bar" with value None.

* Fix data loss after unclosed script or style tag (gh-86155).

Also backport test.support.subTests() (gh-135120).

---------
(cherry picked from commit 0243f97cba)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Waylan Limberg <waylan.limberg@icloud.com>
2025-07-04 17:28:00 +02:00
Serhiy Storchaka
ab0893fd5c
[3.12] gh-135462: Fix quadratic complexity in processing special input in HTMLParser (GH-135464) (GH-135483)
Some checks are pending
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Check if the ABI has changed (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Lint / lint (push) Waiting to run
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-04 00:12:10 +02:00
Łukasz Langa
033aa5cfd8
[3.12] gh-132415: Update vendored setuptools in `Lib/test/wheeldata (GH-132887) (GH-135393)
Some checks failed
Lint / lint (push) Has been cancelled
Tests / Change detection (push) Has been cancelled
Tests / All required checks pass (push) Has been cancelled
Tests / (push) Has been cancelled
Tests / Docs (push) Has been cancelled
Tests / Check if the ABI has changed (push) Has been cancelled
Tests / Check if Autoconf files are up to date (push) Has been cancelled
Tests / Check if generated files are up to date (push) Has been cancelled
Tests / Windows MSI (push) Has been cancelled
Tests / Ubuntu SSL tests with OpenSSL (push) Has been cancelled
Tests / Hypothesis tests on Ubuntu (push) Has been cancelled
Tests / Address sanitizer (push) Has been cancelled
(cherry picked from commit c9f3f5b4ed)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-06-11 17:28:51 +02:00
Miss Islington (bot)
d43cb4f31a
[3.12] gh-132415: Use shutil.which() in missing_compiler_executable() (GH-132906) (GH-135392)
Replace deprecated distutils.spawn.find_executable() with
shutil.which() in missing_compiler_executable() of test.support.
(cherry picked from commit de6482eda3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-11 17:00:01 +02:00
Thomas Wouters
fd6c5fe786 Post 3.12.11 2025-06-03 20:31:47 +02:00
Thomas Wouters
55fee9cf21 Python 3.12.11 2025-06-03 17:41:47 +02:00
Petr Viktorin
28463dba11
[3.12] gh-135034: Remove test_realpath_permission (GH-135093)
The test was added in gh-110298, with a fix that was never backported
to 3.12 and below.
It was most likely skipped in the GHA run.
2025-06-03 16:58:06 +02:00
Miss Islington (bot)
fcf3ea0f99
[3.12] gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (GH-134836) (GH-134847)
(cherry picked from commit d83576bf48)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-06-03 16:25:28 +02:00
Miss Islington (bot)
3217780bbe
[3.12] gh-123409: fix IPv6Address.reverse_pointer for IPv4-mapped addresses (GH-123419) (GH-135086)
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:08:03 +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)
f3272d8630
[3.12] gh-87799: Improve the textual representation of IPv4-mapped IPv6 addresses (GH-29345) (GH-135081)
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: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2025-06-03 15:45:32 +02:00
Miss Islington (bot)
d4cf1fafaf
[3.12] gh-128840: Limit the number of parts in IPv6 address parsing (GH-128841) (#134612)
gh-128840: Limit the number of parts in IPv6 address parsing (GH-128841)

GH-128840: Limit the number of parts in IPv6 address parsing
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-05-25 20:34:44 -07:00
Miss Islington (bot)
d02823e8c4
[3.12] gh-134062: Fix hash collisions in IPv4Network and IPv6Network (GH-134063) (#134478)
gh-134062: Fix hash collisions in IPv4Network and IPv6Network (GH-134063)
(cherry picked from commit f3fc0c16e0)


gh-134062: Fix hash collisions in IPv4Network and IPv6Network
gh-134062: Add hash collision regression test

Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>
2025-05-25 20:34:22 -07:00
Serhiy Storchaka
4398b788ff
[3.12] gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler (GH-129648) (GH-133944) (#134337)
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)
2025-05-25 20:33:22 -07:00
Miss Islington (bot)
310cd8943a
[3.12] gh-133410: Fix PR detection in build workflow (GH-133671) (#134057)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-05-15 17:04:54 +03: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)
483729fbc6
[3.12] GH-133410: Use commit hashes for change detection (gh-133416) (#133426)
GH-133410: Use commit hashes for change detection (gh-133416)
(cherry picked from commit d530e74e44)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-06 01:48:34 +02:00
Victor Stinner
aeb3a6f61a
[3.12] gh-132553: Build the perf tool without buildid cache (GH-132663) (#132718)
gh-132553: Build the perf tool without buildid cache (GH-132663)

(cherry picked from commit e01e582902)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-04-25 02:26:30 +01: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
Thomas Wouters
a740fbd8de Post 3.12.10 2025-04-08 16:17:38 +02:00
Thomas Wouters
0cc8128036 Python 3.12.10 2025-04-08 13:35:47 +02:00
Miss Islington (bot)
a05e9301ab
[3.12] gh-117779: Fix reading duplicated entries in zipfile by name (GH-129254) (GH-132264)
(cherry picked from commit 0f04f2456a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-08 11:13:09 +00:00
sobolevn
b41e008edb
[3.12] gh-101137: Add text/x-rst to mimetypes (GH-118593) (GH-118599) 2025-04-08 12:40:41 +02: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
sobolevn
492a554cfc
[3.12] gh-130775: Allow negative locations in ast (GH-130795) (#132260)
(cherry picked from commit bc5233b6a5)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-08 10:19:23 +00:00
Miss Islington (bot)
40f81e1060
[3.12] gh-130164: Fix inspect.Signature.bind() handling of positional-only args without defaults (GH-130192) (GH-132259)
Follow-up to 9c15202.
(cherry picked from commit dab456dcef)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2025-04-08 09:39:45 +00: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)
ed01daf82e
[3.12] gh-131809: Upgrade vendored expat to 2.7.1 (GH-132192) (#132237)
* gh-131809: Upgrade vendored expat to 2.7.1 (GH-132192)
(cherry picked from commit c0de650024)

Co-authored-by: Gregory P. Smith <greg@krypto.org>

* make regen-sbom

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-04-07 21:21:02 +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)
33834cb2b3
[3.12] gh-131852: Filter out POT-Creation-Date in msgfmt (GH-131880) (GH-132216)
(cherry picked from commit ad6a032ceb)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-04-07 11:52:22 +00:00
Miss Islington (bot)
81bc2cc7fd
[3.12] gh-122040: reword Modules/xxmodule.c module-level comment (GH-132201) (#132208)
gh-122040: reword `Modules/xxmodule.c` module-level comment (GH-132201)
(cherry picked from commit af8d1b9537)

Co-authored-by: Sonny Ding <93831983+sonnyding1@users.noreply.github.com>
2025-04-07 08:19:54 +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)
49840d6230
[3.12] gh-124111: Update macOS installer to use Tcl/Tk 8.6.16. (GH-132190)
(cherry picked from commit c55c0201fc)
Co-authored-by: Ned Deily <nad@python.org>
2025-04-07 02:01:25 -04:00
Miss Islington (bot)
6ca6c09eb2
[3.12] gh-131423: Update macOS installer to use OpenSSL 3.0.16. (GH-132189)
Patch by Bénédikt Tran.
(cherry picked from commit ce49022b07)
Co-authored-by: Ned Deily <nad@python.org>
2025-04-07 01:41:25 -04:00
Miss Islington (bot)
81445c2272
[3.12] gh-91132: Update macOS installer to use ncurses 6.5. (GH-129990)
(cherry picked from commit 0dbe543d70)

Co-authored-by: Ned Deily <nad@python.org>
2025-04-06 23:46:16 -04: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)
55b230333f
[3.12] GH-107674: Avoid allocating boxed ints for sys.settrace line events (GH-107780) (#107841)
GH-107674: Avoid allocating boxed ints for `sys.settrace` line events (GH-107780)
(cherry picked from commit 37d8b904f8)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2025-04-06 19:48:53 +00:00
Miss Islington (bot)
0bfb3ba974
[3.12] Docs: Replace dead hyperlink for CGI environment variables (GH-132137) (#132151)
Docs: Replace dead hyperlink for CGI environment variables (GH-132137)
(cherry picked from commit 0a10b45dd1)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
2025-04-06 08:29:09 +00:00
Miss Islington (bot)
c124ae9d0b
[3.12] gh-132134: Add the clangd `.cache directory to .gitignore` (GH-132135) (#132145)
gh-132134: Add the clangd ``.cache`` directory to ``.gitignore`` (GH-132135)
(cherry picked from commit 86804003ed)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
2025-04-06 04:42: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
Bénédikt Tran
6dab90a403
[3.12] gh-131015: Add test for bytes formatting errors (#131881) (#132114)
* gh-131015: Add test for bytes formatting errors (#131881)

Co-authored-by: Ageev Maxim <maksim170901@gmail.com>
(cherry picked from commit 05557788f3)
2025-04-05 11:40:48 +02: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)
1d8cd48f26
[3.12] Fix typo in template_replace() test helper docstring (GH-132094) (#132096)
Fix typo in `template_replace()` test helper docstring (GH-132094)
(cherry picked from commit ac3a7bfecc)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
2025-04-04 20:04:01 +02:00
Tomasz Pytel
3d3e7b0ada
[3.12] gh-128632: fix segfault on nested __classdict__ type param (GH… (#132090)
(cherry picked from commit 891c61c1fa)

Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
2025-04-04 15:48:57 +00:00
Miss Islington (bot)
05213afaa7
[3.12] gh-130655: Add a test for corrupt .mo files in gettext (GH-131911) (#132080)
gh-130655: Add a test for corrupt `.mo` files in `gettext` (GH-131911)
(cherry picked from commit a126cefc17)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-04-04 16:49:48 +02:00