| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
(GH-123380)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
|
|
|
|
|
|
|
| |
gh-127572: Fix `test_structmembers` initialization.
The 'C' format code expects an `int` as a destination (not a `char`).
This led to test failures on big-endian platforms like s390x. Use the
'c' format code, which expects a `char` as the destination (but requires
a Python byte objects instead of a str).
|
|
|
|
| |
Adjusts some Emscripten test exclusions regarding strftime, fma, and stack depth.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
builds (#127123)
The CALL family of instructions were mostly thread-safe already and only required a small number of changes, which are documented below.
A few changes were needed to make CALL_ALLOC_AND_ENTER_INIT thread-safe:
Added _PyType_LookupRefAndVersion, which returns the type version corresponding to the returned ref.
Added _PyType_CacheInitForSpecialization, which takes an init method and the corresponding type version and only populates the specialization cache if the current type version matches the supplied version. This prevents potentially caching a stale value in free-threaded builds if we race with an update to __init__.
Only cache __init__ functions that are deferred in free-threaded builds. This ensures that the reference to __init__ that is stored in the specialization cache is valid if the type version guard in _CHECK_AND_ALLOCATE_OBJECT passes.
Fix a bug in _CREATE_INIT_FRAME where the frame is pushed to the stack on failure.
A few other miscellaneous changes were also needed:
Use {LOCK,UNLOCK}_OBJECT in LIST_APPEND. This ensures that the list's per-object lock is held while we are appending to it.
Add missing co_tlbc for _Py_InitCleanup.
Stop/start the world around setting the eval frame hook. This allows us to read interp->eval_frame non-atomically and preserves the behavior of _CHECK_PEP_523 documented below.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Replace uses of `PyCell_GET` and `PyCell_SET`. These macros are not
safe to use in the free-threaded build. Use `PyCell_GetRef()` and
`PyCell_SetTakeRef()` instead.
* Since `PyCell_GetRef()` returns a strong rather than borrowed ref, some
code restructuring was required, e.g. `frame_get_var()` returns a strong
ref now.
* Add critical sections to `PyCell_GET` and `PyCell_SET`.
* Move critical_section.h earlier in the Python.h file.
* Add `PyCell_GET` to the free-threading howto table of APIs that return
borrowed refs.
* Add additional unit tests for free-threading.
|
|
|
|
|
| |
No additional thread safety changes are required. Note that sending to
a generator that is shared between threads is currently not safe in the
free-threaded build.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix race in test_start_new_thread_failed
When we succeed in starting a new thread, for example if setrlimit
was ineffective, we must wait for the newly spawned thread to exit.
Otherwise, we run the risk that the newly spawned thread will race
with runtime finalization and access memory that has already been
clobbered/freed.
`_thread.start_new_thread()` only spawns daemon threads, which the runtime
does not wait for at shutdown, and does not return a handle. Use
`_thread.start_joinable_thread()` and join the resulting handle when
the thread is started successfully.
|
|
|
|
|
|
| |
Use existing helpers to atomically modify the bytecode. Add unit tests
to ensure specializing is happening as expected. Add test_specialize.py
that can be used with ThreadSanitizer to detect data races.
Fix thread safety issue with cell_set_contents().
|
|
|
| |
Previously, `traceback.print_list` didn't have a documentation entry and was not exposed in `traceback.__all__`. Now it has a documentation entry and is exposed in `__all__`.
|
| |
|
|
|
|
| |
extensions (GH-123211)
|
| |
|
| |
|
|
|
|
| |
stream cannot immediately return bytes. (GH-122933)
|
|
|
| |
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
collection (GH-127110)
* Mark almost all reachable objects before doing collection phase
* Add stats for objects marked
* Visit new frames before each increment
* Update docs
* Clearer calculation of work to do.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
(#126900)
---------
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
| |
breakpoint() (#127457)
|
| |
|
| |
|
|
|
|
|
| |
These classmethods presume that the user has retained the original
`__init__()` signature, which may not be the case. Also, many virtual
filesystems don't provide current or home directories.
|
|
|
|
|
|
| |
Remove the `PathBase.lstat()` method, which is a trivial variation of
`stat()`.
No user-facing changes because the pathlib ABCs are still private.
|
|
|
|
| |
(#127399)
|
|
|
|
| |
_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.
|
|
|
| |
Replace the sleep(2) with a task which is blocked forever.
|
|
|
|
|
| |
docstrings (#127310)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
|
|
|
|
|
|
|
| |
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
|
|
|
| |
Don't make the assumption that the 'name' argument is a string. Use
repr() to format the 'name' argument instead.
|
|
|
|
| |
(#127302)
|
|
|
|
|
| |
Improve performance of this function by a factor of 1.7x.
Co-authored-by: Barney Gale <barney.gale@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
console (GH-124059)
Since MultiByteToWideChar()/WideCharToMultiByte() is not reversible if
the data contains invalid UTF-8 sequences, use binary search to
calculate the number of written bytes from the number of written
characters.
Also fix writing incomplete UTF-8 sequences.
Also fix handling of memory allocation failures.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"Generally, mixed-mode arithmetic combining real and complex variables should
be performed directly, not by first coercing the real to complex, lest the sign
of zero be rendered uninformative; the same goes for combinations of pure
imaginary quantities with complex variables." (c) Kahan, W: Branch cuts for
complex elementary functions.
This patch implements mixed-mode arithmetic rules, combining real and
complex variables as specified by C standards since C99 (in particular,
there is no special version for the true division with real lhs
operand). Most C compilers implementing C99+ Annex G have only these
special rules (without support for imaginary type, which is going to be
deprecated in C2y).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Revert "[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (#127105)"
This reverts commit c09366b1fed2289530581505834b2b262120a7c7.
* Skip timerfd tests on Android.
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
| |
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
|
|
|
|
|
| |
comment (GH-126871)
Include a list of possibilities for not unique prefix.
|
|
|
|
| |
(#126894)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#127194)
When handed an absolute Windows path such as `C:\foo` or `//server/share`,
the `urllib.request.pathname2url()` function returns a URL with an
authority section, such as `///C:/foo` or `//server/share` (or before
GH-126205, `////server/share`). Only the `file:` prefix is omitted.
But when handed an absolute POSIX path such as `/etc/hosts`, or a Windows
path of the same form (rooted but lacking a drive), the function returns a
URL without an authority section, such as `/etc/hosts`.
This patch corrects the discrepancy by adding a `//` prefix before
drive-less, rooted paths when generating URLs.
|
|
|
|
|
| |
value (#127219)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
| |
* Make `create_shelllink_persist` top level function.
* Add `CopyComPointerTests`.
* Add more tests.
* Update tests.
* Add assertions for `Release`'s return value.
|
|
|
|
| |
Posix (GH-127218)
|
|
|
|
| |
`zipfile.is_zipfile` (#122397)
|
|
|
|
| |
groups (#127186)
|
|
|
| |
`x**y == 1/x**-y ` thus changing `/=` to `*=` by negating the exponent.
|