summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* gh-118209: Add Windows structured exception handling to mmap module (GH-118213)Dobatymo2024-05-101-0/+77
|
* gh-118851: Default ctx arguments to AST constructors to Load() (#118854)Jelle Zijlstra2024-05-091-0/+17
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-118846: Fix PGO tests in free-threaded build (#118862)Sam Gross2024-05-092-2/+4
| | | | | | Avoid immortalizing objects in tests that verify garbage collection of classes or modules. This fixes test_ordered_dict and test_struct.
* gh-118817: Fix `asyncio REPL` on Windows (#118819)Kirill Podoprigora2024-05-091-1/+4
|
* gh-118767: Improve tests and docs for bool(NotImplemented) (#118813)Jelle Zijlstra2024-05-091-6/+8
|
* gh-118802: Fix ACL use in test for non-English Windows (GH-118831)Steve Dower2024-05-091-3/+2
|
* gh-103956: Fix `trace` output in case of missing source line (GH-103958)Radislav Chugunov2024-05-091-0/+25
| | | | Print only filename with lineno if linecache.getline() returns an empty string.
* gh-118805: Remove type, choices, metavar params of `BooleanOptionalAction` ↵Nikita Sobolev2024-05-091-43/+0
| | | | | (#118806) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-118798: Remove deprecated isdst parameter from `email.utils.localtime` ↵Hugo van Kemenade2024-05-091-4/+0
| | | | (#118799)
* gh-118033: Fix `__weakref__` not set for generic dataclasses (#118099)Nikita Sobolev2024-05-091-0/+106
|
* GH-101588: Remove deprecated pickle/copy/deepcopy from itertools (gh-118816)Raymond Hettinger2024-05-091-436/+1
|
* [tests]: Mark ``test_statistics.test_kde_random`` with a ↵Kirill Podoprigora2024-05-091-0/+1
| | | | | ``requires_resource('cpu')`` decorator (#118801) Mark test_kde_random with a requires_resource('cpu') decorator
* gh-118803: Remove `ByteString` from `typing` and `collections.abc` (#118804)Nikita Sobolev2024-05-083-35/+1
|
* Fixing a typo in test_cmd_line.py (#118728)Yutian Li2024-05-081-1/+1
|
* gh-118767: Make bool(NotImplemented) raise TypeError (#118775)Jelle Zijlstra2024-05-081-7/+4
|
* gh-118772: Allow TypeVars without a default to follow those with a default ↵Jelle Zijlstra2024-05-081-0/+17
| | | | when constructing aliases (#118774)
* gh-118671: Updated dead ActiveState links (#118730)trag1c2024-05-081-1/+1
| | | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-118610: Centralize power caching in `_pylong.py` (#118611)Tim Peters2024-05-081-0/+12
| | | | | A new `compute_powers()` function computes all and only the powers of the base the various base-conversion functions need, as efficiently as reasonably possible (turns out that invoking `**`is needed at most once). This typically gives a few % speedup, but the primary point is to simplify the base-conversion functions, which no longer need their own, ad hoc, and less efficient power-caching schemes. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-118518: Check for perf version and not kernel version in ↵Pablo Galindo Salgado2024-05-071-6/+12
| | | | test_perf_profiler (#118640)
* gh-118729: Temporarily skip `test_multiprocessing_pool_circular_import` ↵Sam Gross2024-05-071-1/+4
| | | | | | | (#118732) The `pool_in_threads.py` test file may crash in free-threaded builds, which can lead to the Tsan test hanging. Skip it for now until we fix the underlying issue.
* gh-111201: Allow pasted code to contain multiple statements in the REPL ↵Pablo Galindo Salgado2024-05-071-3/+19
| | | | | (#118712) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-118682: Revert forcing str commands, allow class commands in pyrepl (#118709)Lysandros Nikolaou2024-05-071-0/+9
|
* gh-118660: Add second type parameter to (Async)ContextManager (#118681)Jelle Zijlstra2024-05-071-4/+19
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-111201: Allow bracketed paste to work (GH-118700)Pablo Galindo Salgado2024-05-071-0/+40
|
* gh-66410: Do not stringify arguments of Tkinter callback (GH-98592)Serhiy Storchaka2024-05-071-12/+23
| | | | | | | | | Callbacks registered in the tkinter module now take arguments as various Python objects (int, float, bytes, tuple), not just str. To restore the previous behavior set tkinter module global wantobject to 1 before creating the Tk object or call the wantobject() method of the Tk object with argument 1. Calling it with argument 2 restores the current default behavior.
* gh-118090: Improve error message for empty type param brackets (GH-118091)Nikita Sobolev2024-05-071-0/+41
|
* gh-118518: Rename `PYTHONPERFJITSUPPORT` and `-X perfjit` with underscores ↵Hugo van Kemenade2024-05-071-1/+1
| | | | (#118693)
* gh-118418: Deprecate failing to pass a value to the *type_params* parameter ↵Alex Waygood2024-05-071-0/+25
| | | | of some private `typing` APIs (#118695)
* gh-118314: Fix padding edge case in binascii.a2b_base64 strict mode (GH-118320)Youfu Zhang2024-05-071-0/+15
| | | | | | | Fix an edge case in `binascii.a2b_base64` strict mode, where excessive padding was not detected when no padding is necessary. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
* gh-62090: Simplify argparse usage formatting (GH-105039)Ali Hamdan2024-05-071-0/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationale ========= argparse performs a complex formatting of the usage for argument grouping and for line wrapping to fit the terminal width. This formatting has been a constant source of bugs for at least 10 years (see linked issues below) where defensive assertion errors are triggered or brackets and paranthesis are not properly handeled. Problem ======= The current implementation of argparse usage formatting relies on regular expressions to group arguments usage only to separate them again later with another set of regular expressions. This is a complex and error prone approach that caused all the issues linked below. Special casing certain argument formats has not solved the problem. The following are some of the most common issues: - empty `metavar` - mutually exclusive groups with `SUPPRESS`ed arguments - metavars with whitespace - metavars with brackets or paranthesis Solution ======== The following two comments summarize the solution: - https://github.com/python/cpython/issues/82091#issuecomment-1093832187 - https://github.com/python/cpython/issues/77048#issuecomment-1093776995 Mainly, the solution is to rewrite the usage formatting to avoid the group-then-separate approach. Instead, the usage parts are kept separate and only joined together at the end. This allows for a much simpler implementation that is easier to understand and maintain. It avoids the regular expressions approach and fixes the corresponding issues. This closes the following GitHub issues: - #62090 - #62549 - #77048 - #82091 - #89743 - #96310 - #98666 These PRs become obsolete: - #15372 - #96311
* gh-118107: Fix zipimporter ZIP64 handling. (GH-118108)John Sirois2024-05-074-0/+121
| | | | | | | | | | | | Add missing import to code that handles too large files and offsets. Use list, not tuple, for a mutable sequence. Add tests to prevent similar mistakes. --------- Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-118414: Fix assertion in YIELD_VALUE when tracing lines or instrs (#118683)Tian Gao2024-05-071-0/+11
|
* gh-117953: Always Run Extension Init Func in Main Interpreter First (gh-118157)Eric Snow2024-05-072-14/+11
| | | This change makes sure all extension/builtin modules have their init function run first by the main interpreter before proceeding with import in the original interpreter (main or otherwise). This means when the import of a single-phase init module fails in an isolated subinterpreter, it won't tie any global state/callbacks to the subinterpreter.
* gh-110209: Add __class_getitem__ for generator and coroutine (#110212)James Hilton-Balfe2024-05-071-1/+2
|
* gh-112075: use per-thread dict version pool (#118676)Dino Viehland2024-05-071-0/+36
| | | use thread state set of dict versions
* gh-118527: Intern code consts in free-threaded build (#118667)Sam Gross2024-05-075-4/+34
| | | | | | We already intern and immortalize most string constants. In the free-threaded build, other constants can be a source of reference count contention because they are shared by all threads running the same code objects.
* gh-118473: Fix set_asyncgen_hooks not to be partially set when arguments are ↵Jeong, YunWon2024-05-071-1/+15
| | | | invalid (#118474)
* gh-118362: Skip tests when threading isn't available (#118666)Dino Viehland2024-05-063-16/+16
| | | | | * Skip tests when threads aren't available * Use ThreadPoolExecutor
* gh-112075: Fix race in constructing dict for instance (#118499)Dino Viehland2024-05-061-0/+141
|
* gh-117486: Improve behavior for user-defined AST subclasses (#118212)Jelle Zijlstra2024-05-061-4/+37
| | | | | | | | Now, such classes will no longer require changes in Python 3.13 in the normal case. The test suite for robotframework passes with no DeprecationWarnings under this PR. I also added a new DeprecationWarning for the case where `_field_types` exists but is incomplete, since that seems likely to indicate a user mistake.
* gh-118647: Add defaults to typing.Generator and typing.AsyncGenerator (#118648)Jelle Zijlstra2024-05-061-0/+11
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* Test premium Mac builders (#118672)Łukasz Langa2024-05-061-3/+3
|
* GH-115709: Invalidate executors when a local variable is changed via ↵Mark Shannon2024-05-061-0/+13
| | | | | frame.f_locals (#118639) Also fix unrelated assert in debug Tier2/JIT builds.
* gh-118415: Fix issues with local tracing being enabled/disabled on a ↵Dino Viehland2024-05-061-13/+26
| | | | function (#118496)
* GH-83151: Add closure support to pdb (GH-111094)Tian Gao2024-05-061-1/+64
|
* gh-118362: Fix thread safety around lookups from the type cache in the face ↵Dino Viehland2024-05-062-0/+131
| | | | | | | of concurrent mutators (#118454) Add _PyType_LookupRef and use incref before setting attribute on type Makes setting an attribute on a class and signaling type modified atomic Avoid adding re-entrancy exposing the type cache in an inconsistent state by decrefing after type is updated
* GH-117714: implement athrow().close() and asend().close() using throw ↵Thomas Grainger2024-05-061-0/+48
| | | | | | | | | | | | | | | | | | (GH-117906) * GH-117714: replace athrow().close() and asend().close() stubs with implimentations * test athrow().close() and asend().close() raises RuntimeError * 📜🤖 Added by blurb_it. * Update Objects/genobject.c Co-authored-by: Petr Viktorin <encukou@gmail.com> --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-118271: Support more options for reading/writing images in Tkinter ↵Serhiy Storchaka2024-05-061-5/+101
| | | | | | | | (GH-118273) * Add PhotoImage.read() to read an image from a file. * Add PhotoImage.data() to get the image data. * Add background and grayscale parameters to PhotoImage.write().
* gh-118225: Support more options for copying images in Tkinter (GH-118228)Serhiy Storchaka2024-05-061-1/+150
| | | | | | | | * Add the PhotoImage method copy_replace() to copy a region from one image to other image, possibly with pixel zooming and/or subsampling. * Add from_coords parameter to PhotoImage methods copy(), zoom() and subsample(). * Add zoom and subsample parameters to PhotoImage method copy().
* gh-116871: Improve name suggestions in tracebacks (GH-116930)Serhiy Storchaka2024-05-061-0/+32
| | | | | Only include underscored names in name suggestions for AttributeError and ImportError if the original name was underscored.