summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* gh-119574: Add some missing environment variables to '--help-env'. (GH-120006)devdanzin2024-06-181-0/+70
|
* gh-120417: Add #noqa: F401 to tests (#120627)Victor Stinner2024-06-1824-41/+43
| | | | Ignore linter "imported but unused" warnings in tests when the linter doesn't understand how the import is used.
* gh-117953: Skip `test_interpreters` properly without GIL (#120689)Nice Zombies2024-06-181-3/+6
|
* gh-120417: Use import_helper() in test_regrtest (#120680)Victor Stinner2024-06-181-14/+12
|
* gh-120449: fix ``test_pyclbr`` introspection for mangled names (GH-120450)Bénédikt Tran2024-06-182-17/+75
|
* gh-120600: Make Py_TYPE() opaque in limited C API 3.14 (#120601)Victor Stinner2024-06-181-0/+1
| | | | In the limited C API 3.14 and newer, Py_TYPE() is now implemented as an opaque function call to hide implementation details.
* gh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (#118807)Sam Gross2024-06-181-0/+28
| | | | | | | | | | | | This exposes `PyUnstable_Object_ClearWeakRefsNoCallbacks` as an unstable C-API function to provide a thread-safe mechanism for clearing weakrefs without executing callbacks. Some C-API extensions need to clear weakrefs without calling callbacks, such as after running finalizers like we do in subtype_dealloc. Previously they could use `_PyWeakref_ClearRef` on each weakref, but that's not thread-safe in the free-threaded build. Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-120659: Skip `test_freethreading` with GIL (#120660)Nice Zombies2024-06-181-0/+4
|
* gh-120417: Move imports to doctests in test_doctest (#120679)Victor Stinner2024-06-181-4/+14
|
* gh-120381: Fix inspect.ismethoddescriptor() (#120383)Jan Kaliszewski2024-06-182-7/+125
| | | | | | | | The `inspect.ismethoddescriptor()` function did not check for the lack of `__delete__()` and, consequently, erroneously returned True when applied to *data* descriptors with only `__get__()` and `__delete__()` defined. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
* GH-120507: Lower the `BEFORE_WITH` and `BEFORE_ASYNC_WITH` instructions. ↵Mark Shannon2024-06-183-303/+321
| | | | | | | | | (#120640) * Remove BEFORE_WITH and BEFORE_ASYNC_WITH instructions. * Add LOAD_SPECIAL instruction * Reimplement `with` and `async with` statements using LOAD_SPECIAL
* gh-119897: Add test for lambda generator invocation (#120658)Irit Katriel2024-06-181-1/+5
| | | gh-120467: Add test for lambda generator invocation
* gh-120590: Fix test_pydoc in the refleak hunting mode (GH-120615)Serhiy Storchaka2024-06-181-8/+32
| | | | | | Mocking only works if sys.modules['pydoc'] and pydoc are the same, but some pydoc functions reload the module and change sys.modules. Ensure that sys.modules['pydoc'] is always restored after the corresponding tests.
* gh-120560: Mark `zip64` tests in `test_zipimport` as CPU-heavy (GH-120564)Nice Zombies2024-06-171-0/+2
|
* gh-120524: Avoid a Race On ↵Eric Snow2024-06-171-1/+0
| | | | | _PyRuntime.types.managed_static.types[i].interp_count (gh-120529) gh-120182 added new global state (interp_count), but didn't add thread-safety for it. This change eliminates the possible race.
* gh-120417: Modify test_bdb to use the import (#120628)Victor Stinner2024-06-171-1/+2
| | | Run test_module_for_bdb with a specific namespace.
* gh-120417: Remove unused imports in tests (part 1) (#120629)Victor Stinner2024-06-1710-13/+3
|
* gh-120417: Remove unused imports in tests (part 2) (#120630)Victor Stinner2024-06-1710-15/+5
|
* gh-120417: Remove unused imports in tests (part 3) (#120631)Victor Stinner2024-06-1710-14/+4
|
* gh-117657: Fix `__slots__` thread safety in free-threaded build (#119368)Daniele Parmeggiani2024-06-172-1/+44
| | | | Fix a race in `PyMember_GetOne` and `PyMember_SetOne` for `Py_T_OBJECT_EX`. These functions implement `__slots__` accesses for Python objects.
* gh-115649: Copy the filename into main interpreter before intern in import.c ↵AN Long2024-06-171-0/+2
| | | | | (#120315) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-120417: Remove unused imports in tests (part 4) (#120632)Victor Stinner2024-06-177-10/+1
|
* gh-114091: Reword error message for unawaitable types (#114090)Steele Farnsworth2024-06-173-8/+8
| | | | | Reword error message for unawaitable types.
* gh-119933: Improve ``SyntaxError`` message for invalid type parameters ↵Bénédikt Tran2024-06-173-17/+130
| | | | | expressions (#119976) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* GH-120619: Clean up `RETURN_VALUE` instruction (GH-120624)Mark Shannon2024-06-171-6/+6
| | | | | * Rename _POP_FRAME to _RETURN_VALUE as it returns a value as well as popping a frame. * Remove remaining _POP_FRAMEs
* gh-120367: fix removal of redundant NOPs and jumps after reordering hot-cold ↵Irit Katriel2024-06-171-0/+27
| | | | blocks (#120425)
* gh-120567: Clarify weekday return in calendar.monthrange docstring (#120570)Terry Jan Reedy2024-06-161-2/+2
| | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-120485: Add an override of `allow_reuse_port` on classes subclassing ↵Idan Kapustian2024-06-164-2/+6
| | | | | `socketserver.TCPServer` (GH-120488) Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
* gh-120579: Guard `_testcapi` import in `test_free_threading` (#120580)Nikita Sobolev2024-06-161-1/+6
|
* gh-112346: Always set OS byte to 255, simpler gzip.compress function. ↵Ruben Vorderman2024-06-152-31/+19
| | | | | (GH-120486) This matches the output behavior in 3.10 and earlier; the optimization in 3.11 allowed the zlib library's "os" value to be filled in instead in the circumstance when mtime was 0. this keeps things consistent.
* gh-120541: Improve the "less" prompt in pydoc (GH-120543)Serhiy Storchaka2024-06-152-14/+57
| | | | | When help() is called with non-string argument, use __qualname__ or __name__ if available, otherwise use "{typename} object".
* Add some more edge-case tests for `inspect.get_annotations` with ↵Alex Waygood2024-06-152-11/+36
| | | | `eval_str=True` (#120550)
* gh-120495: Fix incorrect exception handling in Tab Nanny (#120498)Wulian2332024-06-152-5/+5
| | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-120544: Add `else: fail()` to tests where exception is expected (#120545)Nikita Sobolev2024-06-152-0/+12
|
* gh-117398: Use the correct module loader for iOS in datetime CAPI test. ↵Russell Keith-Magee2024-06-151-1/+8
| | | | | (#120477) Use the correct loader for iOS.
* gh-119819: Conditional skip of logging tests that require multiprocessing ↵Russell Keith-Magee2024-06-151-3/+2
| | | | | subprocess support (#120476) Skip tests that require multiprocessing subprocess support.
* gh-120524: Temporarily Skip test_create_many_threaded In ↵Eric Snow2024-06-141-0/+1
| | | | test_interpreters.test_stress (gh-120525)
* gh-120161: Fix a Crash in the _datetime Module (gh-120182)Eric Snow2024-06-141-1/+43
| | | | | | | In gh-120009 I used an atexit hook to finalize the _datetime module's static types at interpreter shutdown. However, atexit hooks are executed very early in finalization, which is a problem in the few cases where a subclass of one of those static types is still alive until the final GC collection. The static builtin types don't have this probably because they are finalized toward the end, after the final GC collection. To avoid the problem for _datetime, I have applied a similar approach here. Also, credit goes to @mgorny and @neonene for the new tests. FYI, I would have liked to take a slightly cleaner approach with managed static types, but wanted to get a smaller fix in first for the sake of backporting. I'll circle back to the cleaner approach with a future change on the main branch.
* gh-120417: Fix "imported but unused" linter warnings (#120461)Victor Stinner2024-06-147-8/+84
| | | | | | | | | | | Add __all__ to the following modules: importlib.machinery, importlib.util and xml.sax. Add also "# noqa: F401" in collections.abc, subprocess and xml.sax. * Sort __all__; remove collections.abc.__all__; remove private names * Add tests
* gh-119824: Print stack entry when user input is needed (#119882)Tian Gao2024-06-142-19/+81
| | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-120361: Add `nonmember` test with enum flags inside to `test_enum` ↵Nikita Sobolev2024-06-141-0/+21
| | | | | (GH-120364) * gh-120361: Add `nonmember` test with enum flags inside to `test_enum`
* GH-73991: Add `pathlib.Path.copy()` (#119058)Barney Gale2024-06-144-0/+246
| | | | | | | | | | | | | | | Add a `Path.copy()` method that copies the content of one file to another. This method is similar to `shutil.copyfile()` but differs in the following ways: - Uses `fcntl.FICLONE` where available (see GH-81338) - Uses `os.copy_file_range` where available (see GH-81340) - Uses `_winapi.CopyFile2` where available, even though this copies more metadata than the other implementations. This makes `WindowsPath.copy()` more similar to `shutil.copy2()`. The method is presently _less_ specified than the `shutil` functions to allow OS-specific optimizations that might copy more or less metadata. Incorporates code from GH-81338 and GH-93152. Co-authored-by: Eryk Sun <eryksun@gmail.com>
* Update tests for the itertools docs rough equivalents (#120509)Raymond Hettinger2024-06-141-18/+315
|
* Stronger tests for the statistics kernel formulas (gh-120506)Raymond Hettinger2024-06-141-3/+7
|
* gh-114053: Fix bad interaction of PEP 695, PEP 563 and ↵Alex Waygood2024-06-133-1/+182
| | | | `inspect.get_annotations` (#120270)
* gh-120012: clarify the behaviour of `multiprocessing.Queue.empty` on closed ↵Bénédikt Tran2024-06-131-0/+26
| | | | | | | | queues. (GH-120102) * improve doc for `multiprocessing.Queue.empty` * add tests for checking emptiness of queues Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-117398: Add datetime C-API type check test for subinterpreters (gh-119604)neonene2024-06-132-1/+42
| | | Check if the DateTime C-API type matches the datetime.date type on main and shared/isolated subinterpreters.
* gh-120417: Add #noqa to used imports in the stdlib (#120421)Victor Stinner2024-06-1325-36/+40
| | | | | Tools such as ruff can ignore "imported but unused" warnings if a line ends with "# noqa: F401". It avoids the temptation to remove an import which is used effectively.
* gh-120418: Don't assume wheeldata is deleted if `WHEEL_PKG_DIR` is set (#120419)Stefano Rivera2024-06-121-3/+4
| | | | | | | | Remove wheeldata from both sides of the `assertEqual`, so that we're *actually* ignoring it from the test set. This test is only making assertions about the source tree, no code is being executed that would do anything different based on the value of `WHEEL_PKG_DIR`.
* gh-118908: Protect the REPL subprocess with a timeout in tests (#120408)Pablo Galindo Salgado2024-06-121-1/+6
|