| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
| |
Fix name of the Python encoding in Unicode errors of the code page
codec: use "cp65000" and "cp65001" instead of "CP_UTF7" and "CP_UTF8"
which are not valid Python code names.
|
| |
|
|
|
| |
Replace private _Py_GetConfig() with public PyConfig_Get().
Remove also explicit PyRuntime initialization, it's not needed.
|
| |
|
|
| |
correct exception handler (#137310)
|
| |
|
|
|
| |
Replacing the slot isn't thread-safe if the GIL is disabled. Don't
require that the slot has been replaced when specializing.
|
| |
|
|
|
|
| |
Default implementation of sys.unraisablehook() now uses traceback._print_exception_bltin() to print exceptions with colorized text.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
| |
This is required so we would never have empty node bodies.
Refs #130087
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Call backtrace() once when installing the signal handler to ensure that
libgcc is dynamically loaded outside the signal handler.
This fixes a "signal-unsafe call inside of a signal" TSan error from
test_faulthandler.test_enable_fd.
|
| |
|
|
| |
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| |
|
|
|
| |
(#137062)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
|
| | |
|
| |
|
| |
De-instrumenting code objects modifies the thread local bytecode for all threads as such, holding the critical section on the code object is not sufficient and leads to data races. Now, the de-instrumentation is now performed under a stop the world pause as such no thread races with executing the thread local bytecode while it is being de-instrumented.
|
| |
|
|
| |
`Py_STATS` builds (#137055)
|
| |
|
|
|
| |
gh-136461 added perf support for macOS, with ifdefs around all changes
except increasing thread_id to 64 bits.
Make that change Apple-specific too.
|
| | |
|
| |
|
|
| |
(GH-121303)" (#136991)
|
| |
|
|
|
| |
If there is an error, we have to return `-errno` not positive errno.
Included in backport of GH-136931: #136988
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Basic support for pyrepl in Emscripten. Limitations:
* requires JSPI
* no signal handling implemented
As followup work, it would be nice to implement a webworker variant
for when JSPI is not available and proper signal handling.
Because it requires JSPI, it doesn't work in Safari. Firefox requires
setting an experimental flag. All the Chromiums have full support since
May. Until we make it work without JSPI, let's keep the original web_example
around.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Éric <merwok@netwok.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the following APIs public:
* `Py_BEGIN_CRITICAL_SECTION_MUTEX(mutex),`
* `Py_BEGIN_CRITICAL_SECTION2_MUTEX(mutex1, mutex2)`
* `void PyCriticalSection_BeginMutex(PyCriticalSection *c, PyMutex *mutex)`
* `void PyCriticalSection2_BeginMutex(PyCriticalSection2 *c, PyMutex *mutex1, PyMutex *mutex2)`
The macros are identical to the corresponding `Py_BEGIN_CRITICAL_SECTION` and
`Py_BEGIN_CRITICAL_SECTION2` macros (e.g., they include braces), but they
accept a `PyMutex` instead of an object.
The new macros are still paired with the existing END macros
(`Py_END_CRITICAL_SECTION`, `Py_END_CRITICAL_SECTION2`).
|
| |
|
|
|
| |
(#136951)
In free-threading, multiple threads can be cleared concurrently as such the modifications on `sys_tracing_threads` should be done while holding the profile lock, otherwise it can race with other threads setting up profiling.
|
| |
|
|
|
| |
(GH-136583)
`_datetime` is a special module, because it's the only non-builtin C extension that contains static types. As such, it would initialize static types in the module's execution function, which can run concurrently. Since static type initialization is not thread-safe, this caused crashes. This fixes it by moving the initialization of `_datetime`'s static types to interpreter startup (where all other static types are initialized), which is already properly protected through other locks.
|
| |
|
| |
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
|
| |
|
|
|
|
| |
(#134415)
Since `PyLong_From Long(PY_MONITORING_DEBUGGER_ID)` falls to `small_int` case and can't return `NULL`. Added `assert`s for extra confidence.
https://github.com/python/cpython/issues/134411#issuecomment-2897653868
|
| |
|
|
|
|
|
| |
(#135996)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
| |
|
|
| |
(#136837)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is useful for implementing proper `input()`. It requires the
JavaScript engine to support the wasm JSPI spec which is now stage 4.
It is supported on Chrome since version 137 and on Firefox and node
behind a flag.
We override the `__wasi_fd_read()` syscall with our own variant that
checks for a readAsync operation. If it has it, we use our own async
variant of `fd_read()`, otherwise we use the original `fd_read()`.
We also add a variant of `FS.createDevice()` called
`FS.createAsyncInputDevice()`.
Finally, if JSPI is available, we wrap the `main()` symbol with
`WebAssembly.promising()` so that we can stack switch from `fd_read()`.
If JSPI is not available, attempting to read from an AsyncInputDevice
will raise an `OSError`.
|
| |
|
|
| |
Provide a stub implementation of umask that is enough to get some tests passing.
More work is needed upstream in Emscripten to make all umask tests to pass.
|
| |
|
|
| |
Corrects the handling of getuid on emscripten, which was consistently reporting as 0.
|
| |
|
|
|
|
| |
This helps catch double deallocation bugs and is similar to the
assertion in the GIL-enabled build. The call to `validate_refcounts`
is moved up to start of the GC because `queue_untracked_obj_decref()`
creates it own zero reference count garbage.
|
| |
|
| |
Co-authored-by: Victor Stinner <vstinner@python.org>
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
(GH-135288)
Change the names of the symbol tables for lambda expressions and generator
expressions to "<lambda>" and "<genexpr>" respectively to avoid conflicts
with user-defined names.
|
| |
|
|
|
|
|
|
|
|
| |
PyArg_Parse (GH-132630)
For unsigned integer formats in the PyArg_Parse* functions,
accepting Python integers with value that is larger than
the maximal value the corresponding C type or less than
the minimal value for the corresponding signed integer type
is now deprecated.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
(#136500)
This commit fixes the following problems:
* The x86_64 trampolines are not preserving frame pointers
* The hardcoded offsets to the code segment from the FDE only worked properly for x64_64
* The CIE data was not following conventions of aarch64
* The eh_frame for aarch64 was not fully correct
|
| |
|
|
| |
(#136518)
|
| |
|
|
|
|
|
|
| |
Implement a statistical sampling profiler that can profile external
Python processes by PID. Uses the _remote_debugging module and converts
the results to pstats-compatible format for analysis.
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|
| |
|
| |
gh-91048: Reintroduce the memory cache for remote debugging
|
| |
|
|
|
| |
Weakrefs to unreachable garbage that are created during running of
finalizers need to be cleared. This avoids exposing objects that
have `tp_clear` called on them to Python-level code.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
`_STORE_ATTR_WITH_HINT` (#136249)
|
| | |
|
| | |
|
| |
|
|
|
| |
The `PyMutex_IsLocked()` function is useful in assertions for verifying
that code maintains certain locking invariants.
|
| |
|
|
| |
This moves the deprecation warning from compile time to run time.
|
| | |
|