Commit graph

119064 commits

Author SHA1 Message Date
Miss Islington (bot)
52f1fb6f7d
[3.12] Link to the Python type system specification (GH-117400) (#117448)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-04-02 09:29:10 +00:00
Miss Islington (bot)
a4a8af07cf
[3.12] Docs: specify XML document name in xml.etree.elementtree example (GH-24223) (#117429)
(cherry picked from commit 9dae05ee59)

Co-authored-by: Moshe Kaplan <mosheekaplan@gmail.com>
2024-04-01 22:02:34 +02:00
Miss Islington (bot)
4a3fc49d2d
[3.12] Docs: add more links to PIPE in subprocess docs (GH-25416) (#117427)
(cherry picked from commit fc2071687b)

Co-authored-by: Matthew Davis <7035647+mdavis-xyz@users.noreply.github.com>
2024-04-01 19:56:36 +00:00
Miss Islington (bot)
87e470b039
[3.12] build(deps): bump actions/add-to-project from 0.6.0 to 1.0.0 (GH-117415) (#117420)
build(deps): bump actions/add-to-project from 0.6.0 to 1.0.0 (GH-117415)
(cherry picked from commit 3bb12e407c)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 12:35:55 +02:00
Miss Islington (bot)
0b23bc334c
[3.12] gh-102190: Add additional zipfile pwd= arg docstrings (gh-102195) (GH-117408)
gh-102190: Add additional zipfile `pwd=` arg docstrings (gh-102195)

This just documents the parameter that already exists.

---------

(cherry picked from commit a32d693948)

Co-authored-by: Deborah <32307299+dlwrnc@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-03-31 18:53:51 -07:00
Miss Islington (bot)
b912d2b24a
[3.12] gh-117387 Remove hash mark from introductory text (GH-117409) (#gh- 2024-03-31 21:24:28 +00:00
Victor Stinner
c80d13838d
[3.12] gh-117347: Fix test_clinic side effects (#117363) (#117365)
gh-117347: Fix test_clinic side effects (#117363)

Save/restore converters in ClinicWholeFileTest and
ClinicExternalTest.

(cherry picked from commit 35b6c4a4da)
2024-03-29 12:04:25 +01:00
Miss Islington (bot)
2a18945dc6
[3.12] Fix reversed assertRegex checks in test_ssl. (GH-117351) (#117359)
Fix reversed assertRegex checks in test_ssl. (GH-117351)
(cherry picked from commit 2e9be80c99)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-29 01:19:04 +00:00
Miss Islington (bot)
9f831f442c
[3.12] gh-117110: Fix subclasses of typing.Any with custom constructors (GH-117111) (#117357)
gh-117110: Fix subclasses of typing.Any with custom constructors (GH-117111)
(cherry picked from commit 8eec7ed714)

Co-authored-by: 傅立业(Chris Fu) <17433201@qq.com>
2024-03-29 00:36:14 +00:00
Christopher Chianelli
655c4255fc
[3.12] gh-117339: Use NULL instead of None for LOAD_SUPER_ATTR in dis docs (GH-117343) (GH-117345) 2024-03-29 06:27:16 +08:00
Miss Islington (bot)
1e48de61ac
[3.12] gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (GH-117326) (#117327)
gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (GH-117326)
(cherry picked from commit 6702d2bf6e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-28 18:28:20 +01:00
Miss Islington (bot)
5a6318f2aa
[3.12] gh-117310: Remove extra DECREF on "no ciphers" error path in _ssl._SSLContext constructor (GH-117309) (GH-117317)
gh-117310: Remove extra DECREF on "no ciphers" error path in `_ssl._SSLContext` constructor (GH-117309)

Remove extra self DECREF on ssl "no ciphers" error path.

This doesn't come up in practice because nobody links against a broken
OpenSSL library that provides nothing.
(cherry picked from commit 8cb7d7ff86)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-28 10:04:57 -07:00
Miss Islington (bot)
552b2646b7
[3.12] gh-117178: Recover lazy loading of self-referential modules (GH-117179) (#117319)
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
2024-03-28 11:15:16 +00:00
Miss Islington (bot)
8d42c57789
[3.12] gh-99108: Update and check HACL* version information (GH-117295) (GH-117302)
gh-99108: Update and check HACL* version information (GH-117295)

(cherry picked from commit 669ef49c7d)

Co-authored-by: Seth Michael Larson <seth@python.org>
2024-03-27 22:16:19 +00:00
AN Long
17a82a1d16
[3.12] gh-104242: Enable test_is_char_device_true in pathlib test on all platform (GH-116983) (GH-117277)
(cherry picked from commit af1b0e9440)
2024-03-27 10:42:37 +02:00
Miss Islington (bot)
932194dc00
[3.12] Change links on the index page (GH-117230) (#117268)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2024-03-26 19:14:20 +00:00
AN Long
ca0793980b
[3.12] gh-115538: Use isolate mode when running venv test_multiproces… (#117264)
[3.12] gh-115538: Use isolate mode when running venv test_multiprocessing_recursion() (GH-117116)
(cherry picked from commit 4ec347760f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-26 17:53:37 +01:00
Miss Islington (bot)
0b95ba0306
[3.12] pre-commit: add check-case-conflict and check-merge-conflict (GH-117259) (#117260)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-26 16:12:36 +02:00
Miss Islington (bot)
36b1a20851
[3.12] gh-66543: Fix mimetype.guess_type() (GH-117217) (GH-117256)
Fix parsing of the following corner cases:

* URLs with only a host name
* URLs containing a fragment
* URLs containing a query
* filenames with only a UNC sharepoint on Windows

(cherry picked from commit 9654daf793)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2024-03-26 11:43:36 +00:00
Miss Islington (bot)
54514467c2
[3.12] gh-83845: Add tests for operator module (GH-115883) (#117253)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2024-03-26 09:37:41 +00:00
Victor Stinner
477ef9015c
[3.12] gh-83434: Sync libregrtest and test_regrtest with the main branch (#117250)
* gh-115122: Add --bisect option to regrtest (#115123)

* test.bisect_cmd now exit with code 0 on success, and code 1 on
  failure. Before, it was the opposite.
* test.bisect_cmd now runs the test worker process with
  -X faulthandler.
* regrtest RunTests: Add create_python_cmd() and bisect_cmd()
  methods.

(cherry picked from commit 1e5719a663)

* gh-115720: Show number of leaks in huntrleaks progress reports (GH-115726)

Instead of showing a dot for each iteration, show:
- '.' for zero (on negative) leaks
- number of leaks for 1-9
- 'X' if there are more leaks

This allows more rapid iteration: when bisecting, I don't need
to wait for the final report to see if the test still leaks.

Also, show the full result if there are any non-zero entries.
This shows negative entries, for the unfortunate cases where
a reference is created and cleaned up in different runs.

Test *failure* is still determined by the existing heuristic.

(cherry picked from commit af5f9d682c)

* gh-83434: Disable XML in regrtest when -R option is used (#117232)

(cherry picked from commit d52bdfb19f)

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-03-26 08:04:28 +00:00
Miss Islington (bot)
1c72265a31
[3.12] gh-117187: Fix XML tests for vanilla Expat <2.6.0 (GH-117203) (GH-117244)
gh-117187: Fix XML tests for vanilla Expat <2.6.0 (GH-117203)

This fixes XML unittest fallout from the https://github.com/python/cpython/issues/115398 security fix.  When configured using `--with-system-expat` on systems with older pre 2.6.0 versions of libexpat, our unittests were failing.

* sax|etree: Simplify Expat version guard where simplifiable

Idea by Matěj Cepl

* sax|etree: Fix reparse deferral tests for vanilla Expat <2.6.0

This *does not fix* the case of distros with an older version of libexpat with the 2.6.0 feature backported as a security fix.  (Ubuntu is a known example of this with its libexpat1 2.5.0-2ubunutu0.1 package)
(cherry picked from commit 9f74e86c78)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2024-03-26 02:08:23 +00:00
Gregory P. Smith
2f9caafdf4
[3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243)
Pulls in a new update from https://github.com/hacl-star/hacl-star and fixes our C "namespacing" done by `Modules/_hacl/refresh.sh`.

Co-authored-by: Jonathan Protzenko <protz@microsoft.com>
2024-03-26 01:43:24 +00:00
Miss Islington (bot)
293a479950
[3.12] Sync main docs and docstring for median_grouped(). (gh-117214) (gh-117241) 2024-03-25 23:56:36 +00:00
Miss Islington (bot)
9359fdd6fa
[3.12] Add information about negative indexes to sequence datamodel doc (GH-110903) (#117238)
Co-authored by Terry Jan Reedy
(cherry picked from commit c2276176d5)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2024-03-25 22:40:28 +00:00
Miss Islington (bot)
0c334f627b
[3.12] Minor markup and grammar fixes in the statistics docs (gh-117216) (gh-117218) 2024-03-25 14:33:15 +00:00
Miss Islington (bot)
bd2c60f8c2
[3.12] gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (GH-32011) (GH-117209)
(cherry picked from commit f11d0d8be8)

Co-authored-by: Erik Soma <stillusingirc@gmail.com>
2024-03-25 12:21:31 +02:00
Miss Islington (bot)
193a24bb80
[3.12] GH-115986 Docs: promote pprint.pp usage as a default (GH-116614) (#117196)
Co-authored-by: Kerim Kabirov <the.privat33r+gh@pm.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-24 09:14:47 -06:00
Miss Islington (bot)
4326e07a8b
[3.12] gh-101760: Improve the imaplib.IMAP4 example (GH-101764) (#117191)
Co-authored-by: LilKS <1244886+LilKS@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-03-24 10:09:08 +00:00
Carol Willing
1d0e22e500
[3.12] docs:fix over-linking in dataclasses.rst (GH-117005) (#117163)
* docs: fix over-linking in dataclasses.rst (#117005)

(cherry picked from commit 0907871d43)

* [3.12] docs: fix over-linking in dataclasses.rst (GH-117005)
(cherry picked from commit 0907871d43)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>

---------

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-03-22 19:12:00 +00:00
Serhiy Storchaka
f3fee231d3
[3.12] gh-117084: Fix ZIP file extraction for directory entry names with backslashes on Windows (GH-117129) (GH-117162)
(cherry picked from commit 567ab3bd15)
2024-03-22 18:35:12 +00:00
Miss Islington (bot)
135a698d5c
[3.12] [docs] Fix typo in docstring and add example to logging cookbook. (GH-117157) (GH-117159)
(cherry picked from commit 00baaa21de)
2024-03-22 17:50:02 +00:00
Miss Islington (bot)
1ea85e271b
Fix get_packagefamilyname helper function on Windows 32-bit (GH-117153)
(cherry picked from commit 3be9b9d872)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-03-22 15:26:29 +00:00
Miss Islington (bot)
d99ffc5a4b
[3.12] gh-117127: glob tests: Reopen dir_fd to pick up directory changes (GH-117128) (GH-117150)
gh-117127: glob tests: Reopen dir_fd to pick up directory changes (GH-117128)
(cherry picked from commit 42ae924d27)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-03-22 10:24:06 +00:00
infohash
ad0ff86034
[3.12] gh-75988: Fix issues with autospec ignoring wrapped object (GH-115223) (#117119)
gh-75988: Fix issues with autospec ignoring wrapped object (#115223)

* set default return value of functional types as _mock_return_value

* added test of wrapping child attributes

* added backward compatibility with explicit return

* added docs on the order of precedence

* added test to check default return_value

(cherry picked from commit 735fc2cbbc)
2024-03-22 09:47:52 +00:00
Miss Islington (bot)
d3de3a251e
[3.12] gh-117061: Fix test_posix.test_sched_setaffinity() on RHEL9 (GH-117126) (#117137)
gh-117061: Fix test_posix.test_sched_setaffinity() on RHEL9 (GH-117126)

On RHEL9, sched_setaffinity(0, []) does not fail.
(cherry picked from commit 50f9b0b1e0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-21 22:37:06 +00:00
Miss Islington (bot)
05c5bece78
[3.12] gh-116333: Relax error string text expectations in SSL-related tests (GH-116334) (GH-117136)
gh-116333: Relax error string text expectations in SSL-related tests (GH-116334)

* Relax error string text expectations in SSL-related tests

As suggested [here][1], this change relaxes the OpenSSL error string
text expectations in a number of tests. This was specifically done in
support of more easily building CPython [AWS-LC][2], but because AWS-LC
is a fork of [BoringSSL][3], it should increase compatibility with that
library as well.

In addition to the error string relaxations, we also add some guards
around the `tls-unique` channel binding being used with TLSv1.3, as that
feature (described in [RFC 6929][4]) is [not defined][5] for TLSv1.3.

[1]: https://discuss.python.org/t/support-building-ssl-and-hashlib-modules-against-aws-lc/44505/4
[2]: https://github.com/aws/aws-lc
[3]: https://github.com/google/boringssl
[4]: https://datatracker.ietf.org/doc/html/rfc5929GH-section-3
[5]: https://datatracker.ietf.org/doc/html/rfc8446GH-appendix-C.5
(cherry picked from commit c85d84166a)

Co-authored-by: Will Childs-Klein <willck93@gmail.com>
2024-03-21 20:46:20 +00:00
Hugo van Kemenade
ea290f8f19
[3.12] Remove more stray backticks from NEWS files (GH-115374) (#117118)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2024-03-21 11:57:40 +00:00
Miss Islington (bot)
e84a8f37b1
[3.12] Fix sort order for "locale encoding" glossary item (GH-115794) (#117102)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2024-03-20 21:07:31 +00:00
jkriegshauser
d69c51520e
[3.12] gh-116773: Fix overlapped memory corruption crash (GH-116774) (#117078)
Manual backport of gh-116774.
2024-03-20 13:10:15 -07:00
Miss Islington (bot)
8e00ead351
[3.12] gh-117058: Update GUI and packaging recommendations for macOS. (GH-117059) (#117081)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-03-20 17:52:19 +02:00
Serhiy Storchaka
da2f9d1417
[3.12] gh-117021: Fix integer overflow in PyLong_AsPid() on non-Windows 64-bit platforms (GH-117064) (GH-117070)
(cherry picked from commit 519b2ae22b)
2024-03-20 16:44:05 +02:00
Serhiy Storchaka
0325a8a8cd
[3.12] gh-90300: Remove reference to PYTHON_FROZEN_MODULES in Python CLI help (GH-117035)
Fix error introduced in 4be9fa8961.
2024-03-19 20:05:08 +00:00
Miss Islington (bot)
afe5e46a4e
[3.12] docs: announce venv creation before installing packages (GH-117036) (#117040)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-03-19 20:04:46 +00:00
Miss Islington (bot)
16ce6861e0
[3.12] gh-101100: Fix Sphinx warnings in library/pydoc.rst (GH-116913) (#117037)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-19 19:55:30 +00:00
Sam Gross
92564331de
[3.12] gh-113964: Don't prevent new threads until all non-daemon threads exit (GH-116677) (#117029)
Starting in Python 3.12, we prevented calling fork() and starting new threads
during interpreter finalization (shutdown). This has led to a number of
regressions and flaky tests. We should not prevent starting new threads
(or `fork()`) until all non-daemon threads exit and finalization starts in
earnest.

This changes the checks to use `_PyInterpreterState_GetFinalizing(interp)`,
which is set immediately before terminating non-daemon threads.

(cherry picked from commit 60e105c1c1)
2024-03-19 15:22:42 -04:00
Serhiy Storchaka
4be9fa8961
[3.12] gh-90300: Improve the Python CLI help output (GH-115853) (GH-117022)
* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* remove the ending period in single-sentence descriptions

(cherry picked from commit b85572c47d)

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-19 18:33:34 +00:00
Miss Islington (bot)
05b2b30436
[3.12] gh-56374: Clarify documentation of nonlocal (GH-116942) (#117023)
Define 'nonlocal scopes' in a way that excludes class scopes.
Rearrange the rest of the doc.  Add "Programmer's note".

(cherry picked from commit 025ef7a5f7)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-03-19 18:05:27 +00:00
Miss Islington (bot)
1684f7ec1e
[3.12] Update titles and subtitles on landing page template (GH-116914) (#117020)
Update titles and subtitles on landing page template (GH-116914)

* Update titles and subtitles on landing page template

* address review from gvanrossum

* Edits from hugovk review

* Change word order back. Down the road we should split license and history
(cherry picked from commit c514a975ab)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-03-19 17:52:35 +00:00
David Röthlisberger
0fc8ae4e28
[3.12] gh-116957: configparser: Do post-process values after DuplicateOptionError (GH-116958) (GH-117013)
If you catch DuplicateOptionError / DuplicateSectionError when reading a
config file (the intention is to skip invalid config files) and then
attempt to use the ConfigParser instance, any values it *had* read
successfully so far, were stored as a list instead of string! Later
`get` calls would raise "AttributeError: 'list' object has no attribute
'find'" from somewhere deep in the interpolation code.

(cherry picked from commit b1bc37597f)
2024-03-19 18:18:50 +01:00