summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-105866: fix dataclass with slots=True, weakref_slot=True (#105870)Aviel Boag2024-03-193-1/+15
| | | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-116869: Enable test_cext and test_cppext on Free Threading build (#116973)Victor Stinner2024-03-182-32/+19
| | | | Remove the "if Py_GIL_DISABLED" skip and move all "skip" decorators to the class. Use support.check_sanitizer()
* gh-116417: Fix WASI build of _testlimitedcapi (#116974)Victor Stinner2024-03-1810-24/+26
| | | | Use different function names between _testcapi and _testlimitedcapi to not confuse the WASI linker.
* gh-116941: Fix pyatomic_std.h syntax errors (#116967)Sam Gross2024-03-181-0/+2
|
* gh-116417: Move limited C API list.c tests to _testlimitedcapi (#116602)Victor Stinner2024-03-1811-351/+404
| | | | | Split list.c and set.c tests of _testcapi into two parts: limited C API tests in _testlimitedcapi and non-limited C API tests in _testcapi.
* gh-113538: Add asycio.Server.{close,abort}_clients (redo) (#116784)Pierre Ossman (ThinLinc team)2024-03-188-20/+152
| | | | | | | These give applications the option of more forcefully terminating client connections for asyncio servers. Useful when terminating a service and there is limited time to wait for clients to finish up their work. This is a do-over with a test fix for gh-114432, which was reverted.
* gh-116869: Make C API compatible with ISO C90 (#116950)Victor Stinner2024-03-183-3/+5
| | | | Make the C API compatible with -Werror=declaration-after-statement compiler flag again.
* gh-116869: Add test_cext test: build a C extension (#116954)Victor Stinner2024-03-185-0/+222
|
* gh-108716: Cleanup remaining deepfreeze infrastructure (#116919)Guido van Rossum2024-03-189-180/+7
| | | | | Keep Tools/build/deepfreeze.py around (we may repurpose it for deepfreezing non-code objects), and keep basic "clean" targets that remove the output of former deep-freeze activities, to keep the build directories of current devs clean.
* gh-116916: Remove separate next_func_version counter (#116918)Guido van Rossum2024-03-184-9/+7
| | | | | Somehow we ended up with two separate counter variables tracking "the next function version". Most likely this was a historical accident where an old branch was updated incorrectly. This PR merges the two counters into a single one: `interp->func_state.next_version`.
* Cleanup tier2 debug output (#116920)Guido van Rossum2024-03-185-22/+50
| | | Various tweaks, including a slight refactor of the special cases for `_PUSH_FRAME`/`_POP_FRAME` to show the actual operand emitted.
* gh-115119: Switch Windows build to mpdecimal external (GH-115182)Zachary Ware2024-03-187-63/+117
| | | | | This includes adding what should be a relatively temporary `Modules/_decimal/windows/mpdecimal.h` shim to choose between `mpdecimal32vc.h` or `mpdecimal64vc.h` based on which of `CONFIG_64` or `CONFIG_32` is defined.
* gh-115258: Fix hanging tests for threading queue shutdown (#115940)Duprat2024-03-181-61/+71
| | | | This reinstates `test_shutdown_immediate_all_methods_in_many_threads` and improves `test_shutdown_all_methods_in_many_threads`.
* gh-116869: Fix redefinition of the _PyOptimizerObject type (#116963)Victor Stinner2024-03-181-2/+2
| | | | | | | | | | | | | | | Defining a type twice is a C11 feature and so makes the C API incompatible with C99. Fix the issue by only defining the type once. Example of warning (treated as an error): In file included from Include/Python.h:122: Include/cpython/optimizer.h:77:3: error: redefinition of typedef '_PyOptimizerObject' is a C11 feature [-Werror,-Wtypedef-redefinition] } _PyOptimizerObject; ^ build/Include/cpython/optimizer.h:60:35: note: previous definition is here typedef struct _PyOptimizerObject _PyOptimizerObject; ^
* gh-63207: Use GetSystemTimePreciseAsFileTime() in time.time() (#116822)Victor Stinner2024-03-183-16/+32
|
* gh-116877: Update `wheel` to version `0.43.0` (#116878)Sam Gross2024-03-182-0/+0
|
* gh-71765: Fix inspect.getsource() on empty file (GH-20809)kernc2024-03-184-2/+23
| | | | | | | | | | | | * bpo-27578: Fix inspect.getsource() on empty file For modules from empty files, `inspect.getsource()` now returns an empty string, and `inspect.getsourcelines()` returns a list of one empty string, fixing the expected invariant. As indicated by `exec('')`, empty strings are valid Python source code. Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* Revert "gh-96844: Improve error message of list.remove (gh-106455)" (#116956)Victor Stinner2024-03-183-5/+5
| | | This reverts commit 217f47d6e5e56bca78b8556e910cd00890f6f84a.
* GH-65056: Improve the IP address' is_global/is_private documentation (GH-113186)Jakub Stasiak2024-03-182-17/+68
| | | | | | | | | * GH-65056: Improve the IP address' is_global/is_private documentation It wasn't clear what the semantics of is_global/is_private are and, when one gets to the bottom of it, it's not quite so simple (hence the exceptions listed). Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-115874: Don't use module state in teedataobject tp_dealloc (#116204)Erlend E. Aasland2024-03-182-6/+12
| | | Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* gh-115538: Emit warning when use bool as fd in _io.WindowsConsoleIO (GH-116925)AN Long2024-03-183-0/+15
|
* CI: Pass environment variables directly to configure in JIT CI (#116156)Erlend E. Aasland2024-03-181-6/+6
| | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-116664: Ensure thread-safe dict access in _warnings (#116768)Erlend E. Aasland2024-03-181-29/+32
| | | Replace _PyDict_GetItemWithError() with PyDict_GetItemRef().
* gh-116881: Remove erroneous or redundant grammar NULL (GH-116885)Terry Jan Reedy2024-03-181-1/+1
| | | | | | In Lexical Analysis f-strings section, NULL in the description of 'literal character' means '\0'. In the format_spec grammar production, it is wrong with that meaning and redundant if instead interpreted as <nothing>. Remove it there.
* Bump GitHub Actions (#116944)Hugo van Kemenade2024-03-183-3/+3
|
* gh-116915: Make `_thread._ThreadHandle` support GC (#116934)mpage2024-03-181-3/+13
| | | | | | Even though it has no internal references to Python objects it still has a reference to its type by virtue of being a heap type. We need to provide a traverse function that visits the type, but we do not need to provide a clear function.
* gh-85283: Build _statistics extension with the limited C API (#116927)Victor Stinner2024-03-174-37/+20
| | | | | Argument Clinic now inlines _PyArg_CheckPositional() for the limited C API. The generated code should be as fast or even a little bit faster.
* GH-116377: Stop raising `ValueError` from `glob.translate()`. (#116378)Barney Gale2024-03-174-26/+18
| | | | | Stop raising `ValueError` from `glob.translate()` when a `**` sub-string appears in a non-recursive pattern segment. This matches `glob.glob()` behaviour.
* gh-85283: Build termios extension with the limited C API (#116928)Victor Stinner2024-03-174-32/+42
|
* gh-73468: Add math.fma() function (#116667)Victor Stinner2024-03-176-1/+371
| | | | | | Added new math.fma() function, wrapping C99's ``fma()`` operation: fused multiply-add function. Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
* GH-112536: Add more TSan tests (#116911)Antoine Pitrou2024-03-172-2/+8
| | | | These may all exercise some non-trivial aspects of thread synchronization.
* gh-85287: Change codecs to raise precise UnicodeEncodeError and ↵John Sloboda2024-03-179-81/+306
| | | | | UnicodeDecodeError (#113674) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* Update titles and subtitles on landing page template (#116914)Carol Willing2024-03-171-31/+31
| | | | | | | | | * Update titles and subtitles on landing page template * address review from gvanrossum * Edits from hugovk review * Change word order back. Down the road we should split license and history
* gh-116809: Restore removed _PyErr_ChainExceptions1() function (#116900)Victor Stinner2024-03-163-3/+6
|
* CI: Process stale issues four times per day (#116857)Hugo van Kemenade2024-03-161-1/+1
|
* gh-116879: Add new optimizer pystats to tables (GH-116880)Michael Droettboom2024-03-161-4/+30
|
* gh-112536: Add more TSAN tests (#116896)Donghee Na2024-03-161-0/+2
| | | | | --------- Co-authored-by: Antoine Pitrou <antoine@python.org>
* gh-116851: Remove "from ctypes import *" from a ctypes example (GH-116852)jnchen2024-03-161-1/+0
| | | | It is confusing, because libc is not imported from ctypes, but defined in previous examples, which already contain the import.
* gh-114271: Fix race in `Thread.join()` (#114839)mpage2024-03-1612-639/+767
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a race between when `Thread._tstate_lock` is released[^1] in `Thread._wait_for_tstate_lock()` and when `Thread._stop()` asserts[^2] that it is unlocked. Consider the following execution involving threads A, B, and C: 1. A starts. 2. B joins A, blocking on its `_tstate_lock`. 3. C joins A, blocking on its `_tstate_lock`. 4. A finishes and releases its `_tstate_lock`. 5. B acquires A's `_tstate_lock` in `_wait_for_tstate_lock()`, releases it, but is swapped out before calling `_stop()`. 6. C is scheduled, acquires A's `_tstate_lock` in `_wait_for_tstate_lock()` but is swapped out before releasing it. 7. B is scheduled, calls `_stop()`, which asserts that A's `_tstate_lock` is not held. However, C holds it, so the assertion fails. The race can be reproduced[^3] by inserting sleeps at the appropriate points in the threading code. To do so, run the `repro_join_race.py` from the linked repo. There are two main parts to this PR: 1. `_tstate_lock` is replaced with an event that is attached to `PyThreadState`. The event is set by the runtime prior to the thread being cleared (in the same place that `_tstate_lock` was released). `Thread.join()` blocks waiting for the event to be set. 2. `_PyInterpreterState_WaitForThreads()` provides the ability to wait for all non-daemon threads to exit. To do so, an `is_daemon` predicate was added to `PyThreadState`. This field is set each time a thread is created. `threading._shutdown()` now calls into `_PyInterpreterState_WaitForThreads()` instead of waiting on `_tstate_lock`s. [^1]: https://github.com/python/cpython/blob/441affc9e7f419ef0b68f734505fa2f79fe653c7/Lib/threading.py#L1201 [^2]: https://github.com/python/cpython/blob/441affc9e7f419ef0b68f734505fa2f79fe653c7/Lib/threading.py#L1115 [^3]: https://github.com/mpage/cpython/commit/81946532792f938cd6f6ab4c4ff92a4edf61314f --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Antoine Pitrou <antoine@python.org>
* gh-112536: Add test_threading to TSAN tests (#116898)Antoine Pitrou2024-03-163-10/+19
|
* gh-116484: Fix collisions between Checkbutton and ttk.Checkbutton default ↵Serhiy Storchaka2024-03-163-2/+30
| | | | | | | | names (GH-116495) Change automatically generated tkinter.Checkbutton widget names to avoid collisions with automatically generated tkinter.ttk.Checkbutton widget names within the same parent widget.
* gh-116764: Fix regressions in urllib.parse.parse_qsl() (GH-116801)Serhiy Storchaka2024-03-163-1/+33
| | | | | | | | * Restore support of None and other false values. * Raise TypeError for non-zero integers and non-empty sequences. The regressions were introduced in gh-74668 (bdba8ef42b15e651dc23374a08143cc2b4c4657d).
* gh-90535: Fix support of interval>1 in logging.TimedRotatingFileHandler ↵Serhiy Storchaka2024-03-163-35/+173
| | | | | | | (GH-116220) Fix support of interval values > 1 in logging.TimedRotatingFileHandler for when='MIDNIGHT' and when='Wx'.
* gh-112536: Add TSAN builds on Github Actions (#116872)Donghee Na2024-03-166-0/+93
|
* gh-116858: Add `@cpython_only` to several tests in `test_cmd_line` (#116859)Nikita Sobolev2024-03-161-0/+10
|
* Minor kde() docstring nit: make presentation order match the function ↵Raymond Hettinger2024-03-151-1/+1
| | | | signature (#116876)
* GH-115802: Reduce the size of _INIT_CALL_PY_EXACT_ARGS. (GH-116856)Mark Shannon2024-03-153-72/+54
|
* gh-116868: Avoid locking in PyType_IsSubtype (#116829)Dino Viehland2024-03-151-32/+48
| | | Make PyType_IsSubType not acquire lock
* gh-112536: Add --tsan test for reasonable TSAN execution times. (gh-116601)Donghee Na2024-03-155-0/+39
|
* gh-116782: Mention `__type_params__` in `inspect.getmembers` docs (#116783)Nikita Sobolev2024-03-151-0/+10
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>