summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror messages ↵Bénédikt Tran2024-12-172-15/+86
| | | | | | | | (GH-126746) - Add a helper to set an error from locale-encoded `char*` - Use the helper for gdbm & dlerror messages Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-127085: Add a test skip if multiprocessing isn't available (#128019)Russell Keith-Magee2024-12-171-1/+4
| | | Add a test skip if multiprocessing isn't available.
* gh-127146: Emscripten clean up test suite (#127984)Hood Chatham2024-12-1712-82/+19
| | | Removed test skips that are no longer required as a result of Emscripten updates.
* gh-126907: make `atexit` thread safe in free-threading (#127935)Peter Bierma2024-12-161-1/+34
| | | | Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-127085: fix some data races in memoryview in free-threading (#127412)Edward Xu2024-12-161-1/+25
|
* Revert "gh-127586: properly restore blocked signals in resource_tracker.py ↵Hugo van Kemenade2024-12-161-15/+0
| | | | | (GH-127587)" (#127983) This reverts commit 46006a1b355f75d06c10e7b8086912c483b34487.
* GH-126985: Don't override venv detection with PYTHONHOME (#127968)Filipe Laíns 🇵🇸2024-12-151-0/+31
|
* gh-127586: properly restore blocked signals in resource_tracker.py (GH-127587)Stephen Hansen2024-12-151-0/+15
| | | | | | | | | | | | | | * Correct pthread_sigmask in resource_tracker to restore old signals Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally cause side effects if the calling parent already had said signals blocked to begin with and did not intend to unblock them when creating a pool. Use SIG_SETMASK instead with the previous mask of blocked signals to restore the original blocked set. * Adding resource_tracker blocked signals test Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-127353: Allow to force color output on Windows V2 (#127926)Andrey Efremov2024-12-141-30/+40
|
* Fix typo in docstring: quadruple double quotes (#127913)Totosuki2024-12-141-1/+1
|
* gh-127747: Resolve BytesWarning in test.support.strace_helper (#127849)Cody Maloney2024-12-141-4/+5
| | | | | | | | | | | | | | | | | | | | | The strace_helper code has a _make_error function to simplify making StraceResult objects in error cases. That takes a details parameter which is either a caught OSError or `bytes`. If it's bytes, _make_error would implicitly coerce that to a str inside of a f-string, resulting in a BytesWarning. It's useful to see if it's an OSError or bytes when debugging, resolve by changing to format with repr(). This is an error message on an internal helper. A non-zero exit code occurs if the strace binary isn't found, and no events will be parsed in that case (there is no output). Handle that case by checking exit code before checking for events. Still asserting around events rather than returning false, so that hopefully if there's some change to `strace` that breaks the parsing, will see that as a test failure rather than silently loosing strace tests because they are auto-disabled.
* gh-115999: Specialize loading attributes from modules in free-threaded ↵mpage2024-12-133-10/+113
| | | | | | | | | builds (#127711) We use the same approach that was used for specialization of LOAD_GLOBAL in free-threaded builds: _CHECK_ATTR_MODULE is renamed to _CHECK_ATTR_MODULE_PUSH_KEYS; it pushes the keys object for the following _LOAD_ATTR_MODULE_FROM_KEYS (nee _LOAD_ATTR_MODULE). This arrangement avoids having to recheck the keys version. _LOAD_ATTR_MODULE is renamed to _LOAD_ATTR_MODULE_FROM_KEYS; it loads the value from the keys object pushed by the preceding _CHECK_ATTR_MODULE_PUSH_KEYS at the cached index.
* gh-102471, PEP 757: Add PyLong import and export API (#121339)Victor Stinner2024-12-131-0/+91
| | | | | Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Steve Dower <steve.dower@microsoft.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-127906: Test the limited C API in test_cppext (#127916)Victor Stinner2024-12-133-3/+25
|
* gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (#127872)Victor Stinner2024-12-131-2/+10
|
* Revert "gh-127353: Allow to force color output on Windows (#127354)" (#127889)Hugo van Kemenade2024-12-121-37/+0
| | | This reverts commit 365451e28368db46ae89a3a990d85c10c2284aa2.
* gh-127353: Allow to force color output on Windows (#127354)Andrey Efremov2024-12-121-0/+37
|
* GH-127807: pathlib ABCs: remove `PathBase._unsupported_msg()` (#127855)Barney Gale2024-12-122-9/+11
| | | | | This method helped us customise the `UnsupportedOperation` message depending on the type. But we're aiming to make `PathBase` a proper ABC soon, so `NotImplementedError` is the right exception to raise there.
* GH-127381: pathlib ABCs: remove remaining uncommon `PathBase` methods (#127714)Barney Gale2024-12-121-12/+0
| | | | | | | | | | | | | | | | | | Remove the following methods from `pathlib._abc.PathBase`: - `expanduser()` - `hardlink_to()` - `touch()` - `chmod()` - `lchmod()` - `owner()` - `group()` - `from_uri()` - `as_uri()` These operations aren't regularly supported in virtual filesystems, so they don't win a place in the `PathBase` interface. (Some of them probably don't deserve a place in `Path` :P.) They're quasi-abstract (except `lchmod()`), and they're not called by other `PathBase` methods.
* gh-127740: Add some more tests for earlier PR #127756 (#127818)Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)2024-12-121-0/+4
|
* gh-127146: Some expected failures in Emscripten time tests (#127843)Hood Chatham2024-12-122-7/+25
| | | | Disables two tests in the test_time suite, and adjusts test_os to reflect precision limits in Emscripten.
* gh-111609: Test `end_offset` in SyntaxError subclass (#127830)Nice Zombies2024-12-111-0/+15
| | | Test `end_offset` in SyntaxError subclass
* GH-125174: Mark objects as statically allocated. (#127797)Mark Shannon2024-12-112-1/+17
| | | | | * Set a bit in the unused part of the refcount on 64 bit machines and the free-threaded build. * Use the top of the refcount range on 32 bit machines
* gh-127065: Make methodcaller thread-safe and re-entrant (GH-127746)Pieter Eendebak2024-12-112-0/+46
| | | | | | | | | | | The function `operator.methodcaller` was not thread-safe since the additional of the vectorcall method in gh-89013. In the free threading build the issue is easy to trigger, for the normal build harder. This makes the `methodcaller` safe by: * Replacing the lazy initialization with initialization in the constructor. * Using a stack allocated space for the vectorcall arguments and falling back to `tp_call` for calls with more than 8 arguments.
* GH-127058: Make `PySequence_Tuple` safer and probably faster. (#127758)Mark Shannon2024-12-111-0/+25
| | | | * Use a small buffer, then list when constructing a tuple from an arbitrary sequence.
* gh-123401: Fix http.cookies module to support obsolete RFC 850 date format ↵Nano2024-12-111-0/+46
| | | | | | | (#123405) Co-authored-by: Wulian <1055917385@qq.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-126992: Change pickle code to base 10 for load_long and load_int (GH-127042)Justin Applegate2024-12-112-0/+57
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-127740: For odd-length input to bytes.fromhex(...) change the error ↵Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)2024-12-111-0/+6
| | | | message to ValueError: fromhex() arg must be of even length (#127756)
* GH-127381: pathlib ABCs: remove `PathBase.samefile()` and rarer `is_*()` ↵Barney Gale2024-12-112-83/+75
| | | | | | | | | | (#127709) Remove `PathBase.samefile()`, which is fairly specific to the local FS, and relies on `stat()`, which we're aiming to remove from `PathBase`. Also remove `PathBase.is_mount()`, `is_junction()`, `is_block_device()`, `is_char_device()`, `is_fifo()` and `is_socket()`. These rely on POSIX file type numbers that we're aiming to remove from the `PathBase` API.
* gh-59705: Set OS thread name when Thread.name is changed (#127702)Victor Stinner2024-12-101-0/+19
| | | Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-126937: ctypes: fix TypeError when a field's size is >65535 bytes (GH-126938)Melissa0x1f9922024-12-101-0/+23
| | | | | Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-126491: Revert "GH-126491: Lower heap size limit with faster marking ↵Petr Viktorin2024-12-101-3/+11
| | | | | | | | (GH-127519)" (GH-127770) Revert "GH-126491: Lower heap size limit with faster marking (GH-127519)" This reverts commit 023b7d2141467017abc27de864f3f44677768cb3, which introduced a refleak.
* gh-125420: implement `Sequence.count` API on `memoryview` objects (#125443)Bénédikt Tran2024-12-101-0/+28
|
* add help blurb for "extralargefile" (#127710)Skip Montanaro2024-12-101-20/+22
|
* gh-127718: Add colour to `test.regrtest` output (#127719)Hugo van Kemenade2024-12-105-53/+163
|
* gh-127651: Use __file__ in diagnostics if origin is missing (#127660)Shantanu2024-12-101-2/+46
| | | | | | | See the left hand side in https://github.com/python/cpython/pull/123929/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59deL2840-L2849 --------- Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-125420: implement `Sequence.index` API on `memoryview` objects (#125446)Bénédikt Tran2024-12-101-0/+26
|
* GH-127456: pathlib ABCs: add protocol for path parser (#127494)Barney Gale2024-12-091-53/+8
| | | | | | | | | | Change the default value of `PurePathBase.parser` from `ParserBase()` to `posixpath`. As a result, user subclasses of `PurePathBase` and `PathBase` use POSIX path syntax by default, which is very often desirable. Move `pathlib._abc.ParserBase` to `pathlib._types.Parser`, and convert it to a runtime-checkable protocol. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-127637: add tests for `dis` command-line interface (#127759)Bénédikt Tran2024-12-091-2/+120
|
* gh-126925: Modify how iOS test results are gathered (#127592)Russell Keith-Magee2024-12-093-0/+161
| | | | | | | Adds a `use_system_log` config item to enable stdout/stderr redirection for Apple platforms. This log streaming is then used by a new iOS test runner script, allowing the display of test suite output at runtime. The iOS test runner script can be used by any Python project, not just the CPython test suite.
* GH-127381: pathlib ABCs: remove `PathBase.unlink()` and `rmdir()` (#127736)Barney Gale2024-12-082-45/+30
| | | | | | | Virtual filesystems don't always make a distinction between deleting files and empty directories, and sometimes support deleting non-empty directories in a single operation. Here we remove `PathBase.unlink()` and `rmdir()`, leaving `_delete()` as the sole deletion method, now made abstract. I hope to drop the underscore prefix later on.
* gh-127610: Added validation for more than one var-positional and var-keyword ↵Apostol Fet2024-12-081-0/+11
| | | | parameters in inspect.Signature (GH-127657)
* GH-126789: fix some sysconfig data on late site initializations (#127729)Filipe Laíns 🇵🇸2024-12-081-0/+25
|
* GH-127090: Fix `urllib.response.addinfourl.url` value for opened `file:` ↵Barney Gale2024-12-073-24/+21
| | | | | URIs (#127091) The canonical `file:` URL (as generated by `pathname2url()`) is now used as the `url` attribute of the returned `addinfourl` object. The `addinfourl.url` attribute reflects the resolved URL for both `file:` or `http[s]:` URLs now.
* GH-127381: pathlib ABCs: remove `PathBase.resolve()` and `absolute()` (#127707)Barney Gale2024-12-062-668/+598
| | | | | | | | | Remove our implementation of POSIX path resolution in `PathBase.resolve()`. This functionality is rather fragile and isn't necessary in most cases. It depends on `PathBase.stat()`, which we're looking to remove. Also remove `PathBase.absolute()`. Many legitimate virtual filesystems lack the notion of a 'current directory', so it's wrong to include in the basic interface.
* GH-127381: pathlib ABCs: remove `PathBase.rename()` and `replace()` (#127658)Barney Gale2024-12-061-2/+0
| | | | These methods are obviated by `PathBase.move()`, which can move directories and supports any `PathBase` object as a target.
* gh-59705: Add _thread.set_name() function (#127338)Victor Stinner2024-12-061-0/+60
| | | | | | | | | | | On Linux, threading.Thread now sets the thread name to the operating system. * configure now checks if pthread_getname_np() and pthread_setname_np() functions are available. * Add PYTHREAD_NAME_MAXLEN macro. * Add _thread._NAME_MAXLEN constant for test_threading. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-127314: Don't mention the GIL when calling without a thread state on the ↵Peter Bierma2024-12-062-7/+19
| | | | | free-threaded build (#127315) Co-authored-by: Victor Stinner <vstinner@python.org>
* GH-126491: Lower heap size limit with faster marking (GH-127519)Mark Shannon2024-12-061-11/+3
| | | | | | | * Faster marking of reachable objects * Changes calculation of work to do and work done. * Merges transitive closure calculations
* gh-120010: Fix invalid (nan+nanj) results in _Py_c_prod() (GH-120287)Sergey B Kirpichev2024-12-061-0/+17
| | | | | | | | | | | | | | | | | | | | In some cases, previously computed as (nan+nanj), we could recover meaningful component values in the result, see e.g. the C11, Annex G.5.1, routine _Cmultd(): >>> z = 1e300+1j >>> z*(nan+infj) # was (nan+nanj) (-inf+infj) That also fix some complex powers for small integer exponents, computed with optimized algorithm (by squaring): >>> z**5 # was (nan+nanj) Traceback (most recent call last): File "<python-input-1>", line 1, in <module> z**5 ~^^~ OverflowError: complex exponentiation