Commit graph

117836 commits

Author SHA1 Message Date
Miss Islington (bot)
36d6ba08d0
[3.12] gh-60283: Check for redefined test names in CI (GH-109161) (#109365)
* gh-60283: Check for redefined test names in CI (GH-109161)
(cherry picked from commit 3cb9a8edca)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Update exclude list for 3.12

* Explicitly exclude files which failed to lint/parse

* Sort to avoid future merge conflicts

---------

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-09-15 00:38:54 +02:00
Miss Islington (bot)
5b38bdeaf1
[3.12] Fix variable name in dis documentation example (GH-109343) (#109364)
Fix variable name in dis documentation example (GH-109343)

BINARY_SUBSCR example erroneously uses two different names `key` and `index` to refer to the same variable. STORE_SUBSCR and DELETE_SUBSCR use only `key` in the same context. Changing `index` to `key` for consistency.
(cherry picked from commit a0c06a4f93)

Co-authored-by: Oleksandr Kravets <73752159+olekskrav@users.noreply.github.com>
2023-09-13 12:37:46 +02:00
Miss Islington (bot)
47402e235d
[3.12] gh-105189: fix importlib.resources.abc deprecation docs (GH-105232) (#109363)
gh-105189: fix importlib.resources.abc deprecation docs (GH-105232)
(cherry picked from commit 6c0ddca409)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-13 12:37:24 +02:00
Miss Islington (bot)
c30d5df74c
[3.12] gh-104736: Fix test_gdb tests on ppc64le with clang (GH-109360) (#109361)
gh-104736: Fix test_gdb tests on ppc64le with clang (GH-109360)

Fix test_gdb on Python built with LLVM clang 16 on Linux ppc64le (ex:
Fedora 38). Search patterns in gdb "bt" command output to detect
when gdb fails to retrieve the traceback. For example, skip a test if
"Backtrace stopped: frame did not save the PC" is found.
(cherry picked from commit 44d9a71ea2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-13 12:37:10 +02:00
Miss Islington (bot)
3d8e4d7d0c
[3.12] gh-109357: Fix test_monitoring.test_gh108976() (GH-109358) (#109359)
gh-109357: Fix test_monitoring.test_gh108976() (GH-109358)

The test now calls free_tool_id() so it can be run multiple times in
the same process. For example, the following command no longer fails:

    python -m test test_monitoring -R 3:3
(cherry picked from commit 388d91cd47)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-13 12:36:30 +02:00
Miss Islington (bot)
aee0077e7b
[3.12] Update workflow permissions in require-pr-label Action (GH-109342) (#109348)
Update workflow permissions in require-pr-label Action (GH-109342)

Change the permission from `read` to `write`.
(cherry picked from commit 44c8699196)

Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
2023-09-13 12:36:03 +02:00
Miss Islington (bot)
9b8205447f
[3.12] GH-104395: Add a link in 'Meta Information' to the docs download page (GH-104443) (#109345)
GH-104395: Add a link in 'Meta Information' to the docs download page (GH-104443)
(cherry picked from commit 90cf345ed4)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-13 12:35:42 +02:00
Irit Katriel
08bd2aa793
[3.12] gh-109184: update traceback module doc w.r.t notes (message is no longer always at the end) (#109201) (#109334)
gh-109184: update traceback module doc w.r.t notes (message is no longer always at the end) (#109201)

(cherry picked from commit 0e76cc359b)
2023-09-13 12:35:26 +02:00
Pablo Galindo Salgado
21f4e6d6cb
[3.12] gh-109114: Relax the check for invalid lambdas inside f-strings to avoid false positives (GH-109121). (#109155)
(cherry picked from commit 5bda2f637e)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2023-09-12 15:52:25 +00:00
Miss Islington (bot)
8208657f3d
[3.12] gh-109118: Disallow nested scopes within PEP 695 scopes within classes (GH-109196) (#109297)
gh-109118: Disallow nested scopes within PEP 695 scopes within classes (GH-109196)

Fixes GH-109118. Fixes GH-109194.

(cherry picked from commit b88d9e75f6)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-09-12 16:31:26 +02:00
Miss Islington (bot)
778d094126
[3.12] Fix iter_index() to work with lists which do not support stop=None. (gh-109306) (#109310)
Fix iter_index() to work with lists which do not support stop=None. (gh-109306)
(cherry picked from commit f2a55fecd0)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-09-12 16:23:20 +02:00
Miss Islington (bot)
7479a7aca2
[3.12] gh-109295: Fix test_os.test_access_denied() for TEMP=cwd (GH-109299) (#109304)
gh-109295: Fix test_os.test_access_denied() for TEMP=cwd (GH-109299)

Fix test_os.test_access_denied() when the TEMP environment variable
is equal to the current working directory. Run the test using a
different filename, since self.fname already exists in this case.
(cherry picked from commit 7dedfd36dc)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-12 16:23:03 +02:00
Miss Islington (bot)
8acfb42ea3
[3.12] gh-109295: Clean up multiprocessing in test_asyncio and test_compileall (GH-109298) (#109301)
gh-109295: Clean up multiprocessing in test_asyncio and test_compileall (GH-109298)

test_asyncio and test_compileall now clean up multiprocessing by
calling multiprocessing _cleanup_tests(): explicitly clean up
resources and stop background processes like the resource tracker.
(cherry picked from commit 09ea4b8706)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-12 16:22:43 +02:00
Miss Islington (bot)
a6ed8106e2
[3.12] gh-109292: add symtable impact of PEP 709 to What's New (GH-109293) (#109296)
gh-109292: add symtable impact of PEP 709 to What's New (GH-109293)
(cherry picked from commit 2b1e2f1cd1)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-09-12 16:21:08 +02:00
Miss Islington (bot)
2004e12d8d
[3.12] gh-109195: fix source location for super load before LOAD_SUPER_ATTR (GH-109289) (#109291)
gh-109195: fix source location for super load before LOAD_SUPER_ATTR (GH-109289)
(cherry picked from commit ceeb4173ae)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-09-12 16:20:41 +02:00
Miss Islington (bot)
8e96b98282
[3.12] gh-107322: zipapp: Remove the suggestion to remove .dist-info directories (GH-107296) (#109281)
gh-107322: zipapp: Remove the suggestion to remove .dist-info directories (GH-107296)

Removed zipapp suggestion to rm .dist-info subdirectories. This totally breaks importlib.metadata
(cherry picked from commit 1ee50e2a78)

Co-authored-by: wim glenn <hey@wimglenn.com>
2023-09-12 16:19:05 +02:00
Miss Islington (bot)
33ee98b217
[3.12] gh-90805: Make sure test_functools works with and without _functoolsmodule (GH-108644) (#109275)
gh-90805: Make sure test_functools works with and without _functoolsmodule (GH-108644)
(cherry picked from commit baa6dc8e38)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-12 16:17:05 +02:00
Miss Islington (bot)
a8393dc27e
[3.12] gh-109190: What's New in 3.12: Add subheadings to removals for easy linking (GH-109159) (#109273)
gh-109190: What's New in 3.12: Add subheadings to removals for easy linking (GH-109159)
(cherry picked from commit 57b6205523)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-09-12 16:16:35 +02:00
Miss Islington (bot)
5305cdc39b
[3.12] gh-109182: Fix and improve tests for gh-108654 (GH-109189) (#109271)
gh-109182: Fix and improve tests for gh-108654 (GH-109189)
(cherry picked from commit c0f488b88f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-12 16:15:40 +02:00
Mark Shannon
3efe7bc65f
[3.12] GH-108976. Keep monitoring data structures valid during de-optimization during callback. (GH-109131) (#109268)
GH-108976. Keep monitoring data structures valid during de-optimization during callback. (GH-109131)
2023-09-12 16:14:49 +02:00
Miss Islington (bot)
5e917a0b09
[3.12] Test DocTestFinder directly instead of calling support.run_doctest() (GH-108917) (#109259)
Test DocTestFinder directly instead of calling support.run_doctest() (GH-108917)
(cherry picked from commit 0abc935086)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-12 16:13:45 +02:00
Miss Islington (bot)
df64210ad0
[3.12] gh-109230: test_pyexpat no longer depends on the current directory (GH-109233) (#109241)
gh-109230: test_pyexpat no longer depends on the current directory (GH-109233)

Fix test_pyexpat.test_exception(): it can now be run from a directory
different than Python source code directory. Before, the test failed
in this case.

Skip the test if Modules/pyexpat.c source is not available. Skip also
the test on Python implementations other than CPython.
(cherry picked from commit e55aab9578)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-12 16:03:47 +02:00
Miss Islington (bot)
b3613815d4
[3.12] gh-109237: Fix test_site for non-ASCII working directory (GH-109238) (#109239)
gh-109237: Fix test_site for non-ASCII working directory (GH-109238)

Fix test_site.test_underpth_basic() when the working directory
contains at least one non-ASCII character: encode the "._pth" file to
UTF-8 and enable the UTF-8 Mode to use UTF-8 for the child process
stdout.
(cherry picked from commit cbb3a6f8ad)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-12 16:03:18 +02:00
Miss Islington (bot)
bcd59070d0
[3.12] Fix "FSTRING_MIDDLE" typo in py312 "What's New" (GH-109222) (#109223)
Fix "FSTRING_MIDDLE" typo in py312 "What's New" (GH-109222)
(cherry picked from commit 2dd6a86c4e)

Co-authored-by: Delgan <4193924+Delgan@users.noreply.github.com>
2023-09-12 16:00:54 +02:00
Miss Islington (bot)
aef019b04a
[3.12] Improve the sieve() recipe in the itertools docs (gh-109199) (#109203)
Improve the sieve() recipe in the itertools docs (gh-109199)

Lazier sieve
(cherry picked from commit d3ed9921cd)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-09-12 16:00:33 +02:00
Miss Islington (bot)
888bcf49c0
[3.12] Fix an ironic typo in a code comment. (gh-109186) (#109188)
Fix an ironic typo in a code comment. (gh-109186)
(cherry picked from commit 75cd86599b)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-09-12 16:00:13 +02:00
Jelle Zijlstra
acde502e8a
[3.12] gh-109118: Fix runtime crash when NameError happens in PEP 695 function (GH-109123) (#109173)
* gh-109118: Fix runtime crash when NameError happens in PEP 695 function (#109123)

(cherry picked from commit 17f994174d)

* [3.12] gh-109118: Fix runtime crash when NameError happens in PEP 695 function (GH-109123).
(cherry picked from commit 17f994174d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-09-12 15:59:09 +02:00
Miss Islington (bot)
c76f4b97dc
[3.12] GH-109067: fix randomly failing test_async_gen_asyncio_gc_aclose_09 test (GH-109142) (#109149)
GH-109067: fix randomly failing `test_async_gen_asyncio_gc_aclose_09` test (GH-109142)

Use `asyncio.sleep(0)` instead of short sleeps.
(cherry picked from commit ccd48623d4)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2023-09-12 15:56:02 +02:00
Miss Islington (bot)
ca848bbf78
[3.12] gh-109022: [Enum] require names=() to create empty enum type (GH-109048) (#109122)
gh-109022: [Enum] require `names=()` to create empty enum type (GH-109048)

add guard so that ``Enum('bar')`` raises a TypeError instead of
creating a new enum class called `bar`.  To create the new but
empty class, use:

    huh = Enum('bar', names=())
(cherry picked from commit c74e440168)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-09-12 15:53:16 +02:00
Miss Islington (bot)
d533ab17ec
[3.12] gh-108732: include comprehension locals in frame.f_locals (GH-109026) (#109097)
gh-108732: include comprehension locals in frame.f_locals (GH-109026)
(cherry picked from commit f2584eade3)

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-09-12 15:50:29 +02:00
Miss Islington (bot)
af83d1e821
[3.12] gh-106922: Fix error location for constructs with spaces and parentheses (GH-108959) (#109147)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-09-08 17:04:28 +00:00
Miss Islington (bot)
a1ba0e531c
[3.12] gh-103186: Suppress RuntimeWarning about unclosed async iterator in test_sys_settrace (GH-109075) (#109138)
gh-103186: Suppress RuntimeWarning about unclosed async iterator in test_sys_settrace (GH-109075)
(cherry picked from commit d485551c9d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-08 17:56:11 +02:00
Miss Islington (bot)
fff524ede8
[3.12] Add version directives to ast docs (GH-108788) (#109106)
Add version directives to ast docs (GH-108788)
(cherry picked from commit 74fc96bc60)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-09-08 15:25:55 +02:00
Miss Islington (bot)
68ba35eecb
[3.12] gh-68403: Fix test_coverage in test_trace (GH-108910) (#109104)
gh-68403: Fix test_coverage in test_trace (GH-108910)

Its behavior no longer affected by test running options such as -m.
(cherry picked from commit 7e1a7abb98)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-08 15:25:18 +02:00
Miss Islington (bot)
41ff5b0674
[3.12] gh-75743: Restore test_timeout.testConnectTimeout() (GH-109087) (#109103)
gh-75743: Restore test_timeout.testConnectTimeout() (GH-109087)

This un-skips this test now that pythontest.net implements appropriate firewall
rules for it.
(cherry picked from commit 1829a3c9a3)

Co-authored-by: Ee Durbin <ewdurbin@gmail.com>
2023-09-08 15:24:55 +02:00
Miss Islington (bot)
b27ca96a0f
[3.12] gh-107924: re-order os.sendfile() flag documentation (GH-107926) (#109099)
gh-107924: re-order os.sendfile() flag documentation (GH-107926)
(cherry picked from commit 403ab1306a)

Co-authored-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-08 15:24:18 +02:00
Miss Islington (bot)
4cb29bb683
[3.12] gh-102823: Document return type of floor division on floats (GH-102824) (#109092)
gh-102823: Document return type of floor division on floats (GH-102824)
(cherry picked from commit b72251de93)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-08 15:23:41 +02:00
Miss Islington (bot)
2ce26121b1
[3.12] socket documentation fix - rename triple to 3-tuple (GH-24722) (#109073)
socket documentation fix - rename triple to 3-tuple (GH-24722)
(cherry picked from commit 6b15ff5235)

Co-authored-by: Ori Hoch <ori@uumpa.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-08 15:23:12 +02:00
Miss Islington (bot)
82f5291a1d
[3.12] gh-71770: Add more details on behavior of configparser's default_section (GH-31562) (#109088)
gh-71770: Add more details on behavior of configparser's default_section (GH-31562)
(cherry picked from commit 891236f482)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-08 15:22:33 +02:00
Miss Islington (bot)
02e51f86d8
[3.12] gh-103186: Remove debug print in test_sys_settrace (GH-109077) (#109084)
gh-103186: Remove debug print in test_sys_settrace (GH-109077)
(cherry picked from commit e4bb0026b9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-08 15:22:19 +02:00
Miss Islington (bot)
26f42b34f1
[3.12] GH-90915: Document that SystemExit doesn't trigger sys.excepthook (GH-31357) (#109082)
GH-90915: Document that SystemExit doesn't trigger sys.excepthook (GH-31357)
(cherry picked from commit 1294fcede0)

Co-authored-by: Colin Watson <cjwatson@debian.org>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-08 15:22:08 +02:00
Miss Islington (bot)
736c413977
[3.12] bpo-38157: Add example about per file output for mock_open. (GH-16090) (#109071)
bpo-38157: Add example about per file output for mock_open. (GH-16090)
(cherry picked from commit e183a71eef)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-08 15:21:51 +02:00
Miss Islington (bot)
29404b6d25
[3.12] gh-103186: Suppress and assert expected RuntimeWarnings in test_sys_settrace (GH-103244) (#109066)
gh-103186: Suppress and assert expected RuntimeWarnings in test_sys_settrace (GH-103244)

Caused as a result of frame manipulation where locals are never assigned / initialised.
(cherry picked from commit 3e53ac9903)

Co-authored-by: Ijtaba Hussain <ijtabahussain@live.com>
2023-09-08 15:21:38 +02:00
Miss Islington (bot)
8c9f5f714e
[3.12] test.pythoninfo logs freedesktop_os_release() (GH-109057) (#109064)
test.pythoninfo logs freedesktop_os_release() (GH-109057)
(cherry picked from commit babdced23f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-08 15:20:05 +02:00
Shantanu
2979cee1af
[3.12] gh-108915: Removes extra backslashes in str.split docstring (GH-109044). (#109061)
* [3.12] gh-108915: Removes extra backslashes in str.split docstring (GH-109044).
(cherry picked from commit e7d5433f94)

Co-authored-by: Daniel Weiss <134341009+justdan6@users.noreply.github.com>

* re-clinic

---------

Co-authored-by: Daniel Weiss <134341009+justdan6@users.noreply.github.com>
2023-09-08 15:19:38 +02:00
Victor Stinner
de0202e937
[3.12] gh-108740: Fix "make regen-all" race condition (#108741) (#109019)
gh-108740: Fix "make regen-all" race condition (#108741)

Fix a race condition in "make regen-all". The deepfreeze.c source and
files generated by Argument Clinic are now generated or updated
before generating "global objects". Previously, some identifiers may
miss depending on the order in which these files were generated.

* "make regen-global-objects": Make sure that deepfreeze.c is
  generated and up to date, and always run "make clinic".
* "make clinic" no longer runs generate_global_objects.py script.
* "make regen-deepfreeze" now only updates deepfreeze.c (C file).
  It doesn't build deepfreeze.o (object) anymore.
* Remove misleading messages in "make regen-global-objects" and
  "make clinic". They are now outdated, these commands are now
  safe to use.
* Document generates files in Doc/using/configure.rst.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
(cherry picked from commit db1ee6a19a)
2023-09-08 15:19:20 +02:00
Miss Islington (bot)
55d7e8fef1
[3.12] gh-108851: Fix tomllib recursion tests (GH-108853) (#109012)
gh-108851: Fix tomllib recursion tests (GH-108853)

* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().
(cherry picked from commit 8ff1142578)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-08 15:18:02 +02:00
Miss Islington (bot)
038b0a9cb0
[3.12] gh-89392: Use unittest test runner for doctests in test_getopt (GH-108916) (#108919)
gh-89392: Use unittest test runner for doctests in test_getopt (GH-108916)
(cherry picked from commit f980cc19b9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-08 15:17:14 +02:00
Miss Islington (bot)
da02508a0e
[3.12] gh-89392: Use normal unittest runner in test_type_cache (GH-108911) (#108913)
gh-89392: Use normal unittest runner in test_type_cache (GH-108911)
(cherry picked from commit eaabaac7c0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-08 15:16:55 +02:00
Miss Islington (bot)
4b749ba470
[3.12] gh-91960: Skip test_gdb if gdb cannot retrive Python frames (GH-108999) (#109010)
gh-91960: Skip test_gdb if gdb cannot retrive Python frames (GH-108999)

Skip test_gdb if gdb is unable to retrieve Python frame objects: if a
frame is "<optimized out>". When Python is built with "clang -Og",
gdb can fail to retrive the 'frame' parameter of
_PyEval_EvalFrameDefault(). In this case, tests like py_bt() are
likely to fail. Without getting access to Python frames,
python-gdb.py is mostly clueless on retrieving the Python traceback.
Moreover, test_gdb is no longer skipped on macOS if Python is built
with Clang.
(cherry picked from commit fbce43a251)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-08 15:16:16 +02:00