summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] Restore decimal context after decimal doctests (GH-120149) (GH-120168)Miss Islington (bot)2024-06-061-3/+7
| | | | | | The modified context caused tests failures in several other tests. (cherry picked from commit 2d7ff6e0e7d4c08ba84079a5c19a4a485626e1de) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-119819: Update logging configuration to support joinable ↵Miss Islington (bot)2024-06-051-2/+6
| | | | | multiproc… (GH-120090) (GH-120092) (cherry picked from commit 983efcf15b2503fe0c05d5e03762385967962b33)
* [3.12] gh-119311: Fix name mangling with PEP 695 generic classes (#119464) ↵Jelle Zijlstra2024-06-041-0/+94
| | | | | | | | | | (#119644) * [3.12] gh-119311: Fix name mangling with PEP 695 generic classes (#119464) Fixes #119311. Fixes #119395. (cherry picked from commit a9a74da4a0ca0645f049e67b6434a95e30592c32)
* [3.12] gh-119819: Update test to skip if _multiprocessing is unavailable. ↵Miss Islington (bot)2024-06-041-1/+1
| | | | | (GH-120067) (GH-120071) (cherry picked from commit 109e1082ea92f89d42cd70f2cc7ca6fba6be9bab)
* [3.12] gh-120048: Make `test_imaplib` faster (GH-120050) (#120070)Miss Islington (bot)2024-06-041-14/+8
| | | | | | | | | | | | | | The `test_imaplib` was taking 40+ minutes in the refleak build bots because the tests waiting on a client `self._setup()` was creating a client that prevented progress until its connection timed out, which scaled with the global timeout. We should set `connect=False` for the tests that don't want `_setup()` to create a client. (cherry picked from commit 710cbea6604d27c7d59ae4953bf522b997a82cc7) Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-120039: Reduce expected timeout in test_siginterrupt_off ↵Miss Islington (bot)2024-06-041-3/+3
| | | | | | | | | | (GH-120047) (#120061) The process is expected to time out. In the refleak builds, `support.SHORT_TIMEOUT` is often five minutes and we run the tests six times, so test_signal was taking >30 minutes. (cherry picked from commit d419d468ff4aaf6bc673354d0ee41b273d09dd3f) Co-authored-by: Sam Gross <colesbury@gmail.com>
* [3.12] gh-89928: Fix integer conversion of device numbers (GH-31794) (GH-120054)Serhiy Storchaka2024-06-041-2/+13
| | | | | | Fix os.major(), os.minor() and os.makedev(). Support device numbers larger than 2**63-1. Support non-existent device number (NODEV). (cherry picked from commit 7111d9605f9db7aa0b095bb8ece7ccc0b8115c3f)
* [3.12] gh-119819: Fix regression to allow logging configuration with ↵Miss Islington (bot)2024-06-041-0/+26
| | | | | multipr… (GH-120030) (GH-120034) (cherry picked from commit 99d945c0c006e3246ac00338e37c443c6e08fc5c)
* [3.12] gh-118868: logging QueueHandler fix passing of kwargs (GH-118869) ↵Miss Islington (bot)2024-06-041-0/+29
| | | | | (GH-120031) (cherry picked from commit dce14bb2dce7887df40ae5c13b0d13e0dafceff7)
* [3.12] gh-119070: Update test_shebang_executable_extension to always use ↵Miss Islington (bot)2024-06-041-3/+3
| | | | | | | non-installed version (GH-119846) (GH-120016) gh-119070: Update test_shebang_executable_extension to always use non-installed version (GH-119846) (cherry picked from commit 5c48eb0cc6c3e84aafda0a734a05ecec14fc0ccf)
* [3.12] GH-89727: Fix `shutil.rmtree()` recursion error on deep trees ↵Barney Gale2024-06-011-1/+0
| | | | | | | | | (GH-119808) (#119919) Implement `shutil._rmtree_safe_fd()` using a list as a stack to avoid emitting recursion errors on deeply nested trees. `shutil._rmtree_unsafe()` was fixed in a150679f90. (cherry picked from commit 53b1981fb0cda6c656069e992f172fc6aad7c99c)
* [3.12] gh-113892: Add a extra check to `ProactorEventLoop.sock_connect` to ↵Miss Islington (bot)2024-06-011-2/+7
| | | | | | | ensure that the given socket is in non-blocking mode (GH-119519) (#119913) (cherry picked from commit cf3bba3f0671d2c9fee099e3ab0f78b98b176131) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* [3.12] gh-119821: Support non-dict globals in LOAD_FROM_DICT_OR_GLOBALS ↵Jelle Zijlstra2024-06-011-0/+20
| | | | | | | | | | | (#119822) (#119890) The implementation basically copies LOAD_GLOBAL. Possibly it could be deduplicated, but that seems like it may get hairy since the two operations have different operands. This is important to fix in 3.14 for PEP 649, but it's a bug in earlier versions too, and we should backport to 3.13 and 3.12 if possible. (cherry picked from commit 80a4e3899420faaa012c82b4e82cdb6675a6a944)
* [3.12] gh-119585: Fix crash involving `PyGILState_Release()` and ↵Sam Gross2024-05-311-0/+16
| | | | | | | | | | | `PyThreadState_Clear()` (GH-119753) (#119861) Make sure that `gilstate_counter` is not zero in when calling `PyThreadState_Clear()`. A destructor called from `PyThreadState_Clear()` may call back into `PyGILState_Ensure()` and `PyGILState_Release()`. If `gilstate_counter` is zero, it will try to create a new thread state before the current active thread state is destroyed, leading to an assertion failure or crash. (cherry picked from commit bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c)
* [3.12] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) (GH-119807)Miss Islington (bot)2024-05-302-9/+22
| | | | | | (cherry picked from commit 9732ed5ca94cd8fe9ca2fc7ba5a42dfa2b7791ea) Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-109218: Refactor tests for the complex() constructor (GH-119635) ↵Miss Islington (bot)2024-05-301-167/+195
| | | | | | | | | | | | | | (GH-119796) * Share common classes. * Use exactly representable floats and exact tests. * Check the sign of zero components. * Remove duplicated tests (mostly left after merging int and long). * Reorder tests in more consistent way. * Test more error messages. * Add tests for missed cases. (cherry picked from commit bf098d4157158e1e4b2ea78aba4ac82d72e24cff) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-119690: Adds Unicode support for named pipes in _winapi (GH-119717)Steve Dower2024-05-303-9/+66
| | | Also backports a minor improvement to test_audit.
* [3.12] GH-89727: Fix FD leak on `os.fwalk()` generator finalization. ↵Miss Islington (bot)2024-05-301-0/+21
| | | | | | | | | | | (GH-119766) (#119768) GH-89727: Fix FD leak on `os.fwalk()` generator finalization. (GH-119766) Follow-up to 3c890b50. Ensure we `os.close()` open file descriptors when the `os.fwalk()` generator is finalized. (cherry picked from commit a5fef800d31648d19cecc240a2fa0dc71371753e) Co-authored-by: Barney Gale <barney.gale@gmail.com>
* [3.12] GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638) ↵Miss Islington (bot)2024-05-301-2/+0
| | | | | | | | | | | (#119765) GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638) Implement `os.fwalk()` using a list as a stack to avoid emitting recursion errors on deeply nested trees. (cherry picked from commit 3c890b503c740767d0eb9a0e74b47f17a1e69452) Co-authored-by: Barney Gale <barney.gale@gmail.com>
* [3.12] gh-119260: Clarify is_dataclass Behavior for Subclasses in ↵Miss Islington (bot)2024-05-301-0/+18
| | | | | | | | | Documentation and Tests (GH-119480) (#119761) gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480) (cherry picked from commit bf4ff3ad2e362801e87c85fffd9e140b774cef26) Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com> Co-authored-by: Carl Meyer <carl@oddbird.net>
* [3.12] GH-89727: Partially fix `shutil.rmtree()` recursion error on deep ↵Barney Gale2024-05-291-0/+11
| | | | | | | | | | | | | | trees (GH-119634) (#119749) * GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (#119634) Make `shutil._rmtree_unsafe()` call `os.walk()`, which is implemented without recursion. `shutil._rmtree_safe_fd()` is not affected and can still raise a recursion error. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit a150679f90c6e3f017bd75cac3b8f727063cc4aa)
* gh-119070: Avoid test crash due to Unicode in stderr output (GH-119747)Steve Dower2024-05-291-1/+1
|
* gh-119070: Fix py.exe handling of /usr/bin/env commands missing extension ↵Steve Dower2024-05-291-0/+8
| | | | (GH-119426)
* [3.12] gh-119011: `type.__type_params__` now return an empty tuple ↵Jelle Zijlstra2024-05-282-0/+13
| | | | | | | (GH-119296) (#119681) (cherry picked from commit 6b240c2308a044e38623900ccb8fa58c3549d4ae) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-119581: Add a test of InitVar with name shadowing (GH-119582) ↵Miss Islington (bot)2024-05-281-0/+23
| | | | | | | | (#119673) gh-119581: Add a test of InitVar with name shadowing (GH-119582) (cherry picked from commit 6ec371223dff4da7719039e271f35a16a5b861c6) Co-authored-by: Steven Troxler <steven.troxler@gmail.com>
* [3.12] Re-order imports to align with zipp 3.18.2 (GH-119587) (#119590)Miss Islington (bot)2024-05-282-3/+3
| | | | | | Re-order imports to align with zipp 3.18.2 (GH-119587) (cherry picked from commit 5482a939ac18f4cd861d212c759960af8fa2b19d) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* gh-118263: Add additional arguments to path_t (Argument Clinic type) in ↵Nice Zombies2024-05-282-1/+12
| | | | posixmodule (GH-119608)
* [3.12] gh-116860: Remove outdated `test_parserhack` from `test_future` ↵Miss Islington (bot)2024-05-281-20/+0
| | | | | | | | (GH-116861) (#119648) gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861) (cherry picked from commit 669175bf8edc2c02d48401bac0e4c7d99a33f15b) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] [3.13] gh-119461: Fix ThreadedVSOCKSocketStreamTest (GH-119465) ↵Miss Islington (bot)2024-05-231-4/+6
| | | | | | | | | | | | | | | | | | | | | (GH-119479) (#119484) [3.13] gh-119461: Fix ThreadedVSOCKSocketStreamTest (GH-119465) (GH-119479) gh-119461: Fix ThreadedVSOCKSocketStreamTest (GH-119465) Fix ThreadedVSOCKSocketStreamTest: if get_cid() returns the host address or the "any" address, use the local communication address (loopback): VMADDR_CID_LOCAL. On Linux 6.9, apparently, the /dev/vsock device is now available but get_cid() returns VMADDR_CID_ANY (-1). (cherry picked from commit c750061047ee520d8299334df4b112fd983d7e48) Co-authored-by: Victor Stinner <vstinner@python.org> (cherry picked from commit e94dbe4ed83460f18bd72563c5f09f6cdc71f604) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-119213: Be More Careful About _PyArg_Parser.kwtuple Across ↵Eric Snow2024-05-221-0/+33
| | | | | | | | | | | Interpreters (gh-119331) (gh-119425) _PyArg_Parser holds static global data generated for modules by Argument Clinic. The _PyArg_Parser.kwtuple field is a tuple object, even though it's stored within a static global. In some cases the tuple is statically allocated and thus it's okay that it gets shared by multiple interpreters. However, in other cases the tuple is set lazily, allocated from the heap using the active interprepreter at the point the tuple is needed. This is a problem once that interpreter is destroyed since _PyArg_Parser.kwtuple becomes at dangling pointer, leading to crashes. It isn't a problem if the tuple is allocated under the main interpreter, since its lifetime is bound to the lifetime of the runtime. The solution here is to temporarily switch to the main interpreter. The alternative would be to always statically allocate the tuple. This change also fixes a bug where only the most recent parser was added to the global linked list. (cherry picked from commit 81865002aee8eaaeb3c7e402f86183afa6de77bf)
* gh-118507 : Refactor ntpath native functions (gh-119381)Nice Zombies2024-05-222-0/+25
| | | | This refactoring will make future backports easier without changing behaviours, apart from correcting a bug when passing a pipe to `ntpath.isfile`.
* [3.12] gh-118643: Fix AttributeError in the email module (GH-119099) (GH-119390)Miss Islington (bot)2024-05-221-2/+10
| | | | | | | | | | Fix regression introduced in gh-100884: AttributeError when re-fold a long address list. Also fix more cases of incorrect encoding of the address separator in the address list missed in gh-100884. (cherry picked from commit 858b9e85fcdd495947c9e892ce6e3734652c48f2) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-119189: Add yet more tests for mixed Fraction arithmetic ↵Miss Islington (bot)2024-05-211-3/+32
| | | | | | | (GH-119298) (GH-119347) (cherry picked from commit 10b1bd926a5546e0f5cbd1a47d00dc5ff84f1979) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-119050: Add XML support to libregrtest refleak checker (#119148) ↵Victor Stinner2024-05-204-25/+37
| | | | | | | | | | | | | | | (#119272) gh-119050: Add XML support to libregrtest refleak checker (#119148) regrtest test runner: Add XML support to the refleak checker (-R option). * run_unittest() now stores XML elements as string, rather than objects, in support.junit_xml_list. * runtest_refleak() now saves/restores XML strings before/after checking for reference leaks. Save XML into a temporary file. (cherry picked from commit 9257731f5d3e9d4f99e314b23a14506563e167d7)
* [3.12] gh-119189: Add more tests for mixed Fraction arithmetic (GH-119236) ↵Miss Islington (bot)2024-05-201-0/+263
| | | | | | | (GH-119256) (cherry picked from commit fe67af19638d208239549ccac8b4f4fb6480e801) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-92081: Fix for email.generator.Generator with whitespace between ↵Miss Islington (bot)2024-05-202-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | encoded words. (GH-92281) (#119246) * Fix for email.generator.Generator with whitespace between encoded words. email.generator.Generator currently does not handle whitespace between encoded words correctly when the encoded words span multiple lines. The current generator will create an encoded word for each line. If the end of the line happens to correspond with the end real word in the plaintext, the generator will place an unencoded space at the start of the subsequent lines to represent the whitespace between the plaintext words. A compliant decoder will strip all the whitespace from between two encoded words which leads to missing spaces in the round-tripped output. The fix for this is to make sure that whitespace between two encoded words ends up inside of one or the other of the encoded words. This fix places the space inside of the second encoded word. A second problem happens with continuation lines. A continuation line that starts with whitespace and is followed by a non-encoded word is fine because the newline between such continuation lines is defined as condensing to a single space character. When the continuation line starts with whitespace followed by an encoded word, however, the RFCs specify that the word is run together with the encoded word on the previous line. This is because normal words are filded on syntactic breaks by encoded words are not. The solution to this is to add the whitespace to the start of the encoded word on the continuation line. Test cases are from GH-92081 * Rename a variable so it's not confused with the final variable. (cherry picked from commit a6fdb31b6714c9f3c65fefbb3fe388b2b139a75f) Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* [3.12] gh-119050: Add type hints to libregrtest/results.py (GH-119144) (#119157)Miss Islington (bot)2024-05-181-6/+6
| | | | | | | | gh-119050: Add type hints to libregrtest/results.py (GH-119144) Sort also 'omitted' in TestResults.display_result(). (cherry picked from commit 30b4e9f9c42493136c58c56fee5553128bb32428) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] Add Tkinter tests for different events (GH-118778) (GH-119095)Serhiy Storchaka2024-05-161-0/+278
| | | (cherry picked from commit b6839942a8906fccdd64e749abeefe8a61ce7e03)
* [3.12] gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests ↵Serhiy Storchaka2024-05-1619-128/+116
| | | | | (GH-119065) (GH-119088) (cherry picked from commit 0152dc4ff5534fa2948b95262e70ff6b202b9b99)
* gh-118486: Simplify test_win32_mkdir_700 to check the exact ACL (GH-119056)Miss Islington (bot)2024-05-151-15/+8
| | | | | (cherry picked from commit 94591dca510c796c7d40e9b4167ea56f2fdf28ca) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.12] typing tests: remove some unnecessary uses of `exec()` (GH-119005) ↵Miss Islington (bot)2024-05-141-19/+9
| | | | | | | | (#119039) (cherry picked from commit a9328e2b6ee05c186dcc552feb92b862b4a574df) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] Add yet few cases for urlparse/urlunparse roundtrip tests (GH-119031) ↵Miss Islington (bot)2024-05-141-0/+17
| | | | | | | (GH-119036) (cherry picked from commit 331d385af9817eaa32b739130227781358f85771) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-67693: Fix urlunparse() and urlunsplit() for URIs with path ↵Miss Islington (bot)2024-05-141-3/+67
| | | | | | | starting with multiple slashes and no authority (GH-113563) (GH-119024) (cherry picked from commit e237b25a4fa5626fcd1b1848aa03f725f892e40e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-58933: Make pdb return to caller frame correctly when f_trace is ↵Tian Gao2024-05-131-0/+52
| | | | | | | | | | not set (GH-118979) (#119008) * [3.12] gh-58933: Make pdb return to caller frame correctly when f_trace is not set (GH-118979) (cherry picked from commit f526314194f7fd15931025f8a4439c1765666e42) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
* [3.12] gh-87106: Fix inspect.signature.bind() handling of positional-only ↵Miss Islington (bot)2024-05-131-5/+20
| | | | | | | arguments with **kwargs (GH-103404) (GH-118984) (cherry picked from commit 9c1520244151f36e010c1b04bedf14747a28517d) Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* [3.12] gh-118899: Add tests for `NotImplemented` attribute access ↵Miss Islington (bot)2024-05-121-0/+18
| | | | | | | | (GH-118902) (#118969) gh-118899: Add tests for `NotImplemented` attribute access (GH-118902) (cherry picked from commit ec1398e117fb142cc830495503dbdbb1ddafe941) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488)Steve Dower2024-05-092-0/+47
|
* gh-118802: Fix ACL use in test for non-English Windows (GH-118831)Miss Islington (bot)2024-05-091-3/+2
| | | | | (cherry picked from commit 82acc5f2113bffd0ed902851f4ccf5b9be8980b2) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.12] gh-103956: Fix `trace` output in case of missing source line ↵Miss Islington (bot)2024-05-091-0/+25
| | | | | | | | (GH-103958) (GH-118832) Print only filename with lineno if linecache.getline() returns an empty string. (cherry picked from commit 7c87ce777b3fd9055b118a58ec8614901ecb45e9) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
* [3.12] gh-118033: Fix `__weakref__` not set for generic dataclasses ↵Miss Islington (bot)2024-05-091-0/+106
| | | | | | | | (GH-118099) (#118822) gh-118033: Fix `__weakref__` not set for generic dataclasses (GH-118099) (cherry picked from commit fa9b9cb11379806843ae03b1e4ad4ccd95a63c02) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>