Commit Graph

51277 Commits

Author SHA1 Message Date
Tian Gao a254120f2f
GH-94438: Fix RuntimeWarning for jump tests in test_sys_settrace (GH-111341) 2023-10-26 11:47:51 -07:00
Serhiy Storchaka 309efb39dc
gh-111259: Optimize recursive wildcards in pathlib (GH-111303)
Regular expression pattern `(?s:.)` is much faster than `[\s\S]`.
2023-10-26 18:07:06 +03:00
Nikita Sobolev 31c05b72c1
gh-111348: Fix direct invocation of `test_doctest`; remove `test_doctest.test_coverage` (#111349)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2023-10-26 12:45:39 +00:00
Mark Shannon 5c9d4497ab
GH-111339: Change `valid` property of executors to `is_valid()` method (GH-111350) 2023-10-26 11:31:51 +01:00
Batuhan Taskaya 78e6d72e38
bpo-43950: handle wide unicode characters in tracebacks (#28150) 2023-10-26 07:05:29 +00:00
Pablo Galindo Salgado 90a1b2859f
gh-67224: Show source lines in tracebacks when using the -c option when running Python (#111200) 2023-10-26 15:17:28 +09:00
Irit Katriel 0db2517687
gh-100762: Fix optimization in gen_close (#111069) 2023-10-25 16:22:34 +01:00
Serhiy Storchaka a4981921aa
gh-111165: Add missed "support." prefix for "verbose" (GH-111327) 2023-10-25 14:50:25 +00:00
Hugo van Kemenade 81ed80d843
gh-111187: Postpone removal version for locale.getdefaultlocale() to 3.15 (#111188) 2023-10-25 16:47:41 +03:00
Serhiy Storchaka 9da98c0d9a
gh-111174: Fix crash in getbuffer() called repeatedly for empty BytesIO (GH-111210) 2023-10-25 13:50:16 +03:00
Serhiy Storchaka f6a45a03d0
gh-111165: Move test running code from test.support to libregrtest (GH-111166)
Remove no longer used functions run_unittest() and run_doctest() from
the test.support module.
2023-10-25 12:41:21 +03:00
Serhiy Storchaka b2ba298527
gh-111065: Add more tests for the C API with the PySys_ prefix (GH-111067)
* 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.
2023-10-25 11:33:12 +03:00
Pablo Galindo Salgado 3211d5793f
gh-57129: Add test for inspect.getsource in the REPL (#111197) 2023-10-25 15:15:41 +09:00
Jokimax c73b0f3560
gh-102956: Fix returning of empty byte strings after seek in zipfile … (#103565)
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.
2023-10-24 21:15:42 +00:00
Jochen Sprickerhof 46407fe79c
gh-109017: Use non alternate name for Kyiv (GH-109251)
tzdata provides Kiev as an alternative to Kyiv:
https://sources.debian.org/src/tzdata/2023c-10/backward/?hl=314#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.
2023-10-24 20:11:51 +03:00
Serhiy Storchaka 9bb202a1a9
gh-75666: Tkinter: add tests for binding (GH-111202) 2023-10-24 13:02:12 +03:00
Serhiy Storchaka b8c20f9049
gh-97928: Change the behavior of tkinter.Text.count() (GH-98484)
It now always returns an integer if one or less counting options are specified.
Previously it could return a single count as a 1-tuple, an integer (only if
option "update" was specified) or None if no items found.
The result is now the same if wantobjects is set to 0.
2023-10-24 12:59:19 +03:00
Savannah Ostrowski 6640f1d8d2
GH-94438: Restore ability to jump over None tests (GH-111237) 2023-10-23 23:13:16 -07:00
Nikita Sobolev 4fbf20605b
gh-110572: Remove `test_*` from `_testcapi/getargs.c` (GH-111214) 2023-10-24 08:50:11 +03:00
Radislav Chugunov 47d3e2ed93
gh-109894: Fix initialization of static `MemoryError` in subinterpreter (gh-110911)
Fixes #109894

* set `interp.static_objects.last_resort_memory_error.args` to empty tuple to avoid crash on `PyErr_Display()` call
* allow `_PyExc_InitGlobalObjects()` to be called on subinterpreter init

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-10-23 17:06:59 -06:00
hetmankp 3726cb0f14
gh-105931: Fix surprising compileall stripdir behaviour (GH-108671)
Before, the '-s STRIPDIR' option on
compileall lead to some surprising results as it only strips away
path components that match, but leaves alone the non-matching ones
interspersed in between.

For example, with: python -m compileall -s/path/to/another/src
/path/to/build/src/file.py

The resulting written path will be: build/file.py

This fix only strips directories that are a fully matching prefix of the
source path. If a stripdir is provided that is not a valid prefix, a
warning will be displayed (which can be silenced with '-qq').
2023-10-23 13:55:39 +00:00
Mark Shannon 52e902ccf0
GH-109369: Add machinery for deoptimizing tier2 executors, both individually and globally. (GH-110384) 2023-10-23 14:49:09 +01:00
Tian Gao 767f416feb
gh-110196: Fix ipaddress.IPv6Address.__reduce__ (GH-110198) 2023-10-22 21:50:51 +03:00
Serhiy Storchaka 6c23635f2b
gh-111085: Fix invalid state handling in TaskGroup and Timeout (#111111)
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).

Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
2023-10-21 22:18:34 +03:00
Nikita Sobolev fd60549c0a
gh-111159: Fix `doctest` output comparison for exceptions with notes (#111160) 2023-10-21 19:02:00 +01:00
Nikita Sobolev 5e7727b052
gh-111157: Mention `__notes__` in `traceback.format_exception_only` docstring (#111158) 2023-10-21 15:30:14 +00:00
Serhiy Storchaka 9a1fe09622
gh-110918: regrtest: allow to intermix --match and --ignore options (GH-110919)
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.
2023-10-21 17:44:46 +03:00
Irit Katriel b578e51f02
gh-111123: symtable should visit exception handlers before the else block (#111142) 2023-10-21 13:38:29 +01:00
Nikita Sobolev e136e2d640
gh-111155: Fix direct invocation of test_pprint (GH-111156) 2023-10-21 15:09:01 +03:00
Nikita Sobolev 86276fe4f8
gh-110974: Make sure all test_zoneinfo tests are collected (GH-110975)
Test classes from the test_zoneinfo submodule were overridden by
test classes from the test_zoneinfo_property submodule with the same name.
2023-10-21 14:26:03 +03:00
Victor Stinner 7237fb578d
gh-110932: Fix regrtest for SOURCE_DATE_EPOCH (#111143)
If the SOURCE_DATE_EPOCH environment variable is defined, use its
value as the random seed.
2023-10-21 10:37:48 +02:00
Nikita Sobolev 124259f9b3
gh-111132: Fix crash on interactive_filename in `run_mod` (#111136) 2023-10-20 21:31:26 +01:00
Nikita Sobolev ea7c26e4b8
gh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing` (#111127) 2023-10-20 18:03:32 +00:00
Victor Stinner d8f32be5b6
gh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)
Add PyUnicode_AsUTF8() function to the limited C API.

multiprocessing posixshmem now uses PyUnicode_AsUTF8() instead of
PyUnicode_AsUTF8AndSize(): the extension is built with the limited C
API. The function now raises an exception if the filename contains an
embedded null character instead of truncating silently the filename.
2023-10-20 19:29:27 +02:00
Victor Stinner d731579bfb
gh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (#111091)
* PyUnicode_AsUTF8() now raises an exception if the string contains
  embedded null characters.
* Update related C API tests (test_capi.test_unicode).
* type_new_set_doc() uses PyUnicode_AsUTF8AndSize() to silently
  truncate doc containing null bytes.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-20 17:59:29 +02:00
Serhiy Storchaka ff4e53cb74
Synchronize test_contextlib with test_contextlib_async (GH-111000) 2023-10-20 17:07:14 +03:00
Serhiy Storchaka b60f058708
Add tests for failing PyUnicode_AsUTF8AndSize() with psize=NULL (GH-111100) 2023-10-20 12:54:00 +03:00
Terry Jan Reedy b802882fb2
gh-111092: Make turtledemo run without default root enabled (#111093)
Add missing 'root' argument to PanedWindow call.
Other root children already have it.
2023-10-19 23:58:41 -04:00
Furkan Onder 9376728ce4
gh-67565: Add tests for C-contiguity checks (GH-110951) 2023-10-20 01:09:57 +03:00
sc07kvm 677d4bc15e
Remove unnecessary while in SocketIO.readinto (GH-111057)
It is unnecessary after removing "continue" in 6e6c59b (bpo-42357).
2023-10-20 00:26:30 +03:00
Eric Snow d23a2f9887
gh-76785: Make interpreters.*Channel Objects Shareable (gh-110607)
This restores their shareability, which was disabled by gh-110318 due to ref leaks.
2023-10-19 08:52:02 -06:00
Eric Snow 6741d5af32
gh-76785: Add *Channel.is_closed (gh-110606) 2023-10-19 08:51:21 -06:00
Nikita Sobolev e9b5399bee
gh-111031: Check more files in `test_tokenize` (#111032) 2023-10-19 09:29:45 +01:00
Terry Jan Reedy 642eb8df95
gh-111050: IDLE - Simplify configdialog.HighPage.theme_elements (#111053)
Replace tuple value with internal name, removing numbers.
Remove sorting of already ordered dislay names.
Remove '[0]' indexing into now-gone tuple.
2023-10-19 00:03:24 -04:00
Nikita Sobolev 94495d0387
Fix a misspelling of Interpeter -> Interpreter (GH-111040) 2023-10-18 15:09:45 -07:00
Tian Gao e6eb8cafca
GH-102895 Add an option local_exit in code.interact to block exit() from terminating the whole process (GH-102896) 2023-10-18 11:36:43 -07:00
Shantanu 3156d193b8
gh-100445: Improve error message for unterminated strings with escapes (#100446) 2023-10-18 13:58:51 +01:00
Terry Jan Reedy baefbb21d9
gh-103737: IDLE - Remove unneeded .keys() for dict iteration (#110960)
Add comments where .keys() is needed.
Leave debugger usages along because situation is unclear as indicated in expanded comment.
Most testing is manual.
2023-10-18 04:14:52 -04:00
James 77dbd95609
gh-111019: Align expected and actual titles in test output (#111020)
Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
2023-10-18 08:36:16 +01:00
Charles Machalow 738574fb21
gh-108747: Add unit tests for site.{usercustomize,sitecustomize} hooks (#109470) 2023-10-17 22:05:41 -07:00