Sam Gross

Results 22 issues of Sam Gross

## Summary * OS: cross-platform * Type: wheels / build ## Description The free-threaded (`--disable-gil`) build of CPython 3.13 doesn't currently support the limited API. Let's adjust `setup.py` so that...

enhancement
wheels
api

# Bug report `PyEval_GetLocals()` is documented as returning a [borrowed reference](https://docs.python.org/3/c-api/reflection.html#c.PyEval_GetLocals). It now returns a new reference, which causes callers to leak the local variables: https://github.com/python/cpython/blob/35c436186b849f8f2f9fb866c59015c9d034d448/Python/ceval.c#L2478-L2479 cc @gaogaotiantian @markshannon

type-bug
topic-C-API
3.13
3.14

# Bug report In https://github.com/python/cpython/pull/114574 we switched a number of non-PyObject allocations from `PyObject_Malloc` to `PyMem_Malloc`, including `tp_doc` on `PyHeapTypeObject`s. Unfortunately, this isn't backwards compatible because C-API extensions may allocate...

type-bug
3.13
topic-free-threading
3.14

This exposes `_PyWeakref_ClearWeakRefsExceptCallbacks` 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...

awaiting core review
topic-C-API
topic-free-threading
needs backport to 3.13

`_PyWeakref_ClearRef` was previously [exposed](https://github.com/python/cpython/blob/656491783d2be0fe36feef5085a2406a05abbd66/Include/cpython/weakrefobject.h#L37) in the public C-API. In 3.13, it was moved to `pycore_weakref.h` and the symbol is not exposed (i.e., it's `extern void` instead of `PyAPI_FUNC(void)`. `_PyWeakref_ClearRef` is...

topic-C-API
topic-free-threading

See https://discuss.python.org/t/pep-703-making-the-global-interpreter-lock-optional-3-12-updates/26503/131

# Feature or enhancement Some of our internal headers (e.g., [`pycore_ceval.h`](https://github.com/python/cpython/blob/b6228b521b4692b2de1c1c12f4aa5623f8319084/Include/internal/pycore_ceval.h#L3-L14)) contain `#include` directives inside the `extern "C" {` blocks. This can cause problems if system headers are included within...

type-feature
topic-C-API

We should add a "HOWTO" guide for C API extension authors covering how to support the free-threaded build. See also https://peps.python.org/pep-0703/#how-to-teach-this

docs
topic-C-API
topic-free-threading

The test fails because the running the asyncio repl exits with: ``` Fatal Python error: _enter_buffered_busy: could not acquire lock for at interpreter shutdown, possibly due to daemon threads ```...

type-bug
tests
topic-asyncio
type-crash
topic-repl

On POSIX systems, excluding macOS framework installs, the lib directory for the free-threaded build now includes a "t" suffix to avoid conflicts with a co-located default build installation. * Issue:...

awaiting merge
topic-free-threading
needs backport to 3.13