Commit Graph

29362 Commits

Author SHA1 Message Date
Miss Islington (bot) 942ef7bde4
[3.11] gh-111806: Fix `test_recursion` in `test_richcmp` on WASI builds (GH-111830) (GH-111832)
gh-111806: Fix `test_recursion` in `test_richcmp` on WASI builds (GH-111830)
(cherry picked from commit f115a55f0e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-07 22:04:18 +00:00
Donghee Na bd4cc4715f
[3.11] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 co… (gh-111771)
[3.11] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 codecs read out of bounds (gh-111695)
(cherry picked from commit c8faa3568a)

Co-authored-by: Masayuki Moriyama <masayuki.moriyama@miraclelinux.com>
2023-11-06 11:29:59 +00:00
Miss Islington (bot) 425efc1182
[3.11] gh-111159: Fix `SyntaxError` doctests for non-builtin exception classes (GH-111541) (#111733)
gh-111159: Fix `SyntaxError` doctests for non-builtin exception classes (GH-111541)
(cherry picked from commit 18c954849b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-04 10:12:15 +00:00
Miss Islington (bot) f7ffe4a8ea
[3.11] [3.12] GH-110894: Call loop exception handler for exceptions in client_connected_cb (GH-111601) (GH-111632) (#111634)
* [3.12] GH-110894: Call loop exception handler for exceptions in client_connected_cb (GH-111601) (GH-111632)
(cherry picked from commit 9aa88290d8)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Call loop exception handler for exceptions in `client_connected_cb` of `asyncio.start_server` so that applications can handle it..
(cherry picked from commit 229f44d353)

* gh-111644: Fix asyncio test_unhandled_exceptions() (#111713)

Fix test_unhandled_exceptions() of test_asyncio.test_streams: break
explicitly a reference cycle.

Fix also StreamTests.tearDown(): the loop must not be closed
explicitly, but using set_event_loop() which takes care of shutting
down the executor with executor.shutdown(wait=True).
BaseEventLoop.close() calls executor.shutdown(wait=False).

(cherry picked from commit ac01e2243a)

---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-04 01:23:01 +00:00
Miss Islington (bot) 89264a31ea
[3.11] gh-111644: Fix support threading_cleanup() (GH-111714) (#111717)
gh-111644: Fix support threading_cleanup() (GH-111714)

Copy the list of dangling threads to make sure that the list of
"Dangling thread" is complete. Previously, the list was incomplete if
threads completed just before the list was displayed.

Changes:

* Rewrite the warning to make it easier to understand.
* Use support.sleeping_retry().
* threading_cleanup() no longer copies threading._dangling,
  but only counts the number of dangling thread.
* Remove support.gc_support() call.
(cherry picked from commit f62c7ccf9a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-04 00:43:53 +00:00
Ethan Furman 4a61169672
[3.11] gh-111181: Fix enum doctests (GH-111180) (GH-111617)
gh-111181: Fix enum doctests (GH-111180)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
(cherry picked from commit c4dc5a6ae8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-03 16:51:56 -07:00
Miss Islington (bot) cfdcc96aba
[3.11] gh-111625: Fix link to Info-ZIP homepage (GH-111626) (#111640)
Co-authored-by: partev <petrosyan@gmail.com>
2023-11-02 11:36:35 +00:00
Miss Islington (bot) 1d7ad7780a
[3.11] gh-110367: Make regrtest --verbose3 compatible with --huntrleaks -jN (GH-111577) (#111590)
gh-110367: Make regrtest --verbose3 compatible with --huntrleaks -jN (GH-111577)

"./python -m test -j1 -R 3:3 --verbose3" now works as expected, since
run_single_test() does not replace sys.stdout with StringIO in this
case.
(cherry picked from commit d9a5530d23)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-01 03:57:23 +00:00
Pablo Galindo Salgado 19a266ca89
[3.11] gh-111366: Correctly show custom syntax error messages in the codeop module functions (GH-111384). (#111516)
(cherry picked from commit cd6e0a04a1)
2023-10-31 14:41:20 +00:00
Nikita Sobolev bc9f47097e
[3.11] gh-108303: Move all inspect test files to `test_inspect/` (GH-109607) (#111543) 2023-10-31 14:00:39 +00:00
Miss Islington (bot) 08e4e11b75
[3.11] gh-111380: Show SyntaxWarnings only once when parsing if invalid syntax is encouintered (GH-111381) (#111383)
gh-111380: Show SyntaxWarnings only once when parsing if invalid syntax is encouintered (GH-111381)
(cherry picked from commit 3d2f1f0b83)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-10-31 13:29:42 +00:00
Miss Islington (bot) a9d5966bce
[3.11] gh-111347: Remove wrong assertion in test_sendfile (GH-111377) (#111462)
gh-111347: Remove wrong assertion in test_sendfile (GH-111377)

Windows is different.
(cherry picked from commit fa35b9e89b)

Co-authored-by: zcxsythenew <30565051+zcxsythenew@users.noreply.github.com>
2023-10-30 18:14:30 -07:00
Miss Islington (bot) 78150c6f7b
[3.11] gh-111284: Make multiprocessing tests with threads faster and more reliable (GH-111285) (GH-111511)
(cherry picked from commit 624ace5a2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-30 17:44:27 +00:00
Miss Islington (bot) 68c03cef24
[3.11] gh-111426: Remove `test_cmd.test_coverage` (GH-111427) (#111433)
gh-111426: Remove `test_cmd.test_coverage` (GH-111427)
(cherry picked from commit 66bea2555d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-28 23:23:38 +00:00
Miss Islington (bot) 1a01ca44d6
[3.11] gh-110205: Fix asyncio ThreadedChildWatcher._join_threads() (GH-110884) (#111413)
- `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything.
- Threads created by that class are now named `asyncio-waitpid-NNN`.
- `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`.
(cherry picked from commit c3bb10c930)

Co-authored-by: Guido van Rossum <guido@python.org>
2023-10-27 16:36:24 -07:00
Pablo Galindo Salgado 22cde39fbf
[3.11] bpo-43950: handle wide unicode characters in tracebacks (GH-28150) (#111373) 2023-10-27 09:46:20 +09:00
Miss Islington (bot) 762aba72eb
[3.11] gh-111348: Fix direct invocation of `test_doctest`; remove `test_doctest.test_coverage` (GH-111349) (#111360)
gh-111348: Fix direct invocation of `test_doctest`; remove `test_doctest.test_coverage` (GH-111349)
(cherry picked from commit 31c05b72c1)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-10-26 13:12:27 +00:00
Savannah Ostrowski 12c7e5071c
[3.11] GH-94438: Restore ability to jump over None tests (GH-111338)
(cherry picked from commit 6640f1d)
2023-10-25 20:47:16 +00:00
Miss Islington (bot) 6fea61a9e0
[3.11] gh-111165: Add missed "support." prefix for "verbose" (GH-111327) (GH-111329)
(cherry picked from commit a4981921aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-25 15:15:50 +00:00
Serhiy Storchaka fc9a5ef1a8
[3.11] [3.12] gh-111165: Move test running code from test.support to libregrtest (GH-111166) (GH-111316) (GH-111318)
Remove no longer used functions run_unittest() and run_doctest() from
the test.support module.
(cherry picked from commit f6a45a03d0)
(cherry picked from commit 5c4f9a1c7e)
2023-10-25 12:37:19 +00:00
Serhiy Storchaka 14167031eb
[3.11] gh-111309: Use unittest to collect and run distutils tests (GH-111311)
* use unittest.main() instead of run_unittest(test_suite()) to run tests from
  modules via the CLI
* add explicit load_tests() to load doctests
* use test.support.load_package_tests() to load tests in submodules of
  distutils.tests
* removes no longer needed test_suite() functions
2023-10-25 14:57:17 +03:00
Miss Islington (bot) bb92fdabc7
[3.11] gh-111174: Fix crash in getbuffer() called repeatedly for empty BytesIO (GH-111210) (GH-111315)
(cherry picked from commit 9da98c0d9a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-25 11:18:30 +00:00
Miss Islington (bot) 652d3f33fb
[3.11] gh-109017: Use non alternate name for Kyiv (GH-109251) (GH-111279)
tzdata provides Kiev as an alternative to Kyiv:
https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314GH-L314

But Debian moved it to the tzdata-legacy package breaking the test:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050530

This patch switches to the name provided by tzdata.

Also check that the new name is actually available.
(cherry picked from commit 46407fe79c)

Co-authored-by: Jochen Sprickerhof <github@jochen.sprickerhof.de>
2023-10-24 23:56:02 +03:00
Furkan Onder f446df741f
[3.11] gh-67565: Add tests for C-contiguity checks (GH-110951) (GH-111199)
(cherry picked from commit 9376728ce4)
2023-10-23 12:49:44 +03:00
Miss Islington (bot) 3c3c489d41
[3.11] gh-110196: Fix ipaddress.IPv6Address.__reduce__ (GH-110198) (GH-111190)
(cherry picked from commit 767f416feb)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-10-22 19:12:58 +00:00
Miss Islington (bot) cf777399a9
[3.11] gh-111085: Fix invalid state handling in TaskGroup and Timeout (GH-111111) (GH-111172)
asyncio.TaskGroup and asyncio.Timeout classes now raise proper RuntimeError
if they are improperly used.

* When they are used without entering the context manager.
* When they are used after finishing.
* When the context manager is entered more than once (simultaneously or
  sequentially).
* If there is no current task when entering the context manager.

They now remain in a consistent state after an exception is thrown,
so subsequent operations can be performed correctly (if they are allowed).

(cherry picked from commit 6c23635f2b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
2023-10-21 19:40:07 +00:00
Miss Islington (bot) cf28c61c73
[3.11] gh-111159: Fix `doctest` output comparison for exceptions with notes (GH-111160) (#111170)
gh-111159: Fix `doctest` output comparison for exceptions with notes (GH-111160)
(cherry picked from commit fd60549c0a)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-21 18:23:38 +00:00
Serhiy Storchaka 4222dd93af
[3.11] gh-110918: regrtest: allow to intermix --match and --ignore options (GH-110919) (GH-111168)
Test case matching patterns specified by options --match, --ignore,
--matchfile and --ignorefile are now tested in the order of
specification, and the last match determines whether the test case be run
or ignored.
(cherry picked from commit 9a1fe09622)
2023-10-21 17:30:19 +00:00
Miss Islington (bot) 47670fbdd0
[3.11] gh-110932: Fix regrtest for SOURCE_DATE_EPOCH (GH-111143) (#111153)
gh-110932: Fix regrtest for SOURCE_DATE_EPOCH (GH-111143)

If the SOURCE_DATE_EPOCH environment variable is defined, use its
value as the random seed.
(cherry picked from commit 7237fb578d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-21 09:01:10 +00:00
Miss Islington (bot) 9addf2cf11
[3.11] gh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing` (GH-111127) (#111131)
gh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing` (GH-111127)
(cherry picked from commit ea7c26e4b8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-20 18:28:41 +00:00
Miss Islington (bot) 7213fc248d
[3.11] Synchronize test_contextlib with test_contextlib_async (GH-111000) (GH-111115)
(cherry picked from commit ff4e53cb74)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-20 14:33:22 +00:00
Radislav Chugunov 26a028269b
[3.11] gh-108791: Fix pdb CLI invalid argument handling (GH-108816) (#111063)
* [3.11] gh-108791: Fix `pdb` CLI invalid argument handling (GH-108816)
(cherry picked from commit 162213f2db)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
2023-10-19 14:26:40 +01:00
Tian Gao fabfc2ccfc
[3.11] GH-65052: Prevent pdb from crashing when trying to display objects (GH-111002)
(cherry picked from commit c523ce0f43)
2023-10-18 16:42:36 -07:00
Pablo Galindo Salgado 4e4a3e161f
[3.11] gh-110696: Fix incorrect syntax error message for incorrect argument unpacking (GH-110706) (#110766) 2023-10-18 13:59:17 +01:00
Victor Stinner 4ccd418a02
[3.11] gh-110756: Fix libregrtest clear_caches() for distutils (#111011)
gh-110756: Fix libregrtest clear_caches() for distutils

Restore code removed by recent sync with the main branch which no
longer has distutils:
commit 26748ed4f6.
2023-10-17 23:20:36 +00:00
Lysandros Nikolaou 1af7b7db0d
[3.11] gh-107450: Check for overflow in the tokenizer and fix overflow test (GH-110832) (#110939)
(cherry picked from commit a1ac5590e0)

Co-authored-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-18 00:34:56 +02:00
Miss Islington (bot) 73ebe2f881
[3.11] gh-110995: Fix test_gdb check_usable_gdb() (GH-110998) (#111004)
gh-110995: Fix test_gdb check_usable_gdb() (GH-110998)

Fix detection of gdb built without Python scripting support.

* check_usable_gdb() doesn't check gdb exit code when calling
  run_gdb().
* Use shutil.which() to get the path to the gdb program.
(cherry picked from commit 920b3dfaca)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-17 18:43:46 +00:00
Miss Islington (bot) ae495de4e6
[3.11] gh-110695: test_asyncio uses 50 ms for clock resolution (GH-110952) (#110971)
gh-110695: test_asyncio uses 50 ms for clock resolution (GH-110952)

Before utils.CLOCK_RES constant was added (20 ms), test_asyncio
already used 50 ms.
(cherry picked from commit 9a9fba825f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-17 09:59:10 +00:00
Alex Waygood 5f7aba938c
[3.11] Enable ruff on several more files in `Lib/test` (#110929) (#110935)
(cherry-picked from commit 02d26c4bef)
2023-10-16 23:17:59 +03:00
Miss Islington (bot) 6502a130e4
[3.11] regrtest: Prepend 'use' options in --{fast,slow}-ci (GH-110363) (#110924)
regrtest: Prepend 'use' options in --{fast,slow}-ci (GH-110363)

This allows individual resources to be disabled without having to explicitly re-enable all others.
(cherry picked from commit b75186f69e)

Co-authored-by: Zachary Ware <zach@python.org>
2023-10-16 14:55:52 +00:00
Serhiy Storchaka 5c55f50a71
[3.11] [3.12] bpo-42663: Fix parsing TZ strings in zoneinfo module (GH-23825) (GH-110882) (GH-110889)
zipinfo now supports the full range of values in the TZ string
determined by RFC 8536 and detects all invalid formats.
Both Python and C implementations now raise exceptions of the same
type on invalid data.
(cherry picked from commit ab08ff7882)
(cherry picked from commit 72b0f0eaf5)
2023-10-15 08:32:26 +00:00
Miss Islington (bot) 1c26f1ce6c
[3.11] gh-109747: Improve errors for unsupported look-behind patterns (GH-109859) (GH-110860)
Now re.error is raised instead of OverflowError or RuntimeError for
too large width of look-behind pattern.

The limit is increased to 2**32-1 (was 2**31-1).
(cherry picked from commit e2b3d831fd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-14 06:51:24 +00:00
Miss Islington (bot) b2a95f694a
[3.11] gh-107450: Fix parser column offset overflow test on Windows (GH-110768) (#110809)
(cherry picked from commit 05439d3087)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-13 10:32:42 +02:00
Victor Stinner 26748ed4f6
gh-110756: Sync regrtest with main branch (#110758) (#110781)
Copy files from main to this branch:

* Lib/test/libregrtest/*.py
* Lib/test/__init__.py
* Lib/test/__main__.py
* Lib/test/autotest.py
* Lib/test/pythoninfo.py
* Lib/test/regrtest.py
* Lib/test/test_regrtest.py

Copy also changes from:

* Lib/test/support/__init__.py
* Lib/test/support/os_helper.py
* Lib/test/support/testresult.py
* Lib/test/support/threading_helper.py
* Lib/test/test_support.py

Do not modify scripts running tests such as Makefile.pre.in,
.github/workflows/build.yml or Tools/scripts/run_tests.py: do not use
--fast-ci and --slow-ci in this change.

Changes:

* SPLITTESTDIRS: don't include test_inspect.
* Add utils.process_cpu_count() using len(os.sched_getaffinity(0)).
* test_regrtest doesn't use @support.without_optimizer which doesn't
  exist in Python 3.11.
* Add support.set_sanitizer_env_var().
* Update test_faulthandler to use support.set_sanitizer_env_var().
* @support.without_optimizer doesn't exist in 3.11.
* Add support.Py_DEBUG.
* regrtest.refleak: 3.11 doesn't have sys.getunicodeinternedsize.
2023-10-12 21:45:36 +00:00
Miss Islington (bot) c9214b90f4
[3.11] gh-107450: Raise OverflowError when parser column offset overflows (GH-110754) (#110763)
(cherry picked from commit fb7843ee89)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-10-12 09:57:36 +00:00
Miss Islington (bot) f98903542c
[3.11] gh-110673: test_pty raises on short write (GH-110677) (#110743)
gh-110673: test_pty raises on short write (GH-110677)

Add write_all() helper function to test_pty to raise an exception on
short write: if os.writes() does not write all bytes. It should not
happen for a PTY.
(cherry picked from commit b4e8049766)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-12 10:09:49 +02:00
Miss Islington (bot) 79b81d1825
[3.11] gh-76106: Remove the cleanup lock in test_socket (GH-110539) (GH-110700)
It does not already work (because it locks only addCleanup(), not doCleanups()),
and it is no longer needed since the clean up procedure waits for all test threads to join.
(cherry picked from commit f27b830907)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-11 11:13:06 +00:00
Miss Islington (bot) c6d5628be9
[3.11] gh-110662: multiprocessing test_async_timeout() increase timeout (GH-110663) (#110675)
gh-110662: multiprocessing test_async_timeout() increase timeout (GH-110663)

Increase timeout from 1 second to 30 seconds, if not longer. The
important part is that apply_async() takes longer than TIMEOUT2.
(cherry picked from commit 790ecf6302)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-11 05:07:03 +02:00
Miss Islington (bot) 8ca7a230e7
[3.11] gh-110666: Fix multiprocessing test_terminate() elapsed (GH-110667) (#110669)
gh-110666: Fix multiprocessing test_terminate() elapsed (GH-110667)

multiprocessing test_terminate() and test_wait_socket_slow() no
longer test the CI performance: no longer check maximum elapsed time.

Add CLOCK_RES constant: tolerate a difference of 100 ms.
(cherry picked from commit 1556f426da)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-11 02:09:53 +00:00
Miss Islington (bot) 7984dc28b3
[3.11] gh-110656: Fix logging test_post_fork_child_no_deadlock() if ASAN (GH-110657) (#110665)
gh-110656: Fix logging test_post_fork_child_no_deadlock() if ASAN (GH-110657)

Skip test_post_fork_child_no_deadlock() if Python is built with ASAN.

Add support.HAVE_ASAN_FORK_BUG.
(cherry picked from commit f901f56313)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-11 01:22:51 +00:00
Miss Islington (bot) 46347d3caf
[3.11] gh-110647: Fix signal test_stress_modifying_handlers() (GH-110650) (#110659)
gh-110647: Fix signal test_stress_modifying_handlers() (GH-110650)

* cycle_handlers() now waits until at least one signal is received.
* num_received_signals can be equal to num_sent_signals.
(cherry picked from commit e07c37cd52)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-11 00:21:51 +00:00
Miss Islington (bot) 28c6cc1928
[3.11] [3.12] gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) (GH-109682) (#110646)
[3.12] gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) (GH-109682)

* gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489)
(cherry picked from commit e57ecf6bbc)

Python 3.12 backport: update also `test_nntplib`.

(cherry picked from commit c2d542b42c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: T. Wouters <thomas@python.org>
2023-10-10 21:02:21 +00:00
Serhiy Storchaka 3788c48d12
[3.11] gh-110388: Add tests for tty (GH-110394) (GH-110634)
(cherry picked from commit 7f702b2)
2023-10-10 16:27:22 +02:00
Miss Islington (bot) e511f544ea
[3.11] gh-81002: Add tests for termios (GH-110386) (GH-110620)
(cherry picked from commit 92a9e98024)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-10 14:11:06 +02:00
Miss Islington (bot) bf1753bb4c
[3.11] gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async (GH-110500) (#110611)
It now fails if the original bug is not fixed, and no longer produce ResourceWarning with fixed code.
(cherry picked from commit 5aa62a8de1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-10 13:12:40 +02:00
Miss Islington (bot) 7fefed091a
[3.11] gh-110590: Fix a bug where _sre.compile would overwrite exceptions (GH-110591) (#110614)
TypeError would be overwritten by OverflowError
if 'code' param contained non-ints.
(cherry picked from commit 344d3a222a)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-10 10:48:07 +00:00
Miss Islington (bot) 2b3a418279
[3.11] gh-110378: Close invalid generators in contextmanager and asynccontextmanager (GH-110499) (#110589)
contextmanager and asynccontextmanager context managers now close an invalid
underlying generator object that yields more then one value.
(cherry picked from commit 96fed66a65)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-10-10 11:12:52 +02:00
Miss Islington (bot) e913c6f4d6
[3.11] gh-110519: Improve deprecation warning in the gettext module (GH-110520) (GH-110564)
Deprecation warning about non-integer numbers in gettext now always refers
to the line in the user code where gettext function or method is used.
Previously, it could refer to a line in gettext code.

Also, increase test coverage for NullTranslations and domain-aware functions
like dngettext().
(cherry picked from commit 326c6c4e07)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-09 16:10:34 +02:00
Miss Islington (bot) af168df78f
[3.11] gh-109848: Make test_rot13_func in test_codecs independent (GH-109850) (GH-110505)
(cherry picked from commit b987fdb19b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-07 13:24:27 +00:00
Miss Islington (bot) 682321292f
[3.11] gh-109864: Make test_gettext tests order independent (GH-109866) (GH-110503)
(cherry picked from commit 1aad4fc5db)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-07 13:23:54 +00:00
Miss Islington (bot) 49a45f6cd8
[3.11] gh-110184: Fix subprocess test_pipesize_default() (GH-110465) (#110472)
gh-110184: Fix subprocess test_pipesize_default() (GH-110465)

For proc.stdin, get the size of the read end of the test pipe.

Use subprocess context manager ("with proc:").
(cherry picked from commit d023d4166b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-06 14:11:51 +00:00
Victor Stinner 88223f15d7
[3.11] Add support.MS_WINDOWS constant (#110446) (#110452) (#110464)
[3.12] Add support.MS_WINDOWS constant (#110446) (#110452)

Add support.MS_WINDOWS constant (#110446)

(cherry picked from commit e0c4437793)
(cherry picked from commit e188534607)
2023-10-06 10:19:49 +00:00
Miss Islington (bot) 67129c379c
[3.11] gh-109888: Fix test_os _kill_with_event() on Windows (GH-110421) (#110443)
gh-109888: Fix test_os _kill_with_event() on Windows (GH-110421)

Replace os.kill() with proc.kill() which catchs PermissionError.

Rewrite _kill_with_event():

* Use subprocess context manager ("with proc:").
* Use sleeping_retry() to wait until the child process is ready.
* Replace SIGINT with proc.kill() on error.
* Replace 10 seconds with SHORT_TIMEOUT to wait until the process is
  ready.
* Replace 0.5 seconds with SHORT_TIMEOUT to wait for the process
  exit.
(cherry picked from commit aaf297c048)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 22:06:28 +00:00
Miss Islington (bot) 4134036ce9
[3.11] gh-110393: Remove watchdog with hardcoded timeout (GH-110400) (#110444)
gh-110393: Remove watchdog with hardcoded timeout (GH-110400)

test_builtin and test_socketserver no longer use signal.alarm() to
implement a watchdog with a hardcoded timeout (2 and 60 seconds).
Python test runner regrtest has two watchdogs: faulthandler and
timeout on running worker processes. Tests using short hardcoded
timeout can fail on slowest buildbots just because the timeout is too
short.
(cherry picked from commit 1328fa31fe)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 22:05:20 +00:00
Miss Islington (bot) 331d90f30b
[3.11] [3.12] gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (GH-110413) (GH-110427) (#110440)
[3.12] gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (GH-110413) (GH-110427)

gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (GH-110413)

Increase support.LOOPBACK_TIMEOUT from 5 to 10 seconds. Also increase
the timeout depending on the --timeout option. For example, for a
test timeout of 40 minutes (ARM Raspbian 3.x), use LOOPBACK_TIMEOUT
of 20 seconds instead of 5 seconds before.

(cherry picked from commit 350d89b795)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 0db2f1475e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 23:10:01 +02:00
Miss Islington (bot) a503bdf21f
[3.11] gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428) (#110431)
gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428)

Don't measure the CI performance: don't fail if cond.wait_for() takes
longer than 1 second on a slow CI.
(cherry picked from commit 5eae8dc2cb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 19:53:14 +00:00
Miss Islington (bot) 8da3367067
[3.11] gh-110167: Fix test_socket deadlock in doCleanups() (GH-110416) (#110424)
gh-110167: Fix test_socket deadlock in doCleanups() (GH-110416)

Fix a deadlock in test_socket when server fails with a timeout but
the client is still running in its thread. Don't hold a lock to call
cleanup functions in doCleanups(). One of the cleanup function waits
until the client completes, whereas the client could deadlock if it
called addCleanup() in such situation.

doCleanups() is called when the server completed, but the client can
still be running in its thread especially if the server failed with a
timeout. Don't put a lock on doCleanups() to prevent deadlock between
addCleanup() called in the client and doCleanups() waiting for
self.done.wait of ThreadableTest._setUp().
(cherry picked from commit 318f5df271)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 19:18:44 +00:00
Miss Islington (bot) cacea7a272
[3.11] gh-110391: socket NetworkConnectionAttributesTest always declare cli (GH-110401) (#110406)
gh-110391: socket NetworkConnectionAttributesTest always declare cli (GH-110401)

NetworkConnectionAttributesTest of test_socket now always declare the
'cli' attribute, so clientTearDown() cannot fail with AttributeError.
(cherry picked from commit e37d4557c3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-05 16:58:46 +00:00
Hugo van Kemenade b0e43cb6cb
[3.11] Lint: Remove files that no longer fail to parse (GH-110356) (#110361)
Remove files that no longer fail to parse
2023-10-04 15:30:48 +01:00
Victor Stinner 8f22504d74
[3.11] gh-109974: Fix threading lock_tests race conditions (#110057) (#110355)
[3.12] gh-109974: Fix threading lock_tests race conditions (#110057) (#110346)

* gh-109974: Fix threading lock_tests race conditions (#110057)

Fix race conditions in test_threading lock tests. Wait until a
condition is met rather than using time.sleep() with a hardcoded
number of seconds.

* Replace sleeping loops with support.sleeping_retry() which raises
  an exception on timeout.
* Add wait_threads_blocked(nthread) which computes a sleep depending
  on the number of threads. Remove _wait() function.
* test_set_and_clear(): use a way longer Event.wait() timeout.
* BarrierTests.test_repr(): wait until the 2 threads are waiting for
  the barrier. Use a way longer timeout for Barrier.wait() timeout.
* test_thread_leak() no longer needs to count
  len(threading.enumerate()): Bunch uses
  threading_helper.wait_threads_exit() internally which does it in
  wait_for_finished().
* Add BaseLockTests.wait_phase() which implements a timeout.
  test_reacquire() and test_recursion_count() use wait_phase().

(cherry picked from commit 4e356ad183)

* gh-109974: Fix more threading lock_tests race conditions (#110089)

* Add context manager on Bunch class.
* Bunch now catchs exceptions on executed functions and re-raise them
  at __exit__() as an ExceptionGroup.
* Rewrite BarrierProxy.test_default_timeout(). Use a single thread.
  Only check that barrier.wait() blocks for at least default timeout
  seconds.
* test_with(): inline _with() function.

(cherry picked from commit 743e3572ee)
(cherry picked from commit 1d032ea3d6)
2023-10-04 12:07:57 +00:00
Miss Islington (bot) aa8d3db6f2
[3.11] [3.12] gh-109972: Enhance test_gdb (GH-110026) (GH-110351) (#110354)
[3.12] gh-109972: Enhance test_gdb (GH-110026) (GH-110351)

* gh-109972: Enhance test_gdb (GH-110026)

* Split test_pycfunction.py: add test_cfunction_full.py.
  Split the function into the following 6 functions. In verbose
  mode, these "pycfunction" tests now log each tested call.

  * test_pycfunction_noargs()
  * test_pycfunction_o()
  * test_pycfunction_varargs()
  * test_pycfunction_varargs_keywords()
  * test_pycfunction_fastcall()
  * test_pycfunction_fastcall_keywords()

* Move get_gdb_repr() to PrettyPrintTests.
* Replace DebuggerTests.get_sample_script() with SAMPLE_SCRIPT.
* Rename checkout_hook_path to CHECKOUT_HOOK_PATH.
* Rename gdb_version to GDB_VERSION_TEXT.
* Replace (gdb_major_version, gdb_minor_version) with GDB_VERSION.
* run_gdb() uses "backslashreplace" error handler instead of "replace".
* Add check_gdb() function to util.py.
* Enhance support.check_cflags_pgo(): check also for sysconfig
  PGO_PROF_USE_FLAG (if available) in compiler flags.
* Move some SkipTest checks to test_gdb/__init__.py.
* Elaborate why gdb cannot be tested on Windows: gdb doesn't support
  PDB debug symbol files.

(cherry picked from commit 757cbd4f29)

* 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)

* gh-110166: Fix gdb CFunctionFullTests on ppc64le clang build (GH-110331)

CFunctionFullTests now also runs "bt" command before "py-bt-full",
similar to CFunctionTests which also runs "bt" command before
"py-bt". So test_gdb can skip the test if patterns like "?? ()" are
found in the gdb output.

(cherry picked from commit bbce8bd05d)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 1de9406f91)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-04 12:03:28 +00:00
Miss Islington (bot) d507493078
[3.11] gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-110334) (#110348)
gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-110334)
(cherry picked from commit e9f2352b7b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-04 11:17:38 +00:00
Victor Stinner f9ac377626
[3.11] Add test.support.busy_retry() (#93770) (#110341)
Add test.support.busy_retry() (#93770)

Add busy_retry() and sleeping_retry() functions to test.support.

(cherry picked from commit 7e9eaad864)
2023-10-04 12:58:49 +02:00
Victor Stinner 6c98c734c7
[3.11] gh-109972: Split test_gdb.py into test_gdb package (#109977) (… (#110343)
[3.12] gh-109972: Split test_gdb.py into test_gdb package (#109977) (#110339)

gh-109972: Split test_gdb.py into test_gdb package (#109977)

Split test_gdb.py file into a test_gdb package made of multiple
tests, so tests can now be run in parallel.

* Create Lib/test/test_gdb/ directory.
* Split test_gdb.py into multiple files in Lib/test/test_gdb/
  directory.
* Move Lib/test/gdb_sample.py to Lib/test/test_gdb/ directory.
  Update get_sample_script(): use __file__ to locate gdb_sample.py.
* Move gdb_has_frame_select() and HAS_PYUP_PYDOWN to test_misc.py.
* Explicitly skip test_gdb on Windows. Previously, test_gdb was
  skipped even if gdb was available because of
  gdb_has_frame_select().

(cherry picked from commit 8f324b7ecd)
(cherry picked from commit e7a61d34b7)
2023-10-04 10:53:28 +00:00
Miss Islington (bot) 5039db7f9b
[3.11] gh-110267: Add tests for pickling and copying PyStructSequence objects (GH-110272) (GH-110284)
(cherry picked from commit 2d4865d775)

Co-authored-by: Xuehai Pan <XuehaiPan@pku.edu.cn>
2023-10-04 12:01:19 +03:00
Miss Islington (bot) 4e44927a0e
[3.11] gh-109917: Fix test instability in test_concurrent_futures (GH-110306) (#110316)
gh-109917: Fix test instability in test_concurrent_futures (GH-110306)

The test had an instability issue due to the ordering of the dummy
queue operation and the real wakeup pipe operations. Both primitives
are thread safe but not done atomically as a single update and may
interleave arbitrarily. With the old order of operations this can lead
to an incorrect state where the dummy queue is full but the wakeup
pipe is empty. By swapping the order in clear() I think this can no
longer happen in any possible operation interleaving (famous last
words).
(cherry picked from commit a376a72bd9)

Co-authored-by: elfstrom <elfstrom@users.noreply.github.com>
2023-10-03 23:27:56 +01:00
Alex Waygood 3079aa3f5d
[3.11] Enable ruff on `Lib/test/test_typing.py` (#110179) (#110290) 2023-10-03 15:09:06 +00:00
Miss Islington (bot) bf6843e91f
[3.11] [3.12] gh-109649: Enhance os.cpu_count() documentation (GH-110169) (#110226)
[3.12] gh-109649: Enhance os.cpu_count() documentation (GH-110169)

* gh-109649: Enhance os.cpu_count() documentation

* Doc: Specify that os.cpu_count() counts *logicial* CPUs.
* Doc: Specify that os.sched_getaffinity(0) is related to the calling
  thread.
* Fix test_posix.test_sched_getaffinity(): restore the old CPU mask
  when the test completes!

* Restore removed text
(cherry picked from commit 5245b97e13)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 18:36:55 -07:00
Victor Stinner 86084d001f
[3.11] gh-110160: Fix flaky `test_find_periodic_pattern` in `string_tests` (… (#110183)
gh-110160: Fix flaky `test_find_periodic_pattern` in `string_tests` (#110170)

(cherry picked from commit 06faa9a39b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-01 22:43:57 +02:00
Miss Islington (bot) 446c81c3c3
[3.11] gh-110088: Fix asyncio test_prompt_cancellation() (GH-110157) (#110159)
gh-110088: Fix asyncio test_prompt_cancellation() (GH-110157)

Don't measure the CI performance: don't test the maximum elapsed
time. The check failed on a slow CI.
(cherry picked from commit c62b49ecc8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-30 21:01:33 +00:00
Miss Islington (bot) 080f5b98d1
[3.11] gh-109748: Fix again venv test_zippath_from_non_installed_posix() (GH-110149) (#110153)
gh-109748: Fix again venv test_zippath_from_non_installed_posix() (GH-110149)

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.
(cherry picked from commit 0def8c712b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-30 18:46:37 +00:00
Miss Islington (bot) 42b6883d5f
[3.11] gh-107888: Fix test_mmap PROT_EXEC comment (GH-110125) (#110130)
gh-107888: Fix test_mmap PROT_EXEC comment (GH-110125)
(cherry picked from commit 14098b78f7)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-29 22:19:33 +00:00
Victor Stinner 190e8fbfb7
[3.11] gh-108851: Fix support.get_recursion_available() for USE_STACKCHECK (#110127)
Add _testcapi.USE_STACKCHECK.

USE_STACKCHECK on using on Windows 32-bit.
2023-09-29 23:54:46 +02:00
Miss Islington (bot) a95e8cf908
gh-109615: Look for 'Modules' as landmark for test_copy_python_src_ignore (GH-110108)
(cherry picked from commit 20bc5f7c28)

Co-authored-by: Steve Dower <steve.dower@python.org>
2023-09-29 15:48:59 +00:00
Miss Islington (bot) b07661d889
[3.11] gh-109592: test_eintr tolerates 20 ms when comparing timings (GH-110102) (#110107)
gh-109592: test_eintr tolerates 20 ms when comparing timings (GH-110102)
(cherry picked from commit 9c73a9acec)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-29 13:47:24 +00:00
Victor Stinner 8ac6890d5e
[3.11] gh-110031: Skip test_threading fork tests if ASAN (#110100) (#110104)
gh-110031: Skip test_threading fork tests if ASAN (#110100)

Skip test_threading tests using thread+fork if Python is built with
Address Sanitizer (ASAN).

(cherry picked from commit 86e76ab8af)
2023-09-29 15:19:37 +02:00
Victor Stinner 184ce1414b
[3.11] gh-110088, gh-109878: Fix test_asyncio timeouts (#110092) (#110099)
gh-110088, gh-109878: Fix test_asyncio timeouts (#110092)

Fix test_asyncio timeouts: don't measure the maximum duration, a test
should not measure a CI performance. Only measure the minimum
duration when a task has a timeout or delay. Add CLOCK_RES to
test_asyncio.utils.

(cherry picked from commit db0a258e79)
2023-09-29 14:16:15 +02:00
Miss Islington (bot) efe83ad276
[3.11] gh-110036: multiprocessing Popen.terminate() catches PermissionError (GH-110037) (#110065)
gh-110036: multiprocessing Popen.terminate() catches PermissionError (GH-110037)

On Windows, multiprocessing Popen.terminate() now catchs
PermissionError and get the process exit code. If the process is
still running, raise again the PermissionError. Otherwise, the
process terminated as expected: store its exit code.
(cherry picked from commit bd4518c60c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-29 01:04:58 +00:00
Miss Islington (bot) a99729599a
[3.11] gh-109960: Remove test_pty timeout of 10 seconds (GH-110058) (#110061)
gh-109960: Remove test_pty timeout of 10 seconds (GH-110058)

In 2003, test_pty got a hardcoded timeout of 10 seconds to prevent
hanging on AIX & HPUX "if run after test_openpty":
commit 7d8145268e. Since 2003, test_pty
was no longer reported to hang on AIX. But today, the test can fail
simply because a CI is busy running other tests in parallel.
The timeout of 10 seconds is no longer needed, just remove it.
Moreover, regrtest now has multiple built-in generic timeout
mecanisms.
(cherry picked from commit 5fdcea7440)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-29 00:30:38 +00:00
Davide Rizzo d6e8001467
[3.11] gh-110038: KqueueSelector must count all read/write events (GH-110039) (#110044)
[3.11] gh-110038: KqueueSelector must count all read/write events (GH-110039).
(cherry picked from commit b14f0ab51c)
2023-09-28 20:58:24 +02:00
Miss Islington (bot) 973d549e72
[3.11] gh-110033: Fix signal test_interprocess_signal() (GH-110035) (#110041)
gh-110033: Fix signal test_interprocess_signal() (GH-110035)

Fix test_interprocess_signal() of test_signal. Make sure that the
subprocess.Popen object is deleted before the test raising an
exception in a signal handler. Otherwise, Popen.__del__() can get the
exception which is logged as "Exception ignored in: ...." and the
test fails.
(cherry picked from commit 7e0fbf5175)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-28 17:48:58 +00:00
Miss Islington (bot) ff3cadd2a1
[3.11] gh-109594: Fix concurrent.futures test_timeout() (GH-110018) (#110022)
gh-109594: Fix concurrent.futures test_timeout() (GH-110018)

Fix test_timeout() of test_concurrent_futures.test_wait. Remove the
future which may or may not complete depending if it takes longer
than the timeout ot not. Keep the second future which does not
complete before wait(). Make also the test faster: 0.5 second instead
of 6 seconds, so remove @support.requires_resource('walltime')
decorator.
(cherry picked from commit 9be283e5e1)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-28 13:49:56 +00:00
Miss Islington (bot) 448a7071b1
[3.11] gh-109615: Fix support test_copy_python_src_ignore() on WASM (GH-109970) (#109976)
gh-109615: Fix support test_copy_python_src_ignore() on WASM (GH-109970)

Not only check if src_dir exists, but look also for Lib/os.py
landmark.
(cherry picked from commit cc54bcf17b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-27 15:58:20 +00:00
Victor Stinner 8ac20e5404
[3.11] gh-109615: Fix support test_copy_python_src_ignore() (#109958) (#109962)
gh-109615: Fix support test_copy_python_src_ignore() (#109958)

Fix the test when run on an installed Python: use "abs_srcdir" of
sysconfig, and skip the test if the Python source code cannot be
found.

* Tools/patchcheck/patchcheck.py, Tools/freeze/test/freeze.py and
  Lib/test/libregrtest/utils.py now first try to get "abs_srcdir"
  from sysconfig, before getting "srcdir" from sysconfig.
* test.pythoninfo logs sysconfig "abs_srcdir".

(cherry picked from commit b89ed9df39)
2023-09-27 11:00:22 +00:00
Victor Stinner 2423168604
[3.11] gh-109615: Fix test_tools.test_freeze SRCDIR (#109935) (#109951)
gh-109615: Fix test_tools.test_freeze SRCDIR (#109935)

Fix copy_source_tree() function of test_tools.test_freeze:

* Don't copy SRC_DIR/build/ anymore. This directory is modified by
  other tests running in parallel.
* Add test.support.copy_python_src_ignore().
* Use sysconfig to get the source directory.
* Use sysconfig.get_config_var() to get CONFIG_ARGS variable.

(cherry picked from commit 1512d6c6ee)
2023-09-27 08:59:02 +00:00
Miss Islington (bot) 88917ddf44
[3.11] gh-107888: Fix test_mmap.test_access_parameter() on macOS 14 (GH-109928) (#109930)
gh-107888: Fix test_mmap.test_access_parameter() on macOS 14 (GH-109928)
(cherry picked from commit 9dbfe2dc8e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-26 22:51:34 +00:00
Miss Islington (bot) 4e66eca489
[3.11] gh-109845: Make test_ftplib more stable under load (GH-109912) (GH-109920)
recv() can return partial data cut in the middle of a multibyte
character. Test raw binary data instead of data incorrectly decoded by parts.
(cherry picked from commit 2ef2fffe3b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-26 20:23:20 +00:00
Miss Islington (bot) f764abb375
[3.11] gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629) (#109897)
gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629)

---------

(cherry picked from commit 0eb98837b6)

Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-09-26 12:21:52 +00:00
Miss Islington (bot) bda6949e86
[3.11] gh-109832: concurrent.futures test_deadlock restores sys.stderr (GH-109887) (#109893)
gh-109832: concurrent.futures test_deadlock restores sys.stderr (GH-109887)

test_error_at_task_unpickle() and
test_error_during_result_unpickle_in_result_handler() now restore
sys.stderr which is overriden by _raise_error_ignore_stderr().
(cherry picked from commit 2897142d2e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-26 11:08:27 +00:00
Miss Islington (bot) 95e616aee0
[3.11] gh-109401: Fix threading barrier test_default_timeout() (GH-109875) (#109877)
gh-109401: Fix threading barrier test_default_timeout() (GH-109875)

Increase timeouts. Barrier default timeout should be long enough to
spawn 4 threads on a slow CI.
(cherry picked from commit e5186c3de4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-26 00:34:00 +00:00
Miss Islington (bot) 358282e965
[3.11] gh-109748: Fix venv test_zippath_from_non_installed_posix() (GH-109872) (#109874)
gh-109748: Fix venv test_zippath_from_non_installed_posix() (GH-109872)

Fix test_zippath_from_non_installed_posix() of test_venv: don't copy
__pycache__/ sub-directories, because they can be modified by other
Python tests running in parallel.
(cherry picked from commit 25bb266fc8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-26 01:41:32 +02:00
Miss Islington (bot) 22a8efa740
[3.11] gh-89363: Skip threading test_is_alive_after_fork() if ASAN (GH-109835) (#109856)
gh-89363: Skip threading test_is_alive_after_fork() if ASAN (GH-109835)

Skip test_is_alive_after_fork() of test_threading if Python is built
with Address Sanitizer (ASAN).
(cherry picked from commit bc06743533)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-25 16:29:56 +00:00
Miss Islington (bot) 9238c6880e
[3.11] gh-109833: Fix asyncio test_wait_for() (GH-109834) (#109838)
gh-109833: Fix asyncio test_wait_for() (GH-109834)

Expect the test to be "short" but don't measure the exact performance
of the CI. SHORT_TIMEOUT is about 30 seconds whereas the cancelled
coroutine takes around 1 hour.
(cherry picked from commit f29bc9c9a0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-25 16:22:41 +02:00
elfstrom 97ea90194c
[3.11] gh-105829: Fix concurrent.futures.ProcessPoolExecutor deadlock (GH-108513) (#109783)
This fixes issue GH-105829, https://github.com/python/cpython/issues/105829

(cherry picked from commit 405b06375a)
2023-09-24 20:28:03 +01:00
Miss Islington (bot) 3db2ec26bc
[3.11] gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707) (#109763)
gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707)

Don't check order, queue items can be written in any order.
(cherry picked from commit b03a791497)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-22 22:09:46 +00:00
Nikita Sobolev 6bb18bb0b4
[3.11] gh-108303: Fix and move `badsyntax_pep3120.py` (GH-109513) (#109724)
* [3.11] gh-108303: Fix and move `badsyntax_pep3120.py` (GH-109513)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>.
(cherry picked from commit 4dd47c63a9)

Backport to 3.11: update also test_imp.

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-22 17:50:32 +02:00
Victor Stinner 1629b1d6f9
[3.11] gh-109709: Fix asyncio test_stdin_broken_pipe() (#109710) (#109735)
gh-109709: Fix asyncio test_stdin_broken_pipe() (#109710)

Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().

(cherry picked from commit cbbdf2c144)
2023-09-22 14:34:53 +00:00
Nikita Sobolev f45ef5edab
[3.11] gh-109625: Move _ready_to_import() from test_import to support.import_helper (GH-109626) (#109718)
[3.11] gh-109625: Move _ready_to_import() from test_import to support.import_helper (GH-109626).
(cherry picked from commit 115c49ad5a)
2023-09-22 12:34:46 +02:00
Miss Islington (bot) 74978ae6c6
[3.11] gh-109702: Increase concurrent_futures deadlock timeout (GH-109703) (#109708)
gh-109702: Increase concurrent_futures deadlock timeout (GH-109703)

Replace SHORT_TIMEOUT with LONG_TIMEOUT in test_deadlock of
test_concurrent_futures.
(cherry picked from commit 1eb1b45183)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-22 02:02:57 +00:00
Miss Islington (bot) 43ff8fcce2
[3.11] gh-109375: Fix bug where pdb registers an alias without an associated command (GH-109376) (#109430)
gh-109375: Fix bug where pdb registers an alias without an associated command (GH-109376)
(cherry picked from commit 68a6f21f47)

Co-authored-by: buermarc <44375277+buermarc@users.noreply.github.com>
2023-09-22 03:45:11 +02:00
Victor Stinner 66a973a09e
[3.11] gh-108388: Convert test_concurrent_futures to package (#108401) (#109704)
* gh-108388: Convert test_concurrent_futures to package (#108401)

Convert test_concurrent_futures to a package of sub-tests.

(cherry picked from commit aa6f787faa)

Notes on backport to 3.11:

* AsCompletedTests: Revert test_future_times_out() => test_zero_timeout()
* Restore TODO comment
* ThreadPoolExecutorTest.test_hang_global_shutdown_lock():
  add @support.requires_resource('cpu').
2023-09-22 01:37:25 +00:00
Victor Stinner 3a6d8e615f
[3.11] gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697) (#109699)
gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697)

On FreeBSD, regular users cannot set the sticky bit. Skip the test if
chmod() fails with EFTYPE error.

(cherry picked from commit 26e06ad617)
2023-09-21 23:29:49 +00:00
Miss Islington (bot) b3af888342
[3.11] gh-108388: Split test_multiprocessing_spawn (GH-108396) (#109688)
gh-108388: Split test_multiprocessing_spawn (GH-108396)

Split test_multiprocessing_fork, test_multiprocessing_forkserver and
test_multiprocessing_spawn into test packages. Each package is made
of 4 sub-tests: processes, threads, manager and misc. It allows
running more tests in parallel and so reduce the total test duration.
(cherry picked from commit aa9a359ca2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-21 20:44:21 +00:00
Victor Stinner 8d99502aac
[3.11] gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265) (#109678)
* gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265)

(cherry picked from commit 1110c5bc82)

* gh-108303: Add `Lib/test/tokenizedata` to `TESTSUBDIRS` (#109314)

(cherry picked from commit 42ab2cbd7b)

---------

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-21 21:46:05 +02:00
Victor Stinner 37b261799b
[3.11] gh-108303: Move `test_future` into its own test_future_stmt subdir (#109368) (#109680)
gh-108303: Move `test_future` into its own test_future_stmt subdir (#109368)

(cherry picked from commit 82505dc351)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-21 21:45:37 +02:00
Victor Stinner 84d8fdb266
[3.11] gh-109546: Add more tests for formatting floats (GH-109548) (#109685)
gh-109546: Add more tests for formatting floats (GH-109548)

(cherry picked from commit beb5ec5817)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-21 21:45:18 +02:00
Victor Stinner ca8da713d5
[3.11] gh-108303: Create Lib/test/test_dataclasses/ directory (#108978) (#109675)
gh-108303: Create Lib/test/test_dataclasses/ directory (#108978)

Move test_dataclasses.py and its "dataclass_*.py" modules into the
new Lib/test/test_dataclasses/ subdirectory.

Backport to 3.11: update Lib/test/.ruff.toml.

(cherry picked from commit 14d6e197cc)
2023-09-21 18:59:11 +00:00
Victor Stinner e59ee6c59e
[3.11] gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (#108354) (#109673)
gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (#108354)

(cherry picked from commit 3f61cf646d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-21 18:18:39 +00:00
Miss Islington (bot) 3ba4dfe9cd
[3.11] gh-108303: Remove unused Lib/test/sgml_input.html (GH-108305) (#109670)
gh-108303: Remove unused Lib/test/sgml_input.html (GH-108305)

In Python 2.7, the file was used by Lib/test/test_sgmllib.py to test
Lib/sgmllib.py. The sgmllib module and its tests have been removed in
Python 3.0.
(cherry picked from commit d2879f2095)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-21 18:07:14 +00:00
Alex Waygood a023de65fc
[3.11] Fix typos in docs and comments (#109619) (#109622)
Co-authored-by: Heinz-Alexander Fuetterer <35225576+afuetterer@users.noreply.github.com>
2023-09-20 17:50:48 +00:00
Victor Stinner 8c7fadb9bf
[3.11] gh-103053: Skip test_freeze_simple_script() on PGO build (#109591) (#109616)
gh-103053: Skip test_freeze_simple_script() on PGO build (#109591)

Skip test_freeze_simple_script() of test_tools.test_freeze if Python
is built with "./configure --enable-optimizations", which means with
Profile Guided Optimization (PGO): it just makes the test too slow.
The freeze tool is tested by many other CIs with other (faster)
compiler flags.

test.pythoninfo now gets also get_build_info() of
test.libregrtests.utils.

(cherry picked from commit 81cd1bd713)
2023-09-20 15:45:23 +00:00
Shantanu 2184b76496
[3.11] gh-108843: fix ast.unparse for f-string with many quotes (#108980)
* [3.11] gh-108843: fix ast.unparse for f-string with many quotes

* 📜🤖 Added by blurb_it.

* simplify

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-09-18 15:11:56 +01:00
Hugo van Kemenade a95d159bba
[3.11] gh-60283: Check for redefined test names in CI (#109161) (#109366)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
(cherry picked from commit 3cb9a8edca)
2023-09-15 05:45:23 +00:00
Victor Stinner 7a20797056
[3.11] gh-108822: Fix regrtest clear_caches() (#109432)
gh-108822: Fix regrtest clear_caches()

Python 3.11 doesn't have fractions._hash_algorithm cache.
2023-09-15 00:07:28 +00:00
Miss Islington (bot) f7bfac4b3d
[3.11] gh-109396: Fix test_socket.test_hmac_sha1() in FIPS mode (GH-109423) (#109427)
gh-109396: Fix test_socket.test_hmac_sha1() in FIPS mode (GH-109423)

Use a longer key: FIPS mode requires at least of at least 112 bits.
The previous key was only 32 bits.
(cherry picked from commit e091b9f20f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-15 00:52:40 +02:00
Miss Islington (bot) f1f85a42ea
[3.11] gh-109351: Fix crash when compiling AST with invalid NamedExpr (GH-109352) (#109380)
gh-109351: Fix crash when compiling AST with invalid NamedExpr (GH-109352)
(cherry picked from commit 79101edb03)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-09-13 16:32:08 +00:00
Miss Islington (bot) 66c0d0ac8c
[3.11] gh-104736: Fix test_gdb tests on ppc64le with clang (GH-109360) (#109362)
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 04:48:44 +00:00
Irit Katriel 1e8696133c
[3.11] gh-109179: Fix traceback display for SyntaxErrors with notes (#109197) (#109283)
gh-109179: Fix traceback display for SyntaxErrors with notes (#109197)

(cherry picked from commit ecd21a629a)
2023-09-12 09:57:28 +00:00
Miss Islington (bot) 5d47fb186e
[3.11] gh-109295: Fix test_os.test_access_denied() for TEMP=cwd (GH-109299) (#109303)
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 02:00:36 +00:00
Miss Islington (bot) abf3a68fe3
[3.11] gh-109295: Clean up multiprocessing in test_asyncio and test_compileall (GH-109298) (#109302)
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 01:53:59 +00:00
Miss Islington (bot) 9297a72dbd
[3.11] gh-90805: Make sure test_functools works with and without _functoolsmodule (GH-108644) (GH-109274)
(cherry picked from commit baa6dc8e38)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-11 16:35:41 +00:00
Miss Islington (bot) 74988a47e7
[3.11] Test DocTestFinder directly instead of calling support.run_doctest() (GH-108917) (GH-109260)
(cherry picked from commit 0abc935086)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-11 11:30:24 +00:00
Miss Islington (bot) a7e80fb628
[3.11] gh-109230: test_pyexpat no longer depends on the current directory (GH-109233) (#109242)
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-10 22:46:47 +00:00
Miss Islington (bot) cef4951116
[3.11] gh-109237: Fix test_site for non-ASCII working directory (GH-109238) (#109240)
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-10 22:39:49 +00:00
Miss Islington (bot) b070d73ff2
[3.11] gh-50644: Forbid pickling of codecs streams (GH-109180) (GH-109232)
Attempts to pickle or create a shallow or deep copy of codecs streams
now raise a TypeError.

Previously, copying failed with a RecursionError, while pickling
produced wrong results that eventually caused unpickling to fail with
a RecursionError.
(cherry picked from commit d6892c2b92)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-10 17:41:19 +00:00
Miss Islington (bot) c20658249d
[3.11] gh-109207: Fix SystemError when printing symtable entry object. (GH-109225) (GH-109228)
(cherry picked from commit 4297499696)

Co-authored-by: 云line <31395137+yunline@users.noreply.github.com>
2023-09-10 16:50:22 +03:00
Miss Islington (bot) 6b2f44ea78
[3.11] GH-109067: fix randomly failing `test_async_gen_asyncio_gc_aclose_09` test (GH-109142) (#109150)
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-08 17:02:57 +00:00
Miss Islington (bot) c1a2ef5efc
[3.11] gh-106922: Fix error location for constructs with spaces and parentheses (GH-108959) (#109148)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-09-08 16:56:10 +00:00
Miss Islington (bot) 9dd28d2da9
[3.11] gh-108962: Skip test_tempfile.test_flags() if not supported (GH-108964) (#108968)
gh-108962: Skip test_tempfile.test_flags() if not supported (GH-108964)

Skip test_tempfile.test_flags() if chflags() fails with "OSError:
[Errno 45] Operation not supported" (ex: on FreeBSD 13).
(cherry picked from commit cd2ef21b07)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-08 07:07:54 +00:00
Ethan Furman effa2ecdcf
[3.11] gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704) (GH-108739)
When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. .

    member = object.__new__(cls)
    member = int.__new__(cls, value)
    member = str.__new__(cls, value)

Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected.

(cherry picked from commit d48760b2f1)
2023-09-07 18:57:48 -07:00
Miss Islington (bot) e46be0d2fa
[3.11] gh-68403: Fix test_coverage in test_trace (GH-108910) (GH-109105)
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-07 19:10:19 +00:00
Miss Islington (bot) c2b8d4fe0d
[3.11] gh-75743: Restore test_timeout.testConnectTimeout() (GH-109087) (#109102)
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-07 18:55:50 +00:00
Serhiy Storchaka dae62d456e
[3.11] gh-88943: Improve syntax error for non-ASCII character that follows a numerical literal (GH-109081) (GH-109091)
It now points on the invalid non-ASCII character, not on the valid numerical literal.
(cherry picked from commit b2729e93e9)
2023-09-07 14:54:07 +00:00
Serhiy Storchaka 49cc2e7984
[3.11] gh-103186: Suppress RuntimeWarning about unclosed async iterator in test_sys_settrace (GH-109075) (GH-109086)
(cherry picked from commit d485551c9d)
2023-09-07 14:16:13 +00:00
Miss Islington (bot) 12f40a4340
[3.11] gh-103186: Remove debug print in test_sys_settrace (GH-109077) (GH-109085)
(cherry picked from commit e4bb0026b9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-07 14:13:42 +00:00
Miss Islington (bot) 883ff44f0d
[3.11] test.pythoninfo logs freedesktop_os_release() (GH-109057) (#109063)
test.pythoninfo logs freedesktop_os_release() (GH-109057)
(cherry picked from commit babdced23f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-09-07 06:13:34 +00:00
Victor Stinner 1ebe014d62
[3.11] gh-109015: Add test.support.socket_helper.tcp_blackhole() (#109016) (#109042)
gh-109015: Add test.support.socket_helper.tcp_blackhole() (#109016)

Skip test_asyncio, test_imaplib and test_socket tests if FreeBSD TCP
blackhole is enabled (net.inet.tcp.blackhole=2).

(cherry picked from commit a52a350977)
2023-09-07 00:34:16 +00:00
Victor Stinner 95eb9849dd
[3.11] gh-108851: Fix tomllib recursion tests (#108853) (#109013)
gh-108851: Fix tomllib recursion tests (#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().

Backport notes:

* Set support.infinite_recursion() minimum to 4 frames.
* test_support.test_get_recursion_depth() uses limit-2, apparently
  f-string counts for 2 frames in Python 3.11.
* test_sys.test_setrecursionlimit_to_depth() tests depth+2 instead of
  depth+1.

(cherry picked from commit 8ff1142578)
2023-09-06 16:40:39 +00:00
Miss Islington (bot) d61b8f9b8b
[3.11] gh-91960: Skip test_gdb if gdb cannot retrive Python frames (GH-108999) (#109011)
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-06 15:32:36 +00:00
Miss Islington (bot) b8340905fc
[3.11] gh-108983: Add more PEP 526 tests to `test_grammar` (GH-108984) (#109001)
gh-108983: Add more PEP 526 tests to `test_grammar` (GH-108984)
(cherry picked from commit 1fb20d42c5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-09-06 14:09:54 +00:00
Serhiy Storchaka cf19e8ea3a
[3.11] gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') (GH-108480) (GH-108924)
(cherry picked from commit 1e0d62793a)
2023-09-05 15:27:55 +00:00
Miss Islington (bot) 4e5fd6dc14
[3.11] gh-89392: Use unittest test runner for doctests in test_getopt (GH-108916) (GH-108920)
(cherry picked from commit f980cc19b9)

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

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-05 14:11:49 +00:00
Serhiy Storchaka 492e1ffdce
[3.11] gh-89392: Remove support of test_main() in libregrtest (GH-108876) (GH-108898)
(cherry picked from commit 04a0830b00)
2023-09-05 06:54:12 +00:00
Miss Islington (bot) 562c168856
[3.11] gh-89392: Fix running test_pep646_syntax as script (GH-108875) (GH-108877)
(cherry picked from commit f3b6608ba2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-05 06:41:15 +00:00
Serhiy Storchaka 3fd6ada2e6
[3.11] bpo-45229: Make ElementTree tests discoverable (GH-108859) (GH-108874)
(cherry picked from commit 074ac1f72e)
2023-09-04 10:43:12 +00:00
Miss Islington (bot) 723ca8c387
[3.11] gh-89392: Remove test_main() in test_netrc (GH-108860) (GH-108868)
(cherry picked from commit 76f3c043b6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-04 10:20:24 +00:00
Miss Islington (bot) 75df36e0d5
[3.11] gh-89392: Make test_pep646_syntax discoverable (GH-108861) (GH-108869)
(cherry picked from commit d0b22f6bd8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-04 13:11:33 +03:00
Victor Stinner 79f7a4c0a4
[3.11] gh-108822: Backport libregrtest changes from the main branch (#108820)
* Revert "[3.11] gh-101634: regrtest reports decoding error as failed test (#106169) (#106175)"

This reverts commit d5418e97fc.

* Revert "[3.11] bpo-46523: fix tests rerun when `setUp[Class|Module]` fails (GH-30895) (GH-103342)"

This reverts commit ecb09a8496.

* Revert "gh-95027: Fix regrtest stdout encoding on Windows (GH-98492)"

This reverts commit b2aa28eec5.

* Revert "[3.11] gh-94026: Buffer regrtest worker stdout in temporary file (GH-94253) (GH-94408)"

This reverts commit 0122ab235b.

* Revert "Run Tools/scripts/reindent.py (GH-94225)"

This reverts commit f0f3a424af.

* Revert "gh-94052: Don't re-run failed tests with --python option (GH-94054)"

This reverts commit 1347607db1.

* Revert "[3.11] gh-84461: Fix Emscripten umask and permission issues (GH-94002) (GH-94006)"

This reverts commit 1073184918.

* gh-93353: regrtest checks for leaked temporary files (#93776)

When running tests with -jN, create a temporary directory per process
and mark a test as "environment changed" if a test leaks a temporary
file or directory.

(cherry picked from commit e566ce5496)

* gh-93353: Fix regrtest for -jN with N >= 2 (GH-93813)

(cherry picked from commit 36934a16e8)

* gh-93353: regrtest supports checking tmp files with -j2 (#93909)

regrtest now also implements checking for leaked temporary files and
directories when using -jN for N >= 2. Use tempfile.mkdtemp() to
create the temporary directory. Skip this check on WASI.

(cherry picked from commit 4f85cec9e2)

* gh-84461: Fix Emscripten umask and permission issues (GH-94002)

- Emscripten's default umask is too strict, see
  https://github.com/emscripten-core/emscripten/issues/17269
- getuid/getgid and geteuid/getegid are stubs that always return 0
  (root). Disable effective uid/gid syscalls and fix tests that use
  chmod() current user.
- Cannot drop X bit from directory.

(cherry picked from commit 2702e408fd)

* gh-94052: Don't re-run failed tests with --python option (#94054)

(cherry picked from commit 0ff7b996f5)

* Run Tools/scripts/reindent.py (#94225)

Reindent files which were not properly formatted (PEP 8: 4 spaces).

Remove also some trailing spaces.

(cherry picked from commit e87ada48a9)

* gh-94026: Buffer regrtest worker stdout in temporary file (GH-94253)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 199ba23324)

* gh-96465: Clear fractions hash lru_cache under refleak testing (GH-96689)

Automerge-Triggered-By: GH:zware
(cherry picked from commit 9c8f379433)

* gh-95027: Fix regrtest stdout encoding on Windows (#98492)

On Windows, when the Python test suite is run with the -jN option,
the ANSI code page is now used as the encoding for the stdout
temporary file, rather than using UTF-8 which can lead to decoding
errors.

(cherry picked from commit ec1f6f5f13)

* gh-98903: Test suite fails with exit code 4 if no tests ran (#98904)

The Python test suite now fails wit exit code 4 if no tests ran. It
should help detecting typos in test names and test methods.

* Add "EXITCODE_" constants to Lib/test/libregrtest/main.py.
* Fix a typo: "NO TEST RUN" becomes "NO TESTS RAN"

(cherry picked from commit c76db37c0d)

* gh-100086: Add build info to test.libregrtest (#100093)

The Python test runner (libregrtest) now logs Python build information like
"debug" vs "release" build, or LTO and PGO optimizations.

(cherry picked from commit 3c89202247)

* bpo-46523: fix tests rerun when `setUp[Class|Module]` fails (#30895)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 995386071f)

* gh-82054: allow test runner to split test_asyncio to execute in parallel by sharding. (#103927)

This runs test_asyncio sub-tests in parallel using sharding from Cinder. This suite is typically the longest-pole in runs because it is a test package with a lot of further sub-tests otherwise run serially. By breaking out the sub-tests as independent modules we can run a lot more in parallel.

After porting we can see the direct impact on a multicore system.

Without this change:
  Running make test is 5 min 26 seconds
With this change:
  Running make test takes 3 min 39 seconds

That'll vary based on system and parallelism. On a `-j 4` run similar to what CI and buildbot systems often do, it reduced the overall test suite completion latency by 10%.

The drawbacks are that this implementation is hacky and due to the sorting of the tests it obscures when the asyncio tests occur and involves changing CPython test infrastructure but, the wall time saved it is worth it, especially in low-core count CI runs as it pulls a long tail. The win for productivity and reserved CI resource usage is significant.

Future tests that deserve to be refactored into split up suites to benefit from are test_concurrent_futures and the way the _test_multiprocessing suite gets run for all start methods. As exposed by passing the -o flag to python -m test to get a list of the 10 longest running tests.

---------

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google, LLC]
(cherry picked from commit 9e011e7c77)

* Display the sanitizer config in the regrtest header. (#105301)

Display the sanitizers present in libregrtest.

Having this in the CI output for tests with the relevant environment
variable displayed will help make it easier to do what we need to
create an equivalent local test run.

(cherry picked from commit 852348ab65)

* gh-101634: regrtest reports decoding error as failed test (#106169)

When running the Python test suite with -jN option, if a worker stdout
cannot be decoded from the locale encoding report a failed testn so the
exitcode is non-zero.

(cherry picked from commit 2ac3eec103)

* gh-108223: test.pythoninfo and libregrtest log Py_NOGIL (#108238)

Enable with --disable-gil --without-pydebug:

    $ make pythoninfo|grep NOGIL
    sysconfig[Py_NOGIL]: 1

    $ ./python -m test
    ...
    == Python build: nogil debug
    ...

(cherry picked from commit 5afe0c17ca)

* gh-90791: test.pythoninfo logs ASAN_OPTIONS env var (#108289)

* Cleanup libregrtest code logging ASAN_OPTIONS.
* Fix a typo on "ASAN_OPTIONS" vs "MSAN_OPTIONS".

(cherry picked from commit 3a1ac87f8f)

* gh-108388: regrtest splits test_asyncio package (#108393)

Currently, test_asyncio package is only splitted into sub-tests when
using command "./python -m test". With this change, it's also
splitted when passing it on the command line:
"./python -m test test_asyncio".

Remove the concept of "STDTESTS". Python is now mature enough to not
have to bother with that anymore. Removing STDTESTS simplify the
code.

(cherry picked from commit 174e9da083)

* regrtest computes statistics (#108793)

test_netrc, test_pep646_syntax and test_xml_etree now return results
in the test_main() function.

Changes:

* Rewrite TestResult as a dataclass with a new State class.
* Add test.support.TestStats class and Regrtest.stats_dict attribute.
* libregrtest.runtest functions now modify a TestResult instance
  in-place.
* libregrtest summary lists the number of run tests and skipped
  tests, and denied resources.
* Add TestResult.has_meaningful_duration() method.
* Compute TestResult duration in the upper function.
* Use time.perf_counter() instead of time.monotonic().
* Regrtest: rename 'resource_denieds' attribute to 'resource_denied'.
* Rename CHILD_ERROR to MULTIPROCESSING_ERROR.
* Use match/case syntadx to have different code depending on the
  test state.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit d4e534cbb3)

* gh-108822: Add Changelog entry for regrtest statistics (#108821)

---------

Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Zachary Ware <zach@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Joshua Herman <zitterbewegung@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-09-03 19:21:53 +02:00
Miss Islington (bot) ba47d87282
[3.11] Reorder some test's decorators (GH-108804) (GH-108845)
For example, do not demand the 'cpu' resource if the test cannot be run
due to non-working threads.
(cherry picked from commit 509bb61977)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-09-03 13:01:49 +00:00
Serhiy Storchaka 76f52196b9
[3.11] gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421) (GH-108799)
Only mark tests which spend significant system or user time,
by itself or in subprocesses.
(cherry picked from commit f3ba0a74cd)
2023-09-03 09:34:30 +03:00
Miss Islington (bot) fc114a72bc
[3.11] gh-103186: assert in tests that UnsafeMailcapInput warnings are provided (GH-103217) (GH-108800)
(cherry picked from commit 1724553e6e)

Co-authored-by: Ijtaba Hussain <ijtabahussain@live.com>
2023-09-02 05:53:48 +00:00
Miss Islington (bot) 385b1952f0
[3.11] gh-108520: Fix bad fork detection in nested multiprocessing use case (GH-108568) (#108692)
gh-107275 introduced a regression where a SemLock would fail being passed along nested child processes, as the `is_fork_ctx` attribute would be left missing after the first deserialization.

---------

(cherry picked from commit add8d45cbe)

Co-authored-by: albanD <desmaison.alban@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2023-08-30 22:36:26 +02:00
Erlend E. Aasland 6f24420cbf
[3.11] gh-108590: Revert gh-108657 (commit 400a1cebc) (#108686) (#108694)
(cherry picked from commit 2a3926fa51)

Reverted per Serhiy's request.
2023-08-30 20:12:10 +00:00
Corvin 5a6d1238bb
[3.11] gh-108590: Fix sqlite3.iterdump for invalid Unicode in TEXT columns (GH-108657) (#108674)
(cherry picked from commit 400a1cebc7)
2023-08-30 12:29:33 +02:00
Serhiy Storchaka 2e4c3efec1
[3.11] Revert "[3.11] Use non alternate name for Kyiv (GH-108533) (GH-108641)" (GH-108650)
This reverts commit 34f84f2b9f.

It broke tests on the Debian and macOS buildbots.
2023-08-29 23:09:20 +03:00
Miss Islington (bot) 34f84f2b9f
[3.11] Use non alternate name for Kyiv (GH-108533) (GH-108641)
tzdata provides Kiev as an alternative to Kyiv:

https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314GH-L314

But Debian moved it to the tzdata-legacy package breaking the test:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050530

This patch switches to the name provided by tzdata.
(cherry picked from commit 7659128b9d)

Co-authored-by: Jochen Sprickerhof <github@jochen.sprickerhof.de>
2023-08-29 15:47:54 +00:00
Miss Islington (bot) cc12c965af
[3.11] gh-108558: Improve sqlite3 row factory tests (GH-108578) (#108616)
Add test_sqlite_row_keys() to explicitly test sqlite3.Row.keys().

Cleanups:
- Reduce test noise by converting docstrings to regular comments
- Reduce boilerplate code by adding a setUp() method to RowFactoryTests

(cherry picked from commit 6eaddc10e9)

Co-authored-by: Edward Schauman-Haigh <142528725+EddInSverige@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-29 09:47:27 +00:00
Miss Islington (bot) ed749be3aa
[3.11] gh-105821: Use a raw f-string in test_httpservers.py (GH-105822) (#108576)
gh-105821: Use a raw f-string in test_httpservers.py (GH-105822)

Use a raw f-string in test_httpservers.py
(cherry picked from commit 09ce8c3b48)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2023-08-28 17:44:13 +00:00
Erlend E. Aasland 33eee4340e
[3.11] gh-64662: Fix virtual table support in sqlite3.Connection.iterdump (#108340) (#108564)
(cherry picked from commit d0160c7c22)

Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
2023-08-28 13:09:33 +00:00
Erlend E. Aasland 6f6171b33b
[3.11] gh-108550: Speed up sqlite3 tests (#108551) (#108567)
Disable the busy handler for all concurrency tests; we have full
control over the order of the SQLite C API calls, so we can safely
do this.

test_sqlite3.test_transactions now completes ~10 times faster than before.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-28 13:09:10 +00:00
Serhiy Storchaka 0c79fabb03
[3.11] gh-108418: Speed up bigmem compression tests in dry mode (GH-108419) (GH-108481)
Only generate and compress small amount of random data in dry run.
(cherry picked from commit 4ae3edf300)
2023-08-25 12:10:22 +00:00
Łukasz Langa d90f2f3a62
[3.11] gh-108342: Make ssl TestPreHandshakeClose more reliable (GH-108370) (#108405)
* In preauth tests of test_ssl, explicitly break reference cycles
  invoving SingleConnectionTestServerThread to make sure that the
  thread is deleted. Otherwise, the test marks the environment as
  altered because the threading module sees a "dangling thread"
  (SingleConnectionTestServerThread). This test leak was introduced
  by the test added for the fix of issue gh-108310.
* Use support.SHORT_TIMEOUT instead of hardcoded 1.0 or 2.0 seconds
  timeout.
* SingleConnectionTestServerThread.run() catchs TimeoutError
* Fix a race condition (missing synchronization) in
  test_preauth_data_to_tls_client(): the server now waits until the
  client connect() completed in call_after_accept().
* test_https_client_non_tls_response_ignored() calls server.join()
  explicitly.
* Replace "localhost" with server.listener.getsockname()[0].
(cherry picked from commit 592bacb6fc)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-08-24 12:08:52 +02:00
Miss Islington (bot) 34ef75d3ef
[3.11] gh-77377: Ensure multiprocessing SemLock is valid for spawn-based Process before serializing it (GH-107275) (#108378)
gh-77377: Ensure multiprocessing SemLock is valid for spawn-based Process before serializing it (GH-107275)

Ensure multiprocessing SemLock is valid for spawn Process before serializing it.

Creating a multiprocessing SemLock with a fork context, and then trying to pass it to a spawn-created Process, would segfault if not detected early.

---------

(cherry picked from commit 1700d34d31)

Co-authored-by: albanD <desmaison.alban@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2023-08-23 21:11:20 +00:00
Victor Stinner 1aff195903
[3.11] gh-105776: Fix test_cppext when CC contains -std=c11 option (#108343) (#108347)
gh-105776: Fix test_cppext when CC contains -std=c11 option (#108343)

Fix test_cppext when the C compiler command has the "-std=c11" option.
Remove "-std=" options from the compiler command.

(cherry picked from commit 9173b2bbe1)
2023-08-23 03:47:41 +00:00
Victor Stinner a15396146f
[3.11] gh-108303: Add Lib/test/test_cppext/ sub-directory (#108325) (#108336)
gh-108303: Add Lib/test/test_cppext/ sub-directory (#108325)

* Move test_cppext to its own directory
* Rename setup_testcppext.py to setup.py
* Rename _testcppext.cpp to extension.cpp
* The source (extension.cpp) is now also copied by the test.

(cherry picked from commit 21dda09600)
2023-08-23 05:11:53 +02:00
Łukasz Langa 75a875e0df
[3.11] gh-108310: Fix CVE-2023-40217: Check for & avoid the ssl pre-close flaw (#108317)
gh-108310: Fix CVE-2023-40217: Check for & avoid the ssl pre-close flaw

Instances of `ssl.SSLSocket` were vulnerable to a bypass of the TLS handshake
and included protections (like certificate verification) and treating sent
unencrypted data as if it were post-handshake TLS encrypted data.

The vulnerability is caused when a socket is connected, data is sent by the
malicious peer and stored in a buffer, and then the malicious peer closes the
socket within a small timing window before the other peers’ TLS handshake can
begin. After this sequence of events the closed socket will not immediately
attempt a TLS handshake due to not being connected but will also allow the
buffered data to be read as if a successful TLS handshake had occurred.

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2023-08-22 19:53:19 +02:00
Miss Islington (bot) 5be32d8818
[3.11] gh-106016: Add Lib/test/test_module/ directory (GH-108293) (#108304)
gh-106016: Add Lib/test/test_module/ directory (GH-108293)

* Move Python scripts related to test_module to this new directory:
  good_getattr.py and bad_getattrX.py scripts.
* Move Lib/test/test_module.py to Lib/test/test_module/__init__.py.
(cherry picked from commit adfc118fda)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-08-22 15:42:00 +00:00
Miss Islington (bot) 8927cf0200
[3.11] gh-106242: Make ntpath.realpath errors consistent with abspath when there are embedded nulls (GH-108248)
gh-106242: Make ntpath.realpath errors consistent with abspath when there are embedded nulls (GH-108248)

---------

(cherry picked from commit de33b5c662)

Co-authored-by: Steve Dower <steve.dower@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-08-22 15:35:16 +01:00
Hugo van Kemenade d678ee7719
[3.11] Trim trailing whitespace and test on CI (GH-104275) (#108215) 2023-08-22 12:57:31 +03:00
Miss Islington (bot) 8e837373ed
[3.11] gh-107845: Fix symlink handling for tarfile.data_filter (GH-107846) (GH-108209)
gh-107845: Fix symlink handling for tarfile.data_filter (GH-107846)

(cherry picked from commit acbd3f9c5c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Lumír 'Frenzy' Balhar <frenzy.madness@gmail.com>
2023-08-22 10:51:58 +02:00
Miss Islington (bot) 75617ac3f0
[3.11] gh-107396: tarfiles: set self.exception before _init_read_gz() (GH-107485) (GH-108208)
gh-107396: tarfiles: set self.exception before _init_read_gz() (GH-107485)

In the stack call of: _init_read_gz()
```
_read, tarfile.py:548
read, tarfile.py:526
_init_read_gz, tarfile.py:491
```
a try;except exists that uses `self.exception`, so it needs to be set before
calling _init_read_gz().
(cherry picked from commit 37135d25e2)

Co-authored-by: balmeida-nokia <83089745+balmeida-nokia@users.noreply.github.com>
2023-08-21 17:16:59 +02:00
Miss Islington (bot) a1d2e2c2ac
[3.11] gh-105736: Sync pure python version of OrderedDict with the C version (GH-108098) (GH-108201)
(cherry picked from commit 20cc90c0df)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2023-08-21 10:37:09 +00:00
Miss Islington (bot) d4c66bd732
[3.11] gh-107895: Fix test_asyncio.test_runners when run it in CPython's "development mode" (GH-108168) (GH-108197)
(cherry picked from commit 014a5b71e7)

Co-authored-by: Joon Hwan 김준환 <xncbf12@gmail.com>
2023-08-21 08:36:37 +00:00
Miss Islington (bot) c1c3f0bfec
[3.11] bpo-18319: gettext() can retrieve a message even if a plural form exists (GH-19869) (GH-107107)
(cherry picked from commit 54632528ee)

Co-authored-by: Gilles Bassière <gbassiere@gmail.com>
2023-08-16 09:15:01 +00:00
Serhiy Storchaka 26137e2cf7
[3.11] gh-100061: Proper fix of the bug in the matching of possessive quantifiers (GH-102612) (GH-108004)
Restore the global Input Stream pointer after trying to match a sub-pattern.

Co-authored-by: Ma Lin <animalize@users.noreply.github.com>

(cherry picked from commit abd9cc52d9)
    
Co-authored-by: SKO <41810398+uyw4687@users.noreply.github.com>
2023-08-16 08:36:36 +00:00
Serhiy Storchaka 4cfbcffd3d
[3.11] gh-99203: shutil.make_archive(): restore select CPython <= 3.10.5 behavior (GH-99802) (GH-107999)
Restore following CPython <= 3.10.5 behavior of shutil.make_archive()
that went away as part of gh-93160:

Do not create an empty archive if root_dir is not a directory, and, in
that case, raise FileNotFoundError or NotADirectoryError regardless
of format choice. Beyond the brought-back behavior, the function may
now also raise these exceptions in dry_run mode.
(cherry picked from commit a86df298df)

Co-authored-by: 6t8k <58048945+6t8k@users.noreply.github.com>
2023-08-16 07:44:21 +00:00
Steve Dower ccf81e1088
[3.11] gh-106242: Fix path truncation in os.path.normpath (GH-106816) (#107982)
Co-authored-by: Finn Womack <flan313@gmail.com>
2023-08-15 19:07:52 +02:00
Miss Islington (bot) db4400b5b2
[3.11] gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965) (gh-107976)
gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965)
(cherry picked from commit 6515ec3d3d)


gh-107963: Fix set_forkserver_preload to check the type of given list

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2023-08-15 23:53:25 +09:00
Serhiy Storchaka ec254c5dfa
[3.11] gh-106844: Fix issues in _winapi.LCMapStringEx (GH-107832) (GH-107875)
* Strings with length from 2**31-1 to 2**32-2 always caused MemoryError,
   it doesn't matter how much memory is available.
* Strings with length exactly 2**32-1 caused OSError.
* Strings longer than 2**32-1 characters were truncated due to integer overflow bug.

Now strings longer than 2**31-1 characters caused OverflowError.
(cherry picked from commit 04cc01453d)
2023-08-12 14:06:56 +03:00
Serhiy Storchaka 5b76eaf02e
[3.11] gh-106052: Fix bug in the matching of possessive quantifiers (GH-106515) (GH-107795)
It did not work in the case of a subpattern containing backtracking.

Temporary implement possessive quantifiers as equivalent greedy qualifiers
in atomic groups.
(cherry picked from commit 7b6e34e5ba)
2023-08-09 06:15:27 +00:00
Serhiy Storchaka 22b39d13ec
[3.11] gh-107735: Add C API tests for PySys_GetObject() and PySys_SetObject() (GH-107736) (GH-107741)
(cherry picked from commit bea5f93196)
2023-08-07 20:51:00 +00:00
Serhiy Storchaka 81c8f7d619
[3.11] gh-104496: Use correct Tcl or Tk version in Tkinter tests (GH-107688) (GH-107719)
In future Tcl and Tk versions can be desynchronized.
(cherry picked from commit 3c8e8f3cee)
2023-08-07 14:48:43 +00:00
Charlie Zhao a15d06c230
[3.11] gh-106263: Fix segfault in `signaldict_repr` in `_decimal` module (#… (#107490)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
(cherry picked from commit 3979150a0d)
2023-07-31 15:52:23 +02:00
Miss Islington (bot) 81d0c7ca5a
[3.11] gh-106368: Add test for Argument Clinic misbehaving custom converter_init() (GH-107496) (#107500)
(cherry picked from commit 2c5d206b33)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-31 12:32:18 +00:00
Łukasz Langa 3abcdc71b6
[3.11] gh-104280: Add test cases for DTrace probes (GH-107125) (#107492)
(cherry picked from commit a1c737b73d)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2023-07-31 11:40:20 +02:00
Miss Islington (bot) 51b302e3f3
[3.11] gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (GH-107364) (#107366)
gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (GH-107364)
(cherry picked from commit 76c26eaca4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-28 00:36:34 +00:00
Erlend E. Aasland 9edeeb2014
[3.11] gh-106368: Increase Argument Clinic CLI test coverage (#107277) (#107326)
(cherry picked from commit 579100f6d7)
2023-07-26 23:02:24 +00:00
Miss Islington (bot) cebe60bb1a
[3.11] gh-106368: Increase Argument Clinic CLI test coverage (GH-107156) (#107190)
Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.

(cherry picked from commit 83a2837b32)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-07-26 22:24:09 +00:00
Miss Islington (bot) 41756e3960
[3.11] gh-62519: Make pgettext search plurals when translation is not found (GH-107118) (GH-107133)
(cherry picked from commit b3c34e55c0)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-07-25 21:49:28 +03:00