| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-118807) (#120695)
This exposes `PyUnstable_Object_ClearWeakRefsNoCallbacks` as an unstable
C-API function to provide a thread-safe mechanism for clearing weakrefs
without executing callbacks.
Some C-API extensions need to clear weakrefs without calling callbacks,
such as after running finalizers like we do in subtype_dealloc.
Previously they could use `_PyWeakref_ClearRef` on each weakref, but
that's not thread-safe in the free-threaded build.
(cherry picked from commit e8752d7b80775ec2a348cd4bf38cbe26a4a07615)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
|
|
|
|
| |
(gh-120463)
Check if the DateTime C-API type matches the datetime.date type on main and shared/isolated subinterpreters.
(cherry picked from commit 50a389565aa0b480792ed06a2ab56fb5a72fc2d8, AKA gh-119604)
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
| |
monitoring (GH-119216) (#119497)
* gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (GH-119216)
(cherry picked from commit 6e9863d7a3516cc76d6ce13923b15620499f3855)
---------
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
|
|
| |
use thread state set of dict versions
|
|
|
|
|
|
|
| |
of concurrent mutators (#118454)
Add _PyType_LookupRef and use incref before setting attribute on type
Makes setting an attribute on a class and signaling type modified atomic
Avoid adding re-entrancy exposing the type cache in an inconsistent state by decrefing after type is updated
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-115270)
Now inspect.signature() supports references to the module globals in
parameter defaults on methods in extension modules. Previously it was
only supported in functions. The workaround was to specify the fully
qualified name, including the module name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add "Raw" variant of PyTime functions:
* PyTime_MonotonicRaw()
* PyTime_PerfCounterRaw()
* PyTime_TimeRaw()
Changes:
* Add documentation and tests. Tests release the GIL while calling
raw clock functions.
* py_get_system_clock() and py_get_monotonic_clock() now check that
the GIL is hold by the caller if raise_exc is non-zero.
* Reimplement "Unchecked" functions with raw clock functions.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
| |
Don't test the undefined behavior of fileno()
on a closed file, but use fstat() as a reliable
test if the file was closed or not.
|
|
|
|
|
|
|
|
| |
(GH-118230)
The behavior of fileno() after fclose() is undefined, but it is the only
practical way to check whether the file was closed.
Only test this on the known platforms (Linux, Windows, macOS), where we
already tested that it works.
|
|
|
|
| |
Co-authored-by: Joe Jevnik <joe@quantopian.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
| |
Co-authored-by: NGRsoftlab <78017794+NGRsoftlab@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
| |
*endianness* (GH-116053)
|
| |
|
| |
|
|
|
|
|
| |
(GH-117160)
Create a new bytes object and destroy the old one if it has refcount > 1.
|
| |
|
|
|
|
| |
platforms (GH-117064)
|
|
|
|
| |
Split complex.c tests of _testcapi into two parts: limited C API
tests in _testlimitedcapi and non-limited C API tests in _testcapi.
|
|
|
|
| |
Split dict.c tests of _testcapi into two parts: limited C API tests
in _testlimitedcapi and non-limited C API tests in _testcapi.
|
|
|
|
|
|
|
| |
* Split long.c tests of _testcapi into two parts: limited C API tests
in _testlimitedcapi and non-limited C API tests in _testcapi.
* Move testcapi_long.h from Modules/_testcapi/ to
Modules/_testlimitedcapi/.
* Add MODULE__TESTLIMITEDCAPI_DEPS to Makefile.pre.in.
|
|
|
|
|
|
| |
Split unicode.c tests of _testcapi into two parts: limited C API
tests in _testlimitedcapi and non-limited C API tests in _testcapi.
Update test_codecs.
|
|
|
|
|
|
|
| |
Split abstract.c and float.c tests of _testcapi into two parts:
limited C API tests in _testlimitedcapi and non-limited C API tests
in _testcapi.
Update test_bytes and test_class.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the following files from Modules/_testcapi/ to
Modules/_testlimitedcapi/:
* bytearray.c
* bytes.c
* pyos.c
* sys.c
Changes:
* Replace PyBytes_AS_STRING() with PyBytes_AsString().
* Replace PyBytes_GET_SIZE() with PyBytes_Size().
* Update related test_capi tests.
* Copy Modules/_testcapi/util.h to Modules/_testlimitedcapi/util.h.
|
|
|
|
|
| |
* Remove unused '_testcapimodule' global in Modules/_testcapi/unicode.c.
* Update c-analyzer to not use the internal C API in
_testlimitedcapi.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new C extension "_testlimitedcapi" which is only built with the
limited C API.
Move heaptype_relative.c and vectorcall_limited.c from
Modules/_testcapi/ to Modules/_testlimitedcapi/.
* configure: add _testlimitedcapi test extension.
* Update generate_stdlib_module_names.py.
* Update make check-c-globals.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
| |
|
|
|
| |
gh-115417: Remove debugging print
|
|
|
|
| |
functions (GH-114886)
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gh-110850: Add PyTime_t C API
Add PyTime_t API:
* PyTime_t type.
* PyTime_MIN and PyTime_MAX constants.
* PyTime_AsSecondsDouble(), PyTime_Monotonic(),
PyTime_PerfCounter() and PyTime_GetSystemClock() functions.
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
| |
The `PyDict_SetDefaultRef` function is similar to `PyDict_SetDefault`,
but returns a strong reference through the optional `**result` pointer
instead of a borrowed reference.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
|
|
|
|
| |
The new `PyList_GetItemRef` is similar to `PyList_GetItem`, but returns
a strong reference instead of a borrowed reference. Additionally, if the
passed "list" object is not a list, the function sets a `TypeError`
instead of calling `PyErr_BadInternalCall()`.
|
|
|
| |
Converts specializations of `LOAD_GLOBAL` into constants during tier 2 optimization.
|
|
|
|
|
| |
PyObject_GetBuffer() now raises a SystemError if called with
PyBUF_READ or PyBUF_WRITE as flags. These flags should
only be used with the PyMemoryView_* C API.
|
|
|
|
| |
- use PyErr_SetString() iso. PyErr_Format() in parse_tuple_and_keywords()
- fix misspelled format specifier in CHECK_SIGNNESS() macro
|
|
|
| |
Fix refleaks and a typo.
|
|
|
|
|
|
|
|
|
| |
gh-113750: Fix object resurrection on free-threaded builds
This avoids the undesired re-initializing of fields like `ob_gc_bits`,
`ob_mutex`, and `ob_tid` when an object is resurrected due to its
finalizer being called.
This change has no effect on the default (with GIL) build.
|
| |
|
| |
|
|
|
|
|
| |
* Implement _Py_HashPointerRaw() as a static inline function.
* Add Py_HashPointer() tests to test_capi.test_hash.
* Keep _Py_HashPointer() function as an alias to Py_HashPointer().
|
|
|
|
| |
Add tests for PyObject_Str(), PyObject_Repr(), PyObject_ASCII() and
PyObject_Bytes().
|
| |
|
|
|
|
| |
in PyArg_Parse (gh-112439)
|
|
|
| |
Rename Py_NOGIL to Py_GIL_DISABLED
|
|
|
| |
Add Modules/_testcapi/hash.c and Lib/test/test_capi/test_hash.py.
|
|
|
|
|
|
|
| |
_PyDict_Pop_KnownHash(): remove the default value and the return type
becomes an int.
Co-authored-by: Stefan Behnel <stefan_ml@behnel.de>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
|
|
|
|
|
|
| |
* Split list_extend() into two sub-functions: list_extend_fast() and
list_extend_iter().
* list_inplace_concat() no longer has to call Py_DECREF() on the
list_extend() result, since list_extend() now returns an int.
|
|
|
|
|
| |
Signed-off-by: kalyanr <kalyan.ben10@live.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Revert "gh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (#111585)"
This reverts commit d9b606b3d04fc56fb0bcc479d7d6c14562edb5e2.
* Revert "gh-111089: Use PyUnicode_AsUTF8() in getargs.c (#111620)"
This reverts commit cde1071b2a72e8261ca66053ef61431b7f3a81fd.
* Revert "gh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (#111091)"
This reverts commit d731579bfb9a497cfb0076cb6b221058a20088fe.
* Revert "gh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)"
This reverts commit d8f32be5b6a736dc2fc9dca3f1bf176c82fc9b44.
* Revert "gh-111089: Use PyUnicode_AsUTF8() in sqlite3 (#111122)"
This reverts commit 37e4e20eaa8f27ada926d49e5971fecf0477ad26.
|