Commit graph

120480 commits

Author SHA1 Message Date
Miss Islington (bot)
65a01034e6
[3.12] gh-130655: Add tests for gettext.find() (GH-130691) (#132083)
gh-130655: Add tests for `gettext.find()` (GH-130691)

(cherry picked from commit 3118693a1a)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-04-04 16:39:22 +02:00
Miss Islington (bot)
10f73f75c5
[3.12] gh-132075: Fix possible use of sockaddr structures with uninitialized members (GH-132076) (GH-132087)
Now all structure members are initialized with zeroes by default.
(cherry picked from commit 345baa77ba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-04 14:29:12 +00:00
Steve Dower
701ac74d4a
gh-131423: Update OpenSSL build tag to 3.0.16.2 to fix ARM64 crash (GH-132051)
Backported from 24decb05dd
2025-04-03 18:04:29 +00:00
Tomas R.
da7ac18c9d
[3.12] gh-130197: pygettext: Test the --escape option (GH-131902) (GH-132033)
(cherry picked from commit 87d9983994)
2025-04-02 23:29:02 +03:00
Serhiy Storchaka
6f6b8b4ac9
[3.12] gh-89039: Call subclass constructors in datetime.*.replace (GH-114780) (GH-131239)
When replace() method is called on a subclass of datetime, date or time,
properly call derived constructor. Previously, only the base class's
constructor was called.

Also, make sure to pass non-zero fold values when creating subclasses in
various methods. Previously, fold was silently ignored.
(cherry picked from commit 46190d9ea8)

Co-authored-by: Eugene Toder <eltoder@users.noreply.github.com>
2025-04-02 20:35:16 +03:00
Miss Islington (bot)
e4fe4d9d53
[3.12] gh-131888: fix ResourceWarning in test_ftplib (GH-131889) (#132010)
gh-131888: fix ResourceWarning in test_ftplib (GH-131889)
(cherry picked from commit b0f77c4d25)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-04-02 12:46:40 +00:00
Miss Islington (bot)
b3cf1f27e9
[3.12] gh-132002: Fix crash of ContextVar on unhashable str subtype (GH-132003) (#132008)
gh-132002: Fix crash of `ContextVar` on unhashable `str` subtype (GH-132003)
(cherry picked from commit ab2a3dda1d)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-02 12:05:30 +00:00
Miss Islington (bot)
afb3f33256
[3.12] gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668) (GH-131977) (#131979)
[3.13] gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668) (GH-131977)

gh-111178: Fix getsockaddrarg() undefined behavior (GH-131668)

Don't pass direct references to sockaddr members since their type may
not match PyArg_ParseTuple() types. Instead, use temporary 'int' and
'unsigned char' variables, and update sockaddr members afterwards.

On FreeBSD, treat BTPROTO_HCI node name as a bytes string,
not as an integer.
(cherry picked from commit c318a03b17)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 8cd29c2b53)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-01 14:56:56 +00:00
Miss Islington (bot)
756676fc18
[3.12] gh-131736: only apply security_level workaround in test_ssl for security levels greater than 1 (GH-131739) (#131966)
gh-131736: only apply `security_level` workaround in `test_ssl` for security levels greater than 1 (GH-131739)
(cherry picked from commit 3b3720f1a2)

Co-authored-by: Will Childs-Klein <willck93@gmail.com>
2025-04-01 08:16:34 +00:00
Miss Islington (bot)
6cdd3a4e91
[3.12] Minor improvements to the programming FAQ (GH-127261) (#131965)
Minor improvements to the programming FAQ (GH-127261)
(cherry picked from commit 23a658b9af)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-01 07:26:36 +00:00
Miss Islington (bot)
ce85eb544d
[3.12] gh-125957: sync argument naming in sphinx docs of the cmath and help() (GH-125958) (#131963)
gh-125957: sync argument naming in sphinx docs of the cmath and help() (GH-125958)
(cherry picked from commit 0a3eb8855c)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-01 07:23:33 +00:00
Erlend E. Aasland
b1bbd0160d
[3.12] gh-129917: Update installers to use SQLite 3.49.1 (#131025) (#131958)
(cherry picked from commit 45a3ab5a81)

Co-authored-by: Ned Deily <nad@python.org>
2025-03-31 21:39:06 +00:00
Miss Islington (bot)
b87ea7d4e3
[3.12] gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (GH-131866) (#131951)
gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (GH-131866)

When using --with-dtrace the resulting object file could be missing
specific CFLAGS exported by the build system due to the systemtap
script using specific defaults.

Exporting the CC and CFLAGS variables before the dtrace invocation
allows us to properly apply CFLAGS exported by the build system
even when cross-compiling.

The fix does not affect the dtrace invocation on Solaris/macOS.
(cherry picked from commit 0cd4befb02)

Co-authored-by: stratakis <cstratak@redhat.com>
2025-03-31 18:29:04 +00:00
Miss Islington (bot)
5d4e891411
[3.12] gh-126033: fix UAF in xml.etree.ElementTree.Element.remove when concurrent mutations happen (GH-126124) (#131930)
gh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` when concurrent mutations happen (GH-126124)
(cherry picked from commit bab1398a47)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-31 14:50:13 +02:00
Bénédikt Tran
f1689b61fe
[3.12] gh-126037: fix UAF in xml.etree.ElementTree.Element.find* when concurrent mutations happen (#127964) (#131932)
gh-126037: fix UAF in `xml.etree.ElementTree.Element.find*` when concurrent mutations happen (#127964)

We fix a use-after-free in the `find`, `findtext` and `findall` methods of `xml.etree.ElementTree.Element`
objects that can be triggered when the tag to find implements an `__eq__` method that mutates the
element being queried.

(cherry picked from commit c57623c221)
2025-03-31 14:47:22 +02:00
Miss Islington (bot)
525eddf220
[3.12] gh-131885: Document that dict.setdefault and dict.get take no keyword arguments (GH-128208) (#131894)
gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (GH-128208)
(cherry picked from commit edfbd8c062)

Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
2025-03-30 09:29:49 +00:00
Miss Islington (bot)
f1b65d757d
[3.12] gh-129994: update docs when using dualstack_ipv6 in socket.create_server (GH-129996) (#131891)
gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server` (GH-129996)
(cherry picked from commit 044a1e13d5)

Co-authored-by: Alexander Ershov <150328014+AEErshov@users.noreply.github.com>
2025-03-30 10:28:26 +02:00
Miss Islington (bot)
85b6b0e2d2
[3.12] gh-131050: skip test_dh_params when TLS library lacks FFDHE ciphersuites (GH-131051) (#131875)
gh-131050: skip `test_dh_params` when TLS library lacks FFDHE ciphersuites (GH-131051)
(cherry picked from commit be2d2181e6)

Co-authored-by: Will Childs-Klein <willck93@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-29 10:51:11 +00:00
Miss Islington (bot)
3cd04d47dd
[3.12] gh-127541: Update os.walk example (GH-127765) (#131873)
gh-127541: Update os.walk example (GH-127765)

Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs.
(cherry picked from commit a5949986d6)

Co-authored-by: Totosuki <116938397+totosuki@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-29 10:34:35 +00:00
Steve Dower
dfb63723d2
gh-131423: Update to OpenSSL 3.0.16. (GH-131839)
The bin tag is 3.0.16.1 because we rebuilt without uplink support to fix gh-131804.
This PR also prevents making calls that are now unsafe without uplink, and updates
the tests to property interpret these failures as unsupported.
2025-03-28 15:29:20 +00:00
Miss Islington (bot)
7d447ac4e0
[3.12] gh-131807: fix ResourceWarning in test_ucn.py (GH-131808) (#131846)
gh-131807: fix ResourceWarning in test_ucn.py (GH-131808)
(cherry picked from commit adb67ed7e4)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-28 15:12:59 +00:00
Miss Islington (bot)
d4ddc03e56
[3.12] gh-127949: fix resource warnings in test_tasks.py (GH-128172) (#131806)
* gh-127949: fix resource warnings in `test_tasks.py` (GH-128172)
(cherry picked from commit b66a4ad9fc)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-03-28 14:25:39 +00:00
Donghee Na
940c937c13
[3.12] gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (#131828) 2025-03-28 14:55:58 +01:00
Miss Islington (bot)
4f7b66ab82
[3.12] gh-128446: Run Windows CI tests on each commit (GH-131702) (#131706)
gh-128446: Run Windows CI tests on each commit (GH-131702)
(cherry picked from commit 7d9442f0d5)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-28 13:08:47 +02:00
Miss Islington (bot)
0c88f414b8
[3.12] gh-131818: Add imply -P in -I's help message (GH-131819) (#131823)
gh-131818: Add imply `-P` in `-I`'s help message (GH-131819)
(cherry picked from commit 8bd88e2827)

Co-authored-by: Hang <bebound@gmail.com>
2025-03-28 08:09:03 +00:00
Miss Islington (bot)
b2dbc4f3a7
[3.12] Fix typo in importlib.metadata.rst (gh-131596) (#131631)
Fix typo in importlib.metadata.rst (gh-131596)
(cherry picked from commit 5fc889ffbf)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
2025-03-27 15:43:03 +02:00
Miss Islington (bot)
66042e180b
[3.12] gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (GH-131764) (#131775)
gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (GH-131764)
(cherry picked from commit 2c686a9ac2)

Co-authored-by: rialbat <47256826+rialbat@users.noreply.github.com>
2025-03-26 19:01:36 +00:00
Miss Islington (bot)
1826347d9d
[3.12] gh-131649: fix test_string_literals SyntaxWarning (GH-131650) (GH-131766) (#131772)
[3.13] gh-131649: fix test_string_literals SyntaxWarning (GH-131650) (GH-131766)

(cherry picked from commit 2d83891dfd)
(cherry picked from commit 5bcb476df1)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-03-26 16:47:55 +00:00
Miss Islington (bot)
b7c5371621
[3.12] gh-131741: Add documentation for Windows version detection change in platform (GH-131742) (#131768)
gh-131741: Add documentation for Windows version detection change in `platform` (GH-131742)

Document the behavior change between 3.11 & 3.12, where ``platform`` now correctly detects Windows 11 and Windows Server releases past Windows Server 2012.
(cherry picked from commit b9ca438daa)

Co-authored-by: Idan Noiman <idann@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>
Co-authored-by: Wulian <1055917385@qq.com>
2025-03-26 15:00:08 +00:00
Miss Islington (bot)
e78280d0de
[3.12] gh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679) (gh-131693)
The call to `with self.subTest(...)` was not thread-safe.
(cherry picked from commit a123245986)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-03-24 20:59:03 +00:00
Miss Islington (bot)
76e911a040
[3.12] gh-131670: Fix crash in anext() when __anext__ is sync and raises (GH-131682) (#131687)
gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (GH-131682)
(cherry picked from commit 929afd1d6e)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-24 19:18:29 +00:00
Miss Islington (bot)
8159805b87
[3.12] Docs: Fix documentation for "PyTypeObject Definition" (GH-130936) (GH-131459)
The structure definition for `PyTypeObject` is in `Include/cpython/object.h`,
not in `Include/object.h`.
(cherry picked from commit a0478c9f0c)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-03-24 13:59:40 +01:00
Bénédikt Tran
8a9aee7126
[3.12] gh-131045: [Enum] fix flag containment checks when using values (GH-131053) (#131232)
* gh-131045: [Enum] fix flag containment checks when using values (GH-131053)

Check would fail if value would create a pseudo-member, but that member
had not yet been created.  We now attempt to create a pseudo-member for
a passed-in value first.

---------

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-03-24 10:31:24 +01:00
Nybblista
7f2de07808
[3.12] gh-131357: Add a set of asserts to test.test_capi.test_bytearray (GH-131554) (#131629)
[3.12] gh-131357: Add a set of asserts to test.test_capi.test_bytearray (#131554)

add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.

(cherry picked from commit f3bf304c27)
2025-03-23 17:43:12 +00:00
Miss Islington (bot)
3911bd5cc3
[3.12] gh-130283: update deprecated links and examples in urllib.request docs (GH-130284) (#131627)
gh-130283: update deprecated links and examples in `urllib.request` docs (GH-130284)
(cherry picked from commit fd459b1153)

Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-23 13:36:32 +00:00
Miss Islington (bot)
7d5b8131b1
[3.12] gh-121529: Document from_ parameter in _mboxMMDF public methods (GH-121530) (#131622)
gh-121529: Document `from_` parameter in `_mboxMMDF` public methods (GH-121530)
(cherry picked from commit 557d2d20d4)

Co-authored-by: Sebb <sebbASF@users.noreply.github.com>
2025-03-23 12:18:32 +00:00
Miss Islington (bot)
63a4273031
[3.12] gh-131418: remove unused legacy typedefs in {md5,sha1}module.c (GH-131420) (#131619)
gh-131418: remove unused legacy typedefs in `{md5,sha1}module.c` (GH-131420)

- Remove legacy typedefs `MD5_INT32` and `MD5_INT64` in `Modules/md5module.c`
- Remove legacy typedefs `SHA1_INT32` and `SHA1_INT64` in `Modules/sha1module.c`.

Those legacy typedefs were used to detect whether the host platform could
correctly implement MD5 and SHA-1, but this is no longer needed as we now
fallback to HACL* implementations.
(cherry picked from commit a9a399f0ec)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-23 11:39:46 +00:00
Miss Islington (bot)
b1e2384335
[3.12] gh-131457: Fix typo in BNF description of function signatures (GH-131460) (#131576)
gh-131457: Fix typo in BNF description of function signatures (GH-131460)
(cherry picked from commit 8b7d20d3a9)

Co-authored-by: Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్  రెడ్డి) <thatiparthysreenivas@gmail.com>
2025-03-22 08:01:47 +00:00
Miss Islington (bot)
2d6a778f73
[3.12] gh-131492, gh-131461: handle exceptions in GzipFile constructor while owning resources (GH-131462) (#131519)
(cherry picked from commit ce79274e9f)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-21 11:21:40 +01:00
luccabb
3d1f8cae48
[3.12] gh-88887: Cleanup multiprocessing.resource_tracker.ResourceTracker upon deletion (GH-130429) (#131530)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
(cherry picked from commit f53e7de6a8)
2025-03-21 11:15:35 +01:00
Nybblista
30e38b9dc6
[3.12] gh-131441: Add a set of asserts to test.test_capi.test_list (#131442) (#131533)
gh-131441: Add a set of asserts to test.test_capi.test_list (#131442)

(cherry picked from commit 2433cc79d7)
2025-03-21 10:56:21 +03:00
Gregory P. Smith
3eb7a9024b
[3.12] gh-70647: update docs to mention the datetime 1900 year default 2/29 issue (#131534)
* gh-70647: Better promote how to safely parse yearless dates in datetime.

Every four years people encounter this because it just isn't obvious.
This moves the footnote up to a note with a code example.

We'd love to change the default year value for datetime but doing
that could have other consequences for existing code.  This documented
workaround *always* works.

* doctest code within note is bad, dedent.
2025-03-20 21:50:10 -07:00
Adam Turner
e1626c3b70
[3.12] GH-121970: Extract pydoc_topics into a new extension (GH-131256) (#131512)
(cherry picked from commit c1a02f9101)
2025-03-20 15:40:37 +00:00
Miss Islington (bot)
caa73883f9
[3.12] Docs: Fix documentation for "PyTypeObject Definition" (GH-130936) (GH-131459)
The structure definition for `PyTypeObject` is in `Include/cpython/object.h`,
not in `Include/object.h`.
(cherry picked from commit a0478c9f0c)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-03-20 13:41:22 +01:00
Miss Islington (bot)
105bc83b78
[3.12] gh-131417: Mention asyncio Future and Task in docs for generic classes list (GH-131422) (#131446)
gh-131417: Mention asyncio Future and Task in docs for generic classes list (GH-131422)

Mention asyncio Future and Task in docs for generic classes list
(cherry picked from commit 61b4b2c57c)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2025-03-19 10:24:16 +01:00
Miss Islington (bot)
981566e399
[3.12] Docs: fix shell command formatting (GH-131310) (#131444)
Docs: fix shell command formatting (GH-131310)

replace "zypper in" with "zypper install" to avoid incorrect highlighting
(cherry picked from commit 267c06d6a8)

Co-authored-by: partev <petrosyan@gmail.com>
2025-03-19 07:52:17 +00:00
Miss Islington (bot)
5dfb5e640e
[3.12] gh-121284: Fix email address header folding with parsed encoded-word (GH-122754) (#131404)
gh-121284: Fix email address header folding with parsed encoded-word (GH-122754)

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-03-18 15:35:32 -04:00
Bénédikt Tran
865bd6de99
[3.12] gh-131277: allow EnvironmentVarGuard to unset more than one environment variable at once (GH-131280) (#131410)
(cherry picked from commit 3185e3115c)

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-18 13:46:24 +01:00
Miss Islington (bot)
38ef8d78bb
[3.12] gh-131261: Update libexpat to 2.7.0 (CVE-2024-8176) (GH-131361)
[3.13] gh-131261: Update libexpat to 2.7.0 (CVE-2024-8176)

(cherry picked from commit bb0268f60d)
(cherry picked from commit 6af54d298d)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-03-18 13:18:10 +01:00
Miss Islington (bot)
7a8097c57a
[3.12] gh-116666: Add "token" glossary term (GH-130888) (GH-131368)
gh-116666: Add "token" glossary term (GH-130888)

Add glossary entry for `token`, and link to it.
Avoid talking about tokens in the SyntaxError intro (errors.rst); at this point
tokenization is too much of a technical detail. (Even to an advanced reader,
the fact that a *single* token is highlighted isn't too relevant. Also, we don't
need to guarantee that it's a single token.)
(cherry picked from commit 30d5205849)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-18 12:51:09 +01:00