-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API function PySignal_SetWakeupFd is not exported and unusable #89364
Comments
I want to wait on curl_multi_wait which messes up python's signal handling since libcurl doesn't know to exit the polling loop on signal. I created a pipe that curl could read from when python registered a signal, and PySignal_SetWakeupFd would write to the pipe, thus letting curl leave its polling loop, letting my C module return an exception condition. Except PySignal_SetWakeupFd cannot be used. In Modules/signalmodule.c, it says: int
PySignal_SetWakeupFd(int fd) when it should say: PyAPI_FUNC(int)
PySignal_SetWakeupFd(int fd) This probably isn't a problem for most, since gcc has visiblity=public by default, but I guess Gentoo's process for building python sets -fvisibility=hidden, so I can't access it, and all Microsoft users should have no access to PySignal_SetWakeupFd, since Microsoft does have hidden visibility by default. |
See also bpo-45316: [C API] Functions not exported with PyAPI_FUNC(). |
Also running into this. The function is documented, but not exported by various builds of If the function isn't intended to be public, maybe the docs should be removed? Otherwise, the symbol should be available 😄 Given this function's prototype has (to my knowledge) not changed since its introduction in Python 2.6, any chance this could, then, become part of the limited API as well? |
Would you mind to elaborate your use case? Also, since the function is not usable, how do you work around this issue? Import the signal module and call the |
Sure! We're working on a framework combining Python and OCaml, including integration with a library called Async and its scheduler/event-loop (also integrating PEP-492-style coroutines with it). Being able to promptly react to signals delivered to such process (which are handled by the Python runtime, since that's the "main" entry-point and semantics we want to provide to users), even when the
I created a custom build of
We could use If |
Export the PySignal_SetWakeupFd() function. Previously, the function was documented but it couldn't be used in 3rd party code.
I created PR gh-121537 to export the function. |
Export the PySignal_SetWakeupFd() function. Previously, the function was documented but it couldn't be used in 3rd party code.
Export the PySignal_SetWakeupFd() function. Previously, the function was documented but it couldn't be used in 3rd party code. (cherry picked from commit ca0fb34) Co-authored-by: Victor Stinner <[email protected]>
Fixed by change ca0fb34. |
…121582) gh-89364: Export PySignal_SetWakeupFd() function (GH-121537) Export the PySignal_SetWakeupFd() function. Previously, the function was documented but it couldn't be used in 3rd party code. (cherry picked from commit ca0fb34) Co-authored-by: Victor Stinner <[email protected]>
Export the PySignal_SetWakeupFd() function. Previously, the function was documented but it couldn't be used in 3rd party code.
Export the PySignal_SetWakeupFd() function. Previously, the function was documented but it couldn't be used in 3rd party code.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: