Commit graph

30238 commits

Author SHA1 Message Date
Miss Islington (bot)
e11ea5a400
[3.12] gh-108303: Move config parser data to Lib/test/configparserdata/ (gh-111879) (gh-111882)
gh-108303: Move config parser data to `Lib/test/configparserdata/` (gh-111879)
(cherry picked from commit cc18b886a5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-11-09 15:41:44 +01:00
Miss Islington (bot)
4f976c3b9a
[3.12] gh-110543: Fix CodeType.replace in presence of comprehensions (GH-110586) (#111866)
gh-110543: Fix CodeType.replace in presence of comprehensions (GH-110586)
(cherry picked from commit 0b718e6407)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-11-08 20:48:18 +00:00
Miss Islington (bot)
759168a2a9
[3.12] gh-111495: Add tests for PyList C API (GH-111562) (GH-111861)
(cherry picked from commit a3903c8ec8)

Signed-off-by: kalyanr <kalyan.ben10@live.com>
Co-authored-by: Kalyan <kalyan.ben10@live.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-11-08 18:10:13 +00:00
Nikita Sobolev
992c3f6b51
[3.12] gh-108303: Move more typing related files to Lib/test/typinganndata (GH-111825) (#111859)
[3.12] gh-108303: Move more typing related files to Lib/test/typinganndata(GH-111825)
2023-11-08 16:56:24 +00:00
Miss Islington (bot)
d35c94566a
[3.12] gh-111806: Fix test_recursion in test_richcmp on WASI builds (GH-111830) (GH-111831)
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:29 +00:00
Miss Islington (bot)
f70ae99cb4
[3.12] gh-111765: Move old PyFloat_* tests to Lib/test/test_capi/test_float.py (GH-111766) (GH-111818)
(cherry picked from commit a077b2fbb8)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-11-07 12:06:21 +00:00
Miss Islington (bot)
c4e524c3f2
[3.12] gh-101180: Fix a bug where iso2022_jp_3 and iso2022_jp_2004 codecs read out of bounds (gh-111695) (gh-111769)
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:31:58 +00:00
Miss Islington (bot)
e0c2bf4672
[3.12] gh-111495: Add tests for PyComplex C API (GH-111591) (GH-111753)
(cherry picked from commit 24b5cbd3dc)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-11-05 08:12:57 +00:00
Miss Islington (bot)
fef32a1d08
[3.12] gh-111495: Add tests for PyFloat C API (GH-111624) (GH-111752)
(cherry picked from commit b452202a11)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-11-05 10:01:31 +02:00
Serhiy Storchaka
cd778b4917
[3.12] gh-111495: Test C API functions with extreme sizes and indices (GH-111631) (GH-111731)
(cherry picked from commit a8e1f474c2)
2023-11-04 12:28:34 +02:00
Miss Islington (bot)
3b839ccfdf
[3.12] gh-111159: Fix SyntaxError doctests for non-builtin exception classes (GH-111541) (#111732)
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:21:06 +00:00
Miss Islington (bot)
d15fac2a67
[3.12] gh-111644: Fix asyncio test_unhandled_exceptions() (GH-111713) (#111718)
gh-111644: Fix asyncio test_unhandled_exceptions() (GH-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: Victor Stinner <vstinner@python.org>
2023-11-04 06:29:20 +00:00
Miss Islington (bot)
02f8f781da
[3.12] gh-111644: Fix support threading_cleanup() (GH-111714) (#111716)
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:56:34 +00:00
Jelle Zijlstra
1a95ad68b4
[3.12] gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF (GH-111655) (#111674)
(cherry picked from commit 3a1b09e6d0)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2023-11-03 07:02:07 -07:00
Miss Islington (bot)
fcf91cd35f
[3.12] gh-111625: Fix link to Info-ZIP homepage (GH-111626) (#111639)
Co-authored-by: partev <petrosyan@gmail.com>
2023-11-02 12:04:27 +00:00
Kumar Aditya
9aa88290d8
[3.12] GH-110894: Call loop exception handler for exceptions in client_connected_cb (GH-111601) (#111632)
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)
2023-11-02 08:18:49 +00:00
Miss Islington (bot)
f1087855e2
[3.12] gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496) (GH-111607)
(cherry picked from commit 97b3cd38d1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-11-01 18:23:39 +00:00
Miss Islington (bot)
2162512d71
[3.12] gh-110367: Make regrtest --verbose3 compatible with --huntrleaks -jN (GH-111577) (#111589)
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:51:24 +00:00
Miss Islington (bot)
ec00397912
[3.12] gh-111181: Fix enum doctests (GH-111180) (GH-111518)
gh-111181: Fix enum doctests (GH-111180)
(cherry picked from commit c4dc5a6ae8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-10-31 15:01:28 -07:00
Pablo Galindo Salgado
ca36426b1c
[3.12] gh-111366: Correctly show custom syntax error messages in the codeop module functions (GH-111384). (#111517) 2023-10-30 19:53:01 +00:00
Miss Islington (bot)
7ac2c53333
[3.12] gh-111284: Make multiprocessing tests with threads faster and more reliable (GH-111285) (GH-111510)
(cherry picked from commit 624ace5a2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-30 18:00:57 +00:00
Miss Islington (bot)
748bc48648
[3.12] gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-111455) (GH-111507)
Also document the behavior when called with NULL.
(cherry picked from commit bca3305429)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-30 17:36:00 +00:00
Miss Islington (bot)
0681b4c82c
[3.12] gh-111347: Remove wrong assertion in test_sendfile (GH-111377) (#111461)
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-29 10:29:29 -07:00
Miss Islington (bot)
f7ce40213d
[3.12] gh-111426: Remove test_cmd.test_coverage (GH-111427) (#111432)
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:40:02 +00:00
Miss Islington (bot)
2e5d4e24eb
[3.12] gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-111336) (#111424)
gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-111336)

* Try to fix asyncio.Server.wait_closed() again

I identified the condition that `wait_closed()` is intended
to wait for: the server is closed *and* there are no more
active connections.

When this condition first becomes true, `_wakeup()` is called
(either from `close()` or from `_detach()`) and it sets `_waiters`
to `None`. So we just check for `self._waiters is None`; if it's
not `None`, we know we have to wait, and do so.

A problem was that the new test introduced in 3.12 explicitly
tested that `wait_closed()` returns immediately when the server
is *not* closed but there are currently no active connections.
This was a mistake (probably a misunderstanding of the intended
semantics). I've fixed the test, and added a separate test that
checks exactly for this scenario.

I also fixed an oddity where in `_wakeup()` the result of the
waiter was set to the waiter itself. This result is not used
anywhere and I changed this to `None`, to avoid a GC cycle.

* Update Lib/asyncio/base_events.py

---------

(cherry picked from commit 2655369559)

Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2023-10-28 18:42:53 +00:00
Miss Islington (bot)
c3f75b757f
[3.12] gh-111342: fix typo in math.sumprod (GH-111416) (gh-111419) 2023-10-28 05:27:33 +00:00
Miss Islington (bot)
2398036eea
[3.12] gh-110205: Fix asyncio ThreadedChildWatcher._join_threads() (GH-110884) (#111412)
- `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:05 -07:00
Miss Islington (bot)
307ca78d7f
[3.12] gh-111380: Show SyntaxWarnings only once when parsing if invalid syntax is encouintered (GH-111381) (#111382)
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-27 04:02:17 +00:00
Miss Islington (bot)
a70b2cd2d2
[3.12] GH-94438: Fix RuntimeWarning for jump tests in test_sys_settrace (GH-111369)
(cherry picked from commit a254120f2f)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-10-26 22:44:47 +00:00
Pablo Galindo Salgado
c81ebf5b3d
[3.12] bpo-43950: handle wide unicode characters in tracebacks (GH-28150) (#111346) 2023-10-27 06:43:38 +09:00
Miss Islington (bot)
78c6faee08
[3.12] gh-111348: Fix direct invocation of test_doctest; remove test_doctest.test_coverage (GH-111349) (#111359)
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:10:58 +00:00
Miss Islington (bot)
3641dae42f
[3.12] gh-111165: Add missed "support." prefix for "verbose" (GH-111327) (GH-111328)
(cherry picked from commit a4981921aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-25 15:28:07 +00:00
Serhiy Storchaka
5c4f9a1c7e
[3.12] gh-111165: Move test running code from test.support to libregrtest (GH-111166) (GH-111316)
Remove no longer used functions run_unittest() and run_doctest() from
the test.support module.
(cherry picked from commit f6a45a03d0)
2023-10-25 14:56:27 +03:00
Miss Islington (bot)
45c0b38880
[3.12] gh-111174: Fix crash in getbuffer() called repeatedly for empty BytesIO (GH-111210) (GH-111314)
(cherry picked from commit 9da98c0d9a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-25 11:25:31 +00:00
Serhiy Storchaka
54e93d36d0
[3.12] gh-111065: Add more tests for the C API with the PySys_ prefix (GH-111067) (GH-111305)
* Move existing tests for PySys_GetObject() and PySys_SetObject() into
  specialized files.
* Add test for PySys_GetXOptions() using _testcapi.
* Add tests for PySys_FormatStdout(), PySys_FormatStderr(),
  PySys_WriteStdout() and PySys_WriteStderr() using ctypes.

(cherry picked from commit b2ba298527)
2023-10-25 09:10:03 +00:00
Miss Islington (bot)
6f130f231b
[3.12] gh-102956: Fix returning of empty byte strings after seek in zipfile … (GH-103565) (#111289)
gh-102956: Fix returning of empty byte strings after seek in zipfile … (GH-103565)
(cherry picked from commit c73b0f3560)


gh-102956: Fix returning of empty byte strings after seek in zipfile module. This was a regression in 3.12.0 due to a performance enhancement.

Co-authored-by: Jokimax <77680901+Jokimax@users.noreply.github.com>
2023-10-24 17:32:08 -07:00
Miss Islington (bot)
b6e508cc86
[3.12] gh-109017: Use non alternate name for Kyiv (GH-109251) (GH-111280)
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 17:44:46 +00:00
Miss Islington (bot)
df531912a7
[3.12] gh-75666: Tkinter: add tests for binding (GH-111202) (GH-111255)
(cherry picked from commit 9bb202a1a9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-24 14:53:21 +03:00
Miss Islington (bot)
0bbdfe611a
[3.12] GH-94438: Restore ability to jump over None tests (GH-111243)
(cherry picked from commit 6640f1d8d2)
Co-authored-by: Savannah Ostrowski <sostrowski@microsoft.com>
2023-10-24 06:39:26 +00:00
Furkan Onder
d4d947dd71
[3.12] gh-67565: Add tests for C-contiguity checks (GH-110951) (GH-111198)
(cherry picked from commit 9376728ce4)
2023-10-23 12:50:07 +03:00
Miss Islington (bot)
9e73c71aa9
[3.12] gh-110196: Fix ipaddress.IPv6Address.__reduce__ (GH-110198) (GH-111191)
(cherry picked from commit 767f416feb)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2023-10-22 19:14:50 +00:00
Miss Islington (bot)
028f47754c
[3.12] gh-111085: Fix invalid state handling in TaskGroup and Timeout (GH-111111) (GH-111171)
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:48:53 +00:00
Miss Islington (bot)
322f79f5a2
[3.12] Synchronize test_contextlib with test_contextlib_async (GH-111000) (GH-111114)
(cherry picked from commit ff4e53cb74)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-21 22:46:41 +03:00
Miss Islington (bot)
f6cde99bdb
[3.12] gh-111159: Fix doctest output comparison for exceptions with notes (GH-111160) (#111169)
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:39:34 +00:00
Serhiy Storchaka
1ea93024d4
[3.12] gh-110918: regrtest: allow to intermix --match and --ignore options (GH-110919) (GH-111167)
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:33:26 +00:00
Miss Islington (bot)
0409057c86
[3.12] gh-110932: Fix regrtest for SOURCE_DATE_EPOCH (GH-111143) (#111154)
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:18:35 +00:00
Miss Islington (bot)
4a1026077a
[3.12] gh-111126: Use isinstance instead of assert[Not]IsInstance in test_typing (GH-111127) (#111130)
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:27:35 +00:00
Miss Islington (bot)
6b38ddba97
[3.12] Add tests for failing PyUnicode_AsUTF8AndSize() with psize=NULL (GH-111100) (GH-111105)
(cherry picked from commit b60f058708)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-20 10:22:09 +00:00
Radislav Chugunov
68a5640a36
[3.12] gh-108791: Fix pdb CLI invalid argument handling (GH-108816) (#111064)
* [3.12] 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:25:49 +01:00
Miss Islington (bot)
40db34c901
[3.12] gh-111031: Check more files in test_tokenize (GH-111032) (#111061)
gh-111031: Check more files in `test_tokenize` (GH-111032)
(cherry picked from commit e9b5399bee)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-19 09:18:22 +00:00