Commit graph

119651 commits

Author SHA1 Message Date
Serhiy Storchaka 970e719a7a
gh-108082: Use PyErr_FormatUnraisable() (GH-111580)
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>
2023-11-02 09:16:34 +00:00
Serhiy Storchaka a12f624a9d
Remove unnecessary includes (GH-111633) 2023-11-02 10:42:58 +02:00
Kumar Aditya 229f44d353
GH-110894: Call loop exception handler for exceptions in client_connected_cb (#111601)
Call loop exception handler for exceptions in `client_connected_cb` of `asyncio.start_server` so that applications can handle it.
2023-11-02 07:38:18 +00:00
Ayappan Perumal 794dff2fb1
gh-111544: Fix mimalloc build on AIX (#111593) 2023-11-02 08:01:50 +01:00
Anthony Shaw 230e8e924d
GH-111435: Add Support for Sharing True and False Between Interpreters (gh-111436)
This only affects users of the APIs in pycore_crossinterp.h (AKA _xxsubinterpretersmodule.c and _xxinterpchannels.c).
2023-11-02 00:09:01 +00:00
Eric Snow 9322ce90ac
gh-76785: Crossinterp utils additions (gh-111530)
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.
2023-11-01 17:36:40 -06:00
Victor Stinner cde1071b2a
gh-111089: Use PyUnicode_AsUTF8() in getargs.c (#111620)
Replace PyUnicode_AsUTF8AndSize() with PyUnicode_AsUTF8() to remove
the explicit check for embedded null characters.
2023-11-02 00:13:55 +01:00
Guido van Rossum ff3b0a6938
High level docs for the VM state (#111621) 2023-11-01 22:55:10 +00:00
Guido van Rossum e4b37835ef
GH-111485: Silence warnings in Python/executor_cases.c.h (#111619) 2023-11-01 14:24:52 -07:00
Yilei Yang 834b7c18d7
gh-106718: Treat PyConfig.stdlib_dir as highest-priority setting for stdlib_dir when calculating paths (GH-108730) 2023-11-01 21:11:18 +00:00
Victor Stinner 821a7ac493
gh-106168: Update PyList_SET_ITEM() What's New doc (#111618) 2023-11-01 21:46:10 +01:00
Yilei Yang 45a36d5f56
gh-111374: Add a new PYTHON_FROZEN_MODULES env var, equivalent of -X 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>
2023-11-01 20:39:31 +00:00
Guido van Rossum 7e135a48d6
gh-111520: Integrate the Tier 2 interpreter in the Tier 1 interpreter (#111428)
- 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`.
2023-11-01 13:13:02 -07:00
Serhiy Storchaka 5d6db168b9
Simplify trivial calls of PyUnicode_FromFormat() (GH-111605) 2023-11-01 19:54:32 +02:00
Victor Stinner d9b606b3d0
gh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (#111585)
Replace PyUnicode_AsUTF8AndSize() with PyUnicode_AsUTF8() to remove
the explicit check for embedded null characters.

The change avoids to have to include explicitly <string.h> to get the
strlen() function when using a recent version of the limited C API.
2023-11-01 16:34:42 +01:00
Serhiy Storchaka 97b3cd38d1
gh-111495: Add tests for PyBytes and PyByteArray C API (GH-111496) 2023-11-01 17:31:07 +02:00
Serhiy Storchaka 937872e8ea
Simplify _PyPegen_join_names_with_dot() (GH-111602) 2023-11-01 16:25:36 +02:00
Mark Shannon 5697fc2d4b
GH-111537: Avoid using this_instr in asserts. (GH-111600) 2023-11-01 12:59:08 +00:00
Mark Shannon b14e882428
GH-111485: Use micro-ops to split specialization code from base action (GH-111561) 2023-11-01 10:53:27 +00:00
Serhiy Storchaka eaf67e37a2
gh-111576: Improve documention for tkinter.messagebox (GH-111578) 2023-11-01 12:27:02 +02:00
Sergey B Kirpichev 33ed5fa69d
gh-111495: add stub files for C API test modules (GH-111586)
This is to reduce merge conflicts (Modules/Setup.stdlib.in) for
subsequent pull requests for the issue.
2023-11-01 07:44:54 +02:00
Victor Stinner d9a5530d23
gh-110367: Make regrtest --verbose3 compatible with --huntrleaks -jN (#111577)
"./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.
2023-11-01 04:28:55 +01:00
Victor Stinner ef83b3fc00
gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED was added to 3.12 (#111584) 2023-11-01 04:24:33 +01:00
Krzysiek Karbowiak 102685c4c8
gh-111282: Fix NamedTemporaryFile example code (GH-111283) 2023-10-31 17:06:02 -05:00
Thomas Grainger 770530679e
gh-110774: allow setting the Runner(loop_factory=...) from IsolatedAsyncioTestCase (#110776)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2023-10-31 15:03:54 -07:00
Serhiy Storchaka f6a02327b5
gh-108082: Add PyErr_FormatUnraisable() function (GH-111086) 2023-10-31 23:42:44 +02:00
Tomas R 453e96e302
gh-111420: Allow type comments in parenthesized with statements (#111468) 2023-10-31 21:02:42 +00:00
Victor Stinner faa5f6053d
gh-108765: Python.h no longer includes <stddef.h> on Windows (#111563)
In practice, only Windows is impacted, because the HAVE_STDDEF_H
macro was only defined on Windows.
2023-10-31 21:53:57 +01:00
Dino Viehland c42347d025
gh-90815: Exclude mimalloc .c files from Windows build (#111532)
* Don't include mimalloc .c's in Windows build
* Fix warnings on Windows related to mimalloc
2023-10-31 11:54:35 -07:00
Quentin Peter 2445673983
gh-102249: Expand sys.call_tracing documentation (#102806)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-10-31 16:24:54 +00:00
Prometheus3375 5cc6c80a77
gh-93607: document root attribute of iterparse (#99410)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-31 16:16:55 +00:00
xzmeng cf3dbe4c3d
gh-106861: Docs: Add availability directives to all Unix-only modules (#108975) 2023-10-31 18:14:27 +02:00
Hugo van Kemenade 52a5b5d276
gh-111062: CI: Rename reusable-build-[X].yml to reusable-[X].yml (#111552) 2023-10-31 15:55:17 +00:00
Pablo Galindo Salgado abb15420c1
gh-109181: Speed up Traceback object creation by lazily compute the line number (#111548)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2023-10-31 15:02:31 +00:00
Anthony Shaw ad6380bc34
GH-111438: Add Support for Sharing Floats Between Interpreters (gh-111439)
This only affects users of the APIs in pycore_crossinterp.h (AKA _xxsubinterpretersmodule.c and _xxinterpchannels.c).
2023-10-31 08:17:20 -06:00
Mark Shannon 2904d99839
GH-111485: Remove some special cases from the code generator and bytecodes.c (GH-111540) 2023-10-31 13:21:07 +00:00
Mark Shannon d27acd4461
GH-111485: Increment next_instr consistently at the start of the instruction. (GH-111486) 2023-10-31 10:09:54 +00:00
Serhiy Storchaka e3353c498d
gh-111531: Tkinter: fix reference leaks in bind_class() and bind_all() (GH-111533) 2023-10-31 08:48:52 +02:00
Karolina Surma 3dbaed3caa
gh-111301: Move importlib.resources changes to the Removed section (#111509) 2023-10-31 06:46:20 +00:00
Karolina Surma 9976834356
gh-111301: Move importlib.resources.files change to What's new in Python 3.12 (#111512) 2023-10-31 06:01:00 +00:00
Hugo van Kemenade 173d13bb1f
gh-111062 CI: Update skip lists for resuable workflows (#111521)
CI: Update skip lists
2023-10-31 07:49:15 +02:00
Michael Droettboom 9495bcaf59
gh-111277: In summarize_stats.py, don't fail fast on invalid ratios (#111278) 2023-10-30 17:10:07 -07:00
Michael Droettboom 84b4533e84
gh-109329: Count tier2 opcode misses (#110561)
This keeps a separate 'miss' counter for each micro-opcode, incremented whenever a guard uop takes a deoptimization side exit.
2023-10-30 17:02:45 -07:00
Eric Snow c6fe0869ab
gh-76785: Move the Cross-Interpreter Code to Its Own File (gh-111502)
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. :/
2023-10-30 16:53:10 -06:00
Victor Stinner 7b153d14ef
gh-110697: Use CLOCK_RES in test_os.TimerfdTests (#111529)
More TimerfdTests tests tolerate a difference of 1 ms in measured
elapsed time.
2023-10-30 22:47:59 +00:00
Victor Stinner 801741ff81
gh-90815: Fix mimalloc atomic.h on Windows arm64 (#111527)
mi_atomic_load_explicit() casts 'p' argument to drop the 'const'
qualifier on Windows arm64 platform. Fix the compiler warning:

    'function': different 'const' qualifiers
    (compiling source file ..\Objects\mimalloc\options.c)
2023-10-30 22:33:49 +00:00
Victor Stinner 1673e44017
gh-90815: Fix mimalloc build on WASI (#111524)
Include <unistd.h> to get sbrk() function.
2023-10-30 23:10:22 +01:00
Victor Stinner da4d3142a2
gh-90815: Fix _PyMem_MimallocEnabled() compiler warning (#111522)
Don't declare _PyMem_MimallocEnabled() if WITH_PYMALLOC macro is not
defined (./configure --without-pymalloc).

Fix also a typo in _PyInterpreterState_FinalizeAllocatedBlocks().
2023-10-30 23:05:49 +01:00
Ken Jin 804a207c16
Remove myself from typing CODEOWNERS (#111523) 2023-10-30 21:08:26 +00:00
Nikita Sobolev c4dc5a6ae8
gh-111181: Fix enum doctests (GH-111180)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-10-30 12:56:29 -07:00