Commit graph

119701 commits

Author SHA1 Message Date
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
Tian Gao
688623d402
[3.12] gh-116735: Use MISSING for CALL event if argument is absen… (#116873)
[3.12] gh-116735: Use `MISSING` for `CALL` event if argument is absent (GH-116737)
2024-03-19 17:00:54 +00:00
Miss Islington (bot)
5da6e3082c
[3.12] gh-116869: Make C API compatible with ISO C90 (GH-116950) (#117011)
gh-116869: Make C API compatible with ISO C90 (GH-116950)

Make the C API compatible with -Werror=declaration-after-statement
compiler flag again.
(cherry picked from commit a9c304cf02)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-19 16:06:15 +00:00
Miss Islington (bot)
1627c1ee01
[3.12] gh-107607: Update comment about utf-8 BOM being ignored (GH-107858) (#117016)
(cherry picked from commit 7f64ae30dd)
Co-authored-by: Terry Jan Reedy tjreedy@udel.edu
2024-03-19 12:00:40 -04:00
Victor Stinner
35e8f04f1b
[3.12] gh-90872: Fix subprocess.Popen.wait() for negative timeout (#116989) (#117002)
gh-90872: Fix subprocess.Popen.wait() for negative timeout (#116989)

On Windows, subprocess.Popen.wait() no longer calls
WaitForSingleObject() with a negative timeout: pass 0 ms if the
timeout is negative.

(cherry picked from commit 27cf3ed00c)
2024-03-19 14:15:05 +00:00
Miss Islington (bot)
23f97327fe
[3.12] gh-105866: fix dataclass with slots=True, weakref_slot=True (GH-105870) (GH-116978)
(cherry picked from commit a22d05f04c)

Co-authored-by: Aviel Boag <avboag@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2024-03-19 11:57:31 +01:00
Miss Islington (bot)
e1f890828e
[3.12] Bump GitHub Actions (GH-116944) (#116948)
(cherry picked from commit 3a99f5c5f3)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-19 11:56:03 +01:00
Miss Islington (bot)
547e8827e6
[3.12] gh-90535: Fix support of interval>1 in logging.TimedRotatingFileHandler (GH-116220) (GH-116892)
Fix support of interval values > 1 in logging.TimedRotatingFileHandler
for when='MIDNIGHT' and when='Wx'.
(cherry picked from commit 269051d20e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-18 19:47:26 +02:00
Miss Islington (bot)
6383b14957
[3.12] gh-116881: Remove erroneous or redundant grammar NULL (GH-116885) (#116951)
In Lexical Analysis f-strings section, NULL in the description
of 'literal character' means '\0'.  In the format_spec grammar
production, it is wrong with that meaning and redundant if
instead interpreted as <nothing>.  Remove it there.
(cherry picked from commit 4e45c6c54a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-03-18 10:37:26 -04:00
Miss Islington (bot)
1c0c6c91af
[3.12] gh-115874: Don't use module state in teedataobject tp_dealloc (GH-116204) (#116955)
(cherry picked from commit e2fcaf19d3)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2024-03-18 12:40:34 +00:00
Antoine Pitrou
25243b1461
[3.12] gh-112536: Add TSAN build on Github Actions (GH-116872)
(cherry picked from commit 20578a1f68)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-03-18 09:52:54 +00:00
Antoine Pitrou
fcb230180f
[3.12] gh-112536: Add --tsan test for reasonable TSAN execution times. (gh-116601) (#116929)
(cherry picked from commit ebf29b3)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-03-18 10:22:19 +01:00
Antoine Pitrou
2ac1b48a04
[3.12] gh-112536: Add support for thread sanitizer (TSAN) (gh-112648) (#116924)
* [3.12] gh-112536: Add support for thread sanitizer (TSAN) (gh-112648)
(cherry picked from commit 88cb972000)

* Remove doc for configure option (leave it hidden in this branch)

---------

Co-authored-by: Samet YASLAN <sametyaslan@gmail.com>
2024-03-17 16:33:35 +01:00
Nikita Sobolev
2dbc77e1ec
[3.12] gh-116780: Fix test_inspect in -OO mode (GH-116788) (#116799) 2024-03-17 13:33:38 +03:00