_thread.get_ident returns a result with an exception set #128189
Labels
extension-modules
C modules in the Modules dir
pending
The issue will be closed if no feedback is provided
topic-C-API
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
I am working on a python program that is async in nature and is carefully created using the C API as a C extension by using a generic awaitable object, Sadly, I had to implement what
asyncio.run
does manually due to it not liking how the awaitable object is designed because the only way to get the awaitable object the C api function returns is that it must first run the function in order forasyncio.run
to then await the awaitable. However the 3.14 change to throw RuntimeError when get_event_loop() is called prior toasyncio.run
actually creating it became a problem that I needed to solve with manually doing:from the C code. Everything works well, Except when I Ctrl+C the program to terminate it and
loop.close()
returns NULL, I thenPyErr_Print()
'd it and see that:And I seen the line and it looks that threading.py set's it's
get_ident()
to_thread.get_ident()
and then uses it on the line the traceback mentions. The issue is, it's hard to debug why the_thread.get_ident()
function did this.See also: ZeroIntensity/pyawaitable#36
CPython versions tested on:
3.14, CPython main branch
Operating systems tested on:
Windows
The text was updated successfully, but these errors were encountered: