summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* gh-108303: Move `zip` and `tar` archives to `Lib/test/archivetestdata` (#111549)Nikita Sobolev2023-11-0413-21/+22
|
* gh-111159: Fix `SyntaxError` doctests for non-builtin exception classes ↵Nikita Sobolev2023-11-042-1/+23
| | | | (#111541)
* gh-111495: Test C API functions with extreme sizes and indices (GH-111631)Serhiy Storchaka2023-11-044-40/+134
|
* gh-111644: Fix asyncio test_unhandled_exceptions() (#111713)Victor Stinner2023-11-041-2/+3
| | | | | | | | | Fix test_unhandled_exceptions() of test_asyncio.test_streams: break explicitly a reference cycle. Fix also StreamTests.tearDown(): the loop must not be closed explicitly, but using set_event_loop() which takes care of shutting down the executor with executor.shutdown(wait=True). BaseEventLoop.close() calls executor.shutdown(wait=False).
* gh-111644: Fix support threading_cleanup() (#111714)Victor Stinner2023-11-041-25/+28
| | | | | | | | | | | | | Copy the list of dangling threads to make sure that the list of "Dangling thread" is complete. Previously, the list was incomplete if threads completed just before the list was displayed. Changes: * Rewrite the warning to make it easier to understand. * Use support.sleeping_retry(). * threading_cleanup() no longer copies threading._dangling, but only counts the number of dangling thread. * Remove support.gc_support() call.
* gh-109649: Fix test_os.test_process_cpu_count_affinity() (#111689)Victor Stinner2023-11-031-4/+4
| | | | | | | | | | When CPUs are isolated on Linux, os.process_cpu_count() is smaller than os.cpu_count(). Fix the test for this case. Example with "isolcpus=5,11 rcu_nocbs=5,11" options passed to a Linux command line to isolated two logical CPUs: $ ./python -c 'import os; print(os.process_cpu_count(), "/", os.cpu_count())' 10 / 12
* gh-111506: Implement Py_SET_REFCNT() as opaque function in limited C API ↵Victor Stinner2023-11-031-0/+1
| | | | | | | | (#111508) In the limited C API version 3.13, Py_SET_REFCNT() function is now implemented as an opaque function call. Add _Py_SetRefcnt() to the stable ABI.
* gh-103615: Use local events for opcode tracing (GH-109472)Tian Gao2023-11-031-0/+37
| | | | | | | * Use local monitoring for opcode trace * Remove f_opcode_trace_set * Add test for setting f_trace_opcodes after settrace
* gh-111681: minor fixes to typing doctests; remove unused imports in ↵Nikita Sobolev2023-11-031-3/+2
| | | | | `test_typing` (#111682) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and ↵Irit Katriel2023-11-033-213/+214
| | | | frame state (#111648)
* gh-111490: Make the exception type check in test_pyexpat more specific ↵Nikita Sobolev2023-11-031-1/+1
| | | | (GH-111491)
* gh-108082: Remove _PyErr_WriteUnraisableMsg() (GH-111643)Serhiy Storchaka2023-11-036-55/+71
| | | | Replace the remaining calls with PyErr_FormatUnraisable().
* gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF (#111655)AN Long2023-11-031-0/+7
|
* gh-110892: Return NULL for `PyTrace_RETURN` events caused by an exception ↵Tian Gao2023-11-021-12/+17
| | | | (GH-110909)
* gh-111625: Fix link to Info-ZIP homepage (#111626)partev2023-11-021-2/+2
|
* gh-111354: simplify detection of RESUME after YIELD_VALUE at except-depth 1 ↵Irit Katriel2023-11-023-214/+215
| | | | (#111459)
* gh-108082: Use PyErr_FormatUnraisable() (GH-111580)Serhiy Storchaka2023-11-022-8/+17
| | | | | | Replace most of calls of _PyErr_WriteUnraisableMsg() and some calls of PyErr_WriteUnraisable(NULL) with PyErr_FormatUnraisable(). Co-authored-by: Victor Stinner <vstinner@python.org>
* GH-110894: Call loop exception handler for exceptions in client_connected_cb ↵Kumar Aditya2023-11-022-0/+40
| | | | | (#111601) Call loop exception handler for exceptions in `client_connected_cb` of `asyncio.start_server` so that applications can handle it.
* GH-111435: Add Support for Sharing True and False Between Interpreters ↵Anthony Shaw2023-11-022-4/+7
| | | | | (gh-111436) This only affects users of the APIs in pycore_crossinterp.h (AKA _xxsubinterpretersmodule.c and _xxinterpchannels.c).
* gh-76785: Crossinterp utils additions (gh-111530)Eric Snow2023-11-011-1/+1
| | | | | | | | | | | | This moves several general internal APIs out of _xxsubinterpretersmodule.c and into the new Python/crossinterp.c (and the corresponding internal headers). Specifically: * _Py_excinfo, etc.: the initial implementation for non-object exception snapshots (in pycore_pyerrors.h and Python/errors.c) * _PyXI_exception_info, etc.: helpers for passing an exception beween interpreters (wraps _Py_excinfo) * _PyXI_namespace, etc.: helpers for copying a dict of attrs between interpreters * _PyXI_Enter(), _PyXI_Exit(): functions that abstract out the transitions between one interpreter and a second that will do some work temporarily Again, these were all abstracted out of _xxsubinterpretersmodule.c as generalizations. I plan on proposing these as public API at some point.
* gh-106718: Treat PyConfig.stdlib_dir as highest-priority setting for ↵Yilei Yang2023-11-011-0/+14
| | | | stdlib_dir when calculating paths (GH-108730)
* gh-111374: Add a new PYTHON_FROZEN_MODULES env var, equivalent of `-X ↵Yilei Yang2023-11-011-0/+11
| | | | | | | frozen_modules`. (#111411) Adds a new PYTHON_FROZEN_MODULES env var to correspond with -X frozen_modules. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-111520: Integrate the Tier 2 interpreter in the Tier 1 interpreter (#111428)Guido van Rossum2023-11-012-5/+14
| | | | | | | | | | | - There is no longer a separate Python/executor.c file. - Conventions in Python/bytecodes.c are slightly different -- don't use `goto error`, you must use `GOTO_ERROR(error)` (same for others like `unused_local_error`). - The `TIER_ONE` and `TIER_TWO` symbols are only valid in the generated (.c.h) files. - In Lib/test/support/__init__.py, `Py_C_RECURSION_LIMIT` is imported from `_testcapi`. - On Windows, in debug mode, stack allocation grows from 8MiB to 12MiB. - **Beware!** This changes the env vars to enable uops and their debugging to `PYTHON_UOPS` and `PYTHON_LLTRACE`.
* gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496)Serhiy Storchaka2023-11-013-1/+381
|
* GH-111485: Use micro-ops to split specialization code from base action ↵Mark Shannon2023-11-011-1/+1
| | | | (GH-111561)
* gh-110367: Make regrtest --verbose3 compatible with --huntrleaks -jN (#111577)Victor Stinner2023-11-012-2/+31
| | | | | "./python -m test -j1 -R 3:3 --verbose3" now works as expected, since run_single_test() does not replace sys.stdout with StringIO in this case.
* gh-110774: allow setting the Runner(loop_factory=...) from ↵Thomas Grainger2023-10-312-2/+19
| | | | | | | IsolatedAsyncioTestCase (#110776) Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-108082: Add PyErr_FormatUnraisable() function (GH-111086)Serhiy Storchaka2023-10-311-0/+57
|
* gh-111420: Allow type comments in parenthesized `with` statements (#111468)Tomas R2023-10-312-0/+20
|
* GH-111438: Add Support for Sharing Floats Between Interpreters (gh-111439)Anthony Shaw2023-10-312-2/+5
| | | This only affects users of the APIs in pycore_crossinterp.h (AKA _xxsubinterpretersmodule.c and _xxinterpchannels.c).
* GH-111485: Increment `next_instr` consistently at the start of the ↵Mark Shannon2023-10-312-17/+91
| | | | instruction. (GH-111486)
* gh-111531: Tkinter: fix reference leaks in bind_class() and bind_all() ↵Serhiy Storchaka2023-10-311-2/+2
| | | | (GH-111533)
* gh-76785: Move the Cross-Interpreter Code to Its Own File (gh-111502)Eric Snow2023-10-301-6/+6
| | | This is partly to clear this stuff out of pystate.c, but also in preparation for moving some code out of _xxsubinterpretersmodule.c. This change also moves this stuff to the internal API (new: Include/internal/pycore_crossinterp.h). @vstinner did this previously and I undid it. Now I'm re-doing it. :/
* gh-110697: Use CLOCK_RES in test_os.TimerfdTests (#111529)Victor Stinner2023-10-301-6/+6
| | | | More TimerfdTests tests tolerate a difference of 1 ms in measured elapsed time.
* gh-111181: Fix enum doctests (GH-111180)Nikita Sobolev2023-10-302-12/+16
| | | Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* gh-111366: Correctly show custom syntax error messages in the codeop module ↵Pablo Galindo Salgado2023-10-302-5/+27
| | | | functions (#111384)
* gh-111284: Make multiprocessing tests with threads faster and more reliable ↵Serhiy Storchaka2023-10-301-9/+21
| | | | (GH-111285)
* gh-108082: C API: Add tests for PyErr_WriteUnraisable() (GH-111455)Serhiy Storchaka2023-10-301-0/+45
| | | | Also document the behavior when called with NULL.
* gh-110481: Implement biased reference counting (gh-110764)Sam Gross2023-10-301-1/+4
|
* gh-90815: Add mimalloc memory allocator (#109914)Dino Viehland2023-10-303-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add mimalloc v2.12 Modified src/alloc.c to remove include of alloc-override.c and not compile new handler. Did not include the following files: - include/mimalloc-new-delete.h - include/mimalloc-override.h - src/alloc-override-osx.c - src/alloc-override.c - src/static.c - src/region.c mimalloc is thread safe and shares a single heap across all runtimes, therefore finalization and getting global allocated blocks across all runtimes is different. * mimalloc: minimal changes for use in Python: - remove debug spam for freeing large allocations - use same bytes (0xDD) for freed allocations in CPython and mimalloc This is important for the test_capi debug memory tests * Don't export mimalloc symbol in libpython. * Enable mimalloc as Python allocator option. * Add mimalloc MIT license. * Log mimalloc in Lib/test/pythoninfo.py. * Document new mimalloc support. * Use macro defs for exports as done in: https://github.com/python/cpython/pull/31164/ Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-111347: Remove wrong assertion in test_sendfile (#111377)zcxsythenew2023-10-291-2/+5
| | | Windows is different.
* gh-94808: Add coverage test for number check (gh-111445)Evan Kohilas2023-10-291-0/+7
|
* gh-66425: Remove the unreachable code to set `REMOTE_HOST` header (gh-111441)c-bata2023-10-291-4/+0
|
* gh-111426: Remove `test_cmd.test_coverage` (#111427)Nikita Sobolev2023-10-281-11/+1
|
* GH-110109: Move tests for `pathlib.Path.walk()` into main test classes. ↵Barney Gale2023-10-281-169/+169
| | | | (#110655)
* gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-111336)Guido van Rossum2023-10-282-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Try to fix asyncio.Server.wait_closed() again I identified the condition that `wait_closed()` is intended to wait for: the server is closed *and* there are no more active connections. When this condition first becomes true, `_wakeup()` is called (either from `close()` or from `_detach()`) and it sets `_waiters` to `None`. So we just check for `self._waiters is None`; if it's not `None`, we know we have to wait, and do so. A problem was that the new test introduced in 3.12 explicitly tested that `wait_closed()` returns immediately when the server is *not* closed but there are currently no active connections. This was a mistake (probably a misunderstanding of the intended semantics). I've fixed the test, and added a separate test that checks exactly for this scenario. I also fixed an oddity where in `_wakeup()` the result of the waiter was set to the waiter itself. This result is not used anywhere and I changed this to `None`, to avoid a GC cycle. * Update Lib/asyncio/base_events.py --------- Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-111342: fix typo in math.sumprod (GH-111416)Sergey B Kirpichev2023-10-281-0/+1
|
* gh-110205: Fix asyncio ThreadedChildWatcher._join_threads() (#110884)Guido van Rossum2023-10-272-12/+10
| | | | | - `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything. - Threads created by that class are now named `asyncio-waitpid-NNN`. - `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`.
* gh-59013: Make line number of function breakpoint more precise (#110582)Tian Gao2023-10-272-3/+62
|
* gh-111388: Add `show_group` parameter to `traceback.format_exception_only` ↵Nikita Sobolev2023-10-272-7/+175
| | | | (#111390)