Embedded use vs. signal handlers
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Enhancement
C signal handlers should be restore-able. Ideally you also want to call them from Python.
signal.signal(signal.SIGINT, signal.getsignal(signal.SIGINT))
This (ostensibly no-op) code raises TypeError when you use it in an embedded Python interpreter and a signal handler has been installed by the C (or whatever) side.
It shouldn't. My Python code wants to be able to restore the signal handler to its previous state when it's done.
Ideally my code should also be able to wrap that C handler, i.e. the result of getsignal() should be a callable from Python.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by examining the signal.signal and signal.getsignal behavior described for an embedded Python interpreter, including handlers installed by C; done should allow restoring that prior handler and, if feasible, expose it as a callable that Python can wrap.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100