Commit graph

116669 commits

Author SHA1 Message Date
Miss Islington (bot)
452b0e5142
[3.11] pre-commit: add check-case-conflict and check-merge-conflict (GH-117259) (#117261)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-26 14:11:30 +00:00
Miss Islington (bot)
2d932361a8
[3.11] gh-66543: Fix mimetype.guess_type() (GH-117217) (GH-117257)
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:46:28 +00:00
Miss Islington (bot)
1112e01da1
[3.11] gh-83845: Add tests for operator module (GH-115883) (#117254)
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:50:40 +00:00
Miss Islington (bot)
04b26eeb14
[3.11] [3.12] gh-83434: Sync libregrtest and test_regrtest with the main branch (GH-117250) (#117251)
[3.12] gh-83434: Sync libregrtest and test_regrtest with the main branch (GH-117250)

* gh-115122: Add --bisect option to regrtest (GH-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 (GH-117232)

(cherry picked from commit d52bdfb19f)

---------

(cherry picked from commit 477ef9015c)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-03-26 08:18:10 +00:00
Miss Islington (bot)
2f8d3a17d9
[3.11] gh-117187: Fix XML tests for vanilla Expat <2.6.0 (GH-117203) (GH-117245)
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:28 +00:00
Miss Islington (bot)
e64c7d3e19
[3.11] Add information about negative indexes to sequence datamodel doc (GH-110903) (#117239)
Co-authored by Terry Jan Reedy
(cherry picked from commit c2276176d5)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2024-03-25 22:40:41 +00:00
Serhiy Storchaka
6261322e26
[3.11] gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (GH-32011) (GH-117210)
(cherry picked from commit f11d0d8be8)

Co-authored-by: Erik Soma <stillusingirc@gmail.com>
2024-03-25 10:34:25 +00:00
Miss Islington (bot)
a3a0ce1b2f
[3.11] GH-115986 Docs: promote pprint.pp usage as a default (GH-116614) (#117197)
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:51 -06:00
Miss Islington (bot)
5d12230095
[3.11] gh-101760: Improve the imaplib.IMAP4 example (GH-101764) (#117192)
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:07:37 +00:00
Miss Islington (bot)
de43ce11cc
[3.11] [docs] Fix typo in docstring and add example to logging cookbook. (GH-117157) (GH-117158)
(cherry picked from commit 00baaa21de)
2024-03-23 10:19:14 +00:00
Carol Willing
cf034ad0f6
[3.11] docs: fix over-linking in dataclasses.rst (GH-117005) (#117164)
* docs: fix over-linking in dataclasses.rst (#117005)

(cherry picked from commit 0907871d43)

* [3.11] 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 21:11:57 +00:00
Serhiy Storchaka
0d82047645
[3.11] gh-117084: Fix ZIP file extraction for directory entry names with backslashes on Windows (GH-117129) (GH-117162) (GH-117165)
(cherry picked from commit f3fee231d3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 567ab3bd15)
2024-03-22 19:24:27 +00:00
Miss Islington (bot)
da5efeba93
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:20:38 +00:00
Miss Islington (bot)
8440125460
[3.11] gh-117127: glob tests: Reopen dir_fd to pick up directory changes (GH-117128) (GH-117149)
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:21:53 +00:00
infohash
51da1ddefc
[3.11] gh-75988: Fix issues with autospec ignoring wrapped object (GH-115223) (#117124)
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:48:41 +00:00
Miss Islington (bot)
0ec8561574
[3.11] gh-117061: Fix test_posix.test_sched_setaffinity() on RHEL9 (GH-117126) (#117138)
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:16 +00:00
Serhiy Storchaka
7323c4dd07
[3.11] gh-117021: Fix integer overflow in PyLong_AsPid() on non-Windows 64-bit platforms (GH-117064) (GH-117070) (GH-117075)
(cherry picked from commit da2f9d1417)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 519b2ae22b)
2024-03-21 09:43:42 +00:00
Miss Islington (bot)
2f1806ed8a
[3.11] Fix sort order for "locale encoding" glossary item (GH-115794) (#117103)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2024-03-20 21:08:18 +00:00
jkriegshauser
23a1c9f422
[3.11] gh-116773: Fix overlapped memory corruption crash (GH-116774) (#117077)
Manual backport of gh-116774.
2024-03-20 13:10:32 -07:00
Miss Islington (bot)
7eedaf4a86
[3.11] gh-117058: Update GUI and packaging recommendations for macOS. (GH-117059) (#117082)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-03-20 17:52:29 +02:00
Serhiy Storchaka
051b8a2589
[3.11] gh-90300: Improve the Python CLI help output (GH-115853) (GH-117022) (GH-117034)
* 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)

(cherry picked from commit 4be9fa8961)

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-19 20:08:00 +00:00
Miss Islington (bot)
1de746fc1e
[3.11] docs: announce venv creation before installing packages (GH-117036) (#117039)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-03-19 20:03:21 +00:00
Miss Islington (bot)
25c34ce3ed
[3.11] gh-101100: Fix Sphinx warnings in library/pydoc.rst (GH-116913) (#117038)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-19 19:55:43 +00:00
Miss Islington (bot)
b027278fa0
[3.11] Update titles and subtitles on landing page template (GH-116914) (#117019)
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:08 +00:00
David Röthlisberger
b517fd5e16
[3.11] gh-116957: configparser: Do post-process values after DuplicateOptionError (GH-116958) (GH-117012)
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:19:04 +01:00
Miss Islington (bot)
bb7a6d4707
[3.11] gh-107607: Update comment about utf-8 BOM being ignored (GH-107858) (#117015)
(cherry picked from commit 7f64ae30dd)
Co-authored-by: Terry Jan Reedy tjreedy@udel.edu
2024-03-19 11:59:52 -04:00
Victor Stinner
c7b01e3c32
[3.11] gh-90872: Fix subprocess.Popen.wait() for negative timeout (#116989) (#117003)
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:21:42 +00:00
Miss Islington (bot)
299b6d06e8
[3.11] gh-105866: fix dataclass with slots=True, weakref_slot=True (GH-105870) (GH-116979)
(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:45 +01:00
Hugo van Kemenade
b23fae3ab9
[3.11] Bump GitHub Actions (GH-116944) (GH-116949)
(cherry picked from commit 3a99f5c5f3)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-19 11:56:19 +01:00
Miss Islington (bot)
3b4cd48d29
[3.11] gh-90535: Fix support of interval>1 in logging.TimedRotatingFileHandler (GH-116220) (GH-116893)
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:53 +02:00
Miss Islington (bot)
56cd8740a0
[3.11] gh-116881: Remove erroneous or redundant grammar NULL (GH-116885) (#116952)
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:42 -04:00
Kushal Das
a93974d452
[3.11] gh-116831: Fixes tests for c extension in WASI for Python 3.11 (GH-116831) (#116933)
gh-116831: Fixes tests for c extension in WASI

We can skip the C extension based tests under WASI.
2024-03-18 07:03:01 +01:00
Miss Islington (bot)
fb66087134
[3.11] gh-116851: Remove "from ctypes import *" from a ctypes example (GH-116852) (GH-116906)
It is confusing, because libc is not imported from ctypes,
but defined in previous examples, which already contain the import.
(cherry picked from commit 744c077795)

Co-authored-by: jnchen <caojingchen@live.com>
2024-03-16 13:18:52 +00:00
Miss Islington (bot)
02497b7ac2
[3.11] gh-116484: Fix collisions between Checkbutton and ttk.Checkbutton default names (GH-116495) (GH-116902)
Change automatically generated tkinter.Checkbutton widget names to
avoid collisions with automatically generated tkinter.ttk.Checkbutton
widget names within the same parent widget.
(cherry picked from commit c61cb507c1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-16 11:58:10 +00:00
Miss Islington (bot)
eddfdb3e50
[3.11] gh-116764: Fix regressions in urllib.parse.parse_qsl() (GH-116801) (GH-116895)
* Restore support of None and other false values.
* Raise TypeError for non-zero integers and non-empty sequences.

The regressions were introduced in gh-74668
(bdba8ef42b).
(cherry picked from commit 1069a462f6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-16 11:04:31 +00:00
Nikita Sobolev
d16519ab7b
[3.11] gh-116858: Add @cpython_only to several tests in test_cmd_line (GH-116859) (#116890) 2024-03-16 09:29:11 +00:00
Jason R. Coombs
8acd6ca521
[3.11] gh-116811: Ensure MetadataPathFinder.invalidate_caches is reachable when delegated through PathFinder. (GH-116812) (#116865)
* Make MetadataPathFinder a proper classmethod.

* In PathFinder.invalidate_caches, also invoke MetadataPathFinder.invalidate_caches.

* Add blurb
(cherry picked from commit 5f52d20a93)
2024-03-15 09:59:32 -04:00
Miss Islington (bot)
eaefa0b1f7
[3.11] gh-90095: Ignore empty lines and comments in .pdbrc (GH-116834) (#116855)
gh-90095: Ignore empty lines and comments in `.pdbrc` (GH-116834)
(cherry picked from commit a50cf6c3d7)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-03-15 09:55:44 +00:00
Miss Islington (bot)
d83b4c570c
[3.11] gh-90300: Fix undocumented envvars in the Python CLI help (GH-116765) (GH-116797) (GH-116803)
(cherry picked from commit fc4d5fdffe)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 19ac28bd08)
2024-03-14 15:41:52 +02:00
Miss Islington (bot)
0ecdaf0aa7
[3.11] gh-90300: Document equivalent -X options for envvars in the Python CLI help (GH-116756) (GH-116786) (GH-116796)
(cherry picked from commit 991710af02)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 8c6db45ce3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-14 10:39:32 +00:00
Miss Islington (bot)
c42e709e5a
[3.11] gh-116785: Fix direct invocation of test_inspect (GH-116787) (#116795)
gh-116785: Fix direct invocation of `test_inspect` (GH-116787)
(cherry picked from commit 66fb613d90)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-14 10:25:48 +00:00
Serhiy Storchaka
1080dd166d
[3.11] gh-90300: Sort the -X options and some envvars in the Python CLI help (GH-116739) (GH-116766) (GH-116779)
(cherry picked from commit 870cd901ea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit e54bdeab9c)
2024-03-14 12:07:31 +02:00
Brett Cannon
3cc24f1000
[3.11] GH-115979: update test_importlib to work under WASI SDK 21 (GH-116754) (GH-116762)
(cherry picked from commit 61733a2fb9)
2024-03-13 21:55:29 +00:00
Miss Islington (bot)
039fd9ec34
[3.11] gh-98731: Improvements to the logging documentation (GH-101618) (GH-116733)
(cherry picked from commit 7f418fb111)
2024-03-13 17:16:28 +00:00
Victor Stinner
f292b0724e
[3.11] gh-106687: _ssl: use uint64_t for SSL options (#106700) (#116665)
gh-106687: _ssl: use uint64_t for SSL options (#106700)

SSL_CTX_get_options() uses uint64_t for options:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html

Fix this compiler warning on Windows with MSC:

    conversion from 'uint64_t' to 'long', possible loss of data

(cherry picked from commit ad95c7253a)
2024-03-13 17:49:30 +01:00
Miss Islington (bot)
cde47e222e
[3.11] gh-110918: Fix side effects of regrtest test_match_tests() (GH-116718) (#116727)
gh-110918: Fix side effects of regrtest test_match_tests() (GH-116718)

test_match_tests now saves and restores patterns.

Add get_match_tests() function to libregrtest.filter.

Previously, running test_regrtest multiple times in a row only ran
tests once: "./python -m test test_regrtest -R 3:3.
(cherry picked from commit 612f1ec988)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-13 14:35:59 +00:00
Miss Islington (bot)
1117e7dd1b
[3.11] [doc]: Update cookbook recipe for Qt6. (GH-116719) (GH-116728)
(cherry picked from commit 186af3cf21)
2024-03-13 14:34:09 +00:00
Miss Islington (bot)
76c4ab31c9
[3.11] gh-90300: Fix cmdline.rst (GH-116721) (GH-116725)
* Fix the description of the "-b" option.
* Add references to environment variables for "-s" and "-X dev" options.
(cherry picked from commit 33662d4e01)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-13 13:56:25 +00:00
Miss Islington (bot)
bccd1f691f
[3.11] gh-116714: Handle errors correctly in PyFloat_GetInfo (GH-116715) (#116723)
gh-116714: Handle errors correctly in `PyFloat_GetInfo` (GH-116715)
(cherry picked from commit fcd49b4f47)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-13 16:40:30 +03:00
Miss Islington (bot)
1dcb46104f
[3.11] gh-111307: Update design FAQ 'switch' entry (GH-115899) (#116704)
(cherry picked from commit 43986f5567)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-03-13 07:09:52 -04:00