Commit graph

116639 commits

Author SHA1 Message Date
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
Serhiy Storchaka
4a73637966
[3.11] gh-116401: Fix blocking os.fwalk() and shutil.rmtree() on opening a named pipe (GH-116421) (GH-116717)
(cherry picked from commit aa7bcf284f)
2024-03-13 10:03:17 +00:00
Miss Islington (bot)
5bd350709d
[3.11] gh-116491: Improve test_win32_ver (GH-116506) (#116709)
gh-116491: Improve `test_win32_ver` (GH-116506)
(cherry picked from commit ee0dbbc045)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-13 07:37:01 +00:00
Miss Islington (bot)
7e8578ce9d
[3.11] gh-115264: Fix test_functools with -00 mode (GH-115276) (#116706)
gh-115264: Fix `test_functools` with `-00` mode (GH-115276)
(cherry picked from commit 27df81d564)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-13 07:05:41 +00:00
Mariusz Felisiak
0ebc7925e5
[3.11] Docs: fix broken links (GH-116651) (#116701)
(cherry picked from commit 3f1b6efee9)
2024-03-12 22:00:45 -07:00
Jason R. Coombs
21a259eba5
[3.11] gh-116307: Proper fix for 'mod' leaking across importlib tests… (#116694)
[3.11] gh-116307: Proper fix for 'mod' leaking across importlib tests (GH-116680)
(cherry picked from commit a254807761)


gh-116307: Create a new import helper 'isolated modules' and use that instead of 'Clean Import' to ensure that tests from importlib_resources don't leave modules in sys.modules.
2024-03-13 00:35:00 +00:00
Miss Islington (bot)
a01621aeb4
[3.11] gh-116682: stdout may be empty in test_cancel_futures_wait_false (GH-116683) (#116693)
If the `shutdown()` call happens before the worker thread starts executing
the task, then nothing will be printed to stdout.
(cherry picked from commit 7d1abe9502)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-03-13 00:29:03 +00:00
Miss Islington (bot)
0917338c78
[3.11] Add typing.NamedTuple in glossary section for named tuples (GH-108327) (#116690)
(cherry picked from commit 149f7f7ae2)

Co-authored-by: Tushar Sadhwani <tushar.sadhwani000@gmail.com>
2024-03-12 22:54:18 +00:00
Nikita Sobolev
f3a2b62bc1
[3.11] gh-110819: Fix ‘kind’ may be used uninitialized warning in longobject (GH-116599) (#116650)
(cherry picked from commit eb947cdc13)
2024-03-12 22:21:52 +03:00
Tian Gao
b17d34796e
[3.11] gh-90095: Make .pdbrc work properly and add some reasonable te… (#116660)
[3.11] gh-90095: Make .pdbrc work properly and add some reasonable tests (GH-110496)
(cherry picked from commit 44f9a84b67)
2024-03-12 16:58:40 +00:00
Miss Islington (bot)
52c41179f9
[3.11] gh-116541: Handle errors correctly in _pystatvfs_fromstructstatvfs (GH-116542) (#116644)
gh-116541: Handle errors correctly in `_pystatvfs_fromstructstatvfs` (GH-116542)
(cherry picked from commit f8147d01da)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-12 10:34:48 +00:00
Miss Islington (bot)
5562a09821
[3.11] gh-116600: [Enum] fix global Flag repr (GH-116615) (#116630)
* and fix global flag repr

(cherry picked from commit 06e29a224f)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-03-11 17:36:15 -07:00
Miss Islington (bot)
830fbe9b6e
[3.11] gh-116563: Update tutorial error example (GH-116569) (#116625)
There now may be multiple carets pointing at a token
rather than just a character.  Fix the sentence about
possible causes.
(cherry picked from commit 3e45030076)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-03-11 22:11:36 +00:00
Miss Islington (bot)
88ed804ae7
[3.11] gh-71052: Use raise_signal in ThreadSignals.test_signals (GH-116423) (#116617)
gh-71052: Use `raise_signal` in `ThreadSignals.test_signals` (GH-116423)

Use `raise_signal` rather than `kill` in `ThreadSignals.test_signals`
(cherry picked from commit 34920f3691)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2024-03-11 21:01:13 +00:00
Miss Islington (bot)
6ae6d46e61
[3.11] gh-116545: Fix error handling in mkpwent in pwdmodule (GH-116548) (#116594)
gh-116545: Fix error handling in `mkpwent` in `pwdmodule` (GH-116548)
(cherry picked from commit ffd79bea0f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-11 12:16:22 +00:00
Petr Viktorin
d78117981a
[3.11] gh-115421: List all test/ subdirs in Makefile, and test them (GH-115813)
This backports:
- GH-115813
- GH-115422

Unlike on the main branch, new directories are added to the end,
so they're a bit easier to patch out if a redistributor needs to do so.

On main & 3.12, there's a special case for `idlelib/idle_test`; on
3.11 TESTSUBDIRS has several more entries that are not in `test/`.
This backport ignores all of them (including idlelib).
(The alternative would be list them, as additions to TEST_HOME_DIR.
But that's probably too invasive; people might split stdlib up in
surprising ways.)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-11 12:02:05 +01:00
Miss Islington (bot)
707ce1f0a7
[3.11] gh-88352: Make TimedRotatingFileHandler tests more stable (GH-116409) (GH-116586)
The tests failed (with less than 1% probability) if for example the file
was created at 11:46:03.999, but the record was emitted at 11:46:04.001,
with atTime=11:46:04, which caused an unexpected rollover. Ensure that the
tests are always run within the range of the same whole second.

Also share code between test_rollover_at_midnight and test_rollover_at_weekday.
(cherry picked from commit d8712fa0c7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-11 12:49:48 +02:00
Miss Islington (bot)
34e808ec6c
[3.11] gh-116576: Fix Tools/scripts/sortperf.py sorting the same list (GH-116577) (#116583)
gh-116576: Fix `Tools/scripts/sortperf.py` sorting the same list (GH-116577)
(cherry picked from commit 4704e55a71)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-11 07:23:05 +00:00
Miss Islington (bot)
982f457f6f
[3.11] gh-116535: Fix distracting "TypeError" in example code (gh-116538) (gh-116552)
gh-116535: Fix distracting "TypeError" in example code (gh-116538)
(cherry picked from commit db8f423f58)

Co-authored-by: Declan <5962877+dec1@users.noreply.github.com>
2024-03-09 17:08:23 -05:00
Miss Islington (bot)
f2898f89bf
[3.11] gh-116520: Fix error handling in os_get_terminal_size_impl in posixmodule (GH-116521) (#116540)
gh-116520: Fix error handling in `os_get_terminal_size_impl` in `posixmodule` (GH-116521)
(cherry picked from commit b4b4e764a7)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-09 11:41:46 +00:00
Miss Islington (bot)
b1c77ba1ce
[3.11] GH-116218 Docs: Add availability information for the 'resource' module (GH-116256) (#116534)
GH-116218 Docs: Add availability information for the 'resource' module (GH-116256)

Add availability data to 'resource' module Docs
(cherry picked from commit 03f86b1b62)

Co-authored-by: Kerim Kabirov <39376984+Privat33r-dev@users.noreply.github.com>
2024-03-09 10:36:02 +01:00
Miss Islington (bot)
232b085a01
[3.11] gh-105535 Document potential performance trap during enum creation (GH-107119) (GH-116512)
(cherry picked from commit 601f3a7b33)

Co-authored-by: Nicolas A. Oyarzabal <79150521+nicky-eng@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-08 16:57:16 -08:00
Miss Islington (bot)
3abf267787
[3.11] gh-116447: Fix possible UB in arraymodule and getargs (GH-116459) (#116497)
gh-116447: Fix possible UB in `arraymodule` and `getargs` (GH-116459)
(cherry picked from commit fdb2d90a27)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-08 11:25:39 +00:00
Miss Islington (bot)
0f6cd295d7
[3.11] gh-116485: Fixed the typo (GH-116486) (#116490)
Co-authored-by: Varun Gole <59524264+varungole@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-08 08:27:33 +00:00
Miss Islington (bot)
22c38a6f77
gh-116472: Replace literal newlines with escape characters in MSBuild files (GH-116473)
(cherry picked from commit 5d0cdfe519)

Co-authored-by: Dan Albert <dan@gingerhq.net>
2024-03-07 22:16:32 +00:00
Miss Islington (bot)
fa7f278583
[3.11] gh-116448: Handle errors correctly in os_waitid_impl in posixmodule (GH-116449) (#116453)
gh-116448: Handle errors correctly in `os_waitid_impl` in `posixmodule` (GH-116449)
(cherry picked from commit 882fcede83)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-03-07 09:10:08 +00:00
Serhiy Storchaka
e89f2a0be1
[3.11] gh-115664: Fix ordering of more versionadded and versionchanged directives (GH-116298) (GH-116450) (GH-116452)
(cherry picked from commit 1e75fe1468)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 808a77612f)
2024-03-07 08:35:24 +00:00
Miss Islington (bot)
22eb97cf9b
[3.11] gh-88118: Fix some test_multiprocessing flakiness. (GH-116434) (GH-116441)
Fix some test_multiprocessing flakiness.

Potentially introduced by https://github.com/python/cpython/pull/25845

not joining that thread likely leads to recently observed "environment
changed" logically passing but overall failing tests seen on some
buildbots similar to:

```
1 test altered the execution environment (env changed):
    test.test_multiprocessing_fork.test_processes

2 re-run tests:
    test.test_multiprocessing_fork.test_processes
    test.test_multiprocessing_forkserver.test_processes
```
(cherry picked from commit ea1803e608)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-06 22:20:37 +00:00
Sebastian Pipping
fc9da96274
[3.11] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (#116268)
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:

- `xml.etree.ElementTree.XMLParser.flush`
- `xml.etree.ElementTree.XMLPullParser.flush`
- `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
- `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
- `xml.sax.expatreader.ExpatParser.flush`

Based on the "flush" idea from #115138 (comment) .

- Please treat as a security fix related to CVE-2023-52425.

(cherry picked from commit 6a95676)
(cherry picked from commit 73807eb)
(cherry picked from commit eda2963)

---------

Includes code suggested-by: Snild Dolkow <snild@sony.com>
and by core dev Serhiy Storchaka.
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-03-06 14:17:02 -08:00
Łukasz Langa
e8fb762fa9
[3.11] gh-90300: Reformat the Python CLI help output (GH-115847) (GH-116418)
(cherry picked from commit 2e92ffd7fa)
(cherry picked from commit 2bdd1d6f15)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-06 17:13:10 +01:00
Miss Islington (bot)
26f7956f8f
[3.11] gh-116143: Fix race condition in pydoc _start_server (GH-116144) (#116416)
gh-116143: Fix race condition in pydoc _start_server (GH-116144)
(cherry picked from commit 02ee475ee3)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2024-03-06 15:07:08 +00:00