[issue13285] signal module ignores external signal changes

2019-01-16 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: For reference, the sources for my implementation: https://github.com/sagemath/cysignals/blob/master/src/cysignals/pysignals.pyx -- ___ Python tracker __

[issue13285] signal module ignores external signal changes

2019-01-16 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > In Jeroen's API, I can see what the Python-level signal handler is, but > there's no way to find out whether that signal handler is actually in use or > not. I added support for that in the latest cysignals release. Now you can do >>> import signal >>> fr

[issue13285] signal module ignores external signal changes

2018-09-18 Thread Nathaniel Smith
Nathaniel Smith added the comment: Here's another case where this bug bites us: https://github.com/python-trio/trio/issues/673 At startup, Trio checks if SIGINT is currently being handled by Python's default SIGINT handler, and if so it substitutes its own SIGINT handler (which works just l

[issue13285] signal module ignores external signal changes

2017-04-12 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: I have a preliminary implementation (in the cysignals package) at https://github.com/sagemath/cysignals/pull/53 -- ___ Python tracker ___ _

[issue13285] signal module ignores external signal changes

2017-04-12 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Ping? I'll try to implement this in cysignals (which is more difficult than doing it in CPython because I cannot access all internals of the Python signal module). -- ___ Python tracker

[issue13285] signal module ignores external signal changes

2017-01-26 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Here is a proposal for an API: * getsignal: return the Python-level signal handler (this is an existing function) * setsignal: set the Python-level signal handler (but not the OS-level signal handler) * getossignal: get the OS-level signal handler as opaque

[issue13285] signal module ignores external signal changes

2017-01-25 Thread Thomas Kluyver
Thomas Kluyver added the comment: I pitched both the opaque handle and the context manager to python-ideas, but didn't get any responses, positive or negative. -- ___ Python tracker ___

[issue13285] signal module ignores external signal changes

2017-01-25 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Let me add that this "low-level opaque object" would be rather easy to implement on POSIX systems (I have no clue about other systems such as Windows). I could implement it, but it would be good to have some pre-approval from Python devs that it's a good idea

[issue13285] signal module ignores external signal changes

2017-01-19 Thread R. David Murray
R. David Murray added the comment: IMO the signal handler context manager would be useful (I have existing code where I wrote one that didn't quite work right :). I suggest you propose this on python-ideas. -- nosy: +r.david.murray ___ Python track

[issue13285] signal module ignores external signal changes

2017-01-19 Thread Thomas Kluyver
Thomas Kluyver added the comment: I'd like to make the case for a fix in the code again. Our use case is, I believe, the same as Vilya's. We want to temporarily set a signal handler from Python and then restore the previous handler. This is fairly straightforward for Python handler functions,

[issue13285] signal module ignores external signal changes

2016-04-03 Thread Robert Cope
Changes by Robert Cope : -- nosy: +rpcope1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue13285] signal module ignores external signal changes

2016-03-23 Thread STINNER Victor
STINNER Victor added the comment: If anyone wants to work on this issue, I suggest to requalify it as a documentation issue. Just explain the behaviour and don't try to implement complex workaround. -- ___ Python tracker

[issue13285] signal module ignores external signal changes

2016-03-22 Thread Martin Panter
Martin Panter added the comment: Also, the documentation currently suggests it returns None in these cases, but it actually returns SIG_DFL in at least one case (noticed in Issue 23735). FWIW Vilya’s opaque object sounds fairly sensible to me. Yes, it is ugly, but one does not look at Unix sig

[issue13285] signal module ignores external signal changes

2013-08-28 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue13285] signal module ignores external signal changes

2011-11-03 Thread Vilya Harvey
Vilya Harvey added the comment: Petri: yes, that what I was suggesting. Charles-François: I'm certainly open to alternatives. Unless I've overlooked something though, the problem is that no workaround is possible at the moment. BTW this came up in the context of a customer script for the soft

[issue13285] signal module ignores external signal changes

2011-11-02 Thread Charles-François Natali
Charles-François Natali added the comment: >> Could it return an opaque wrapper object, rather than just the raw >> address? Something like: > > Are you suggesting that it would return either a Python function object or a > wrapper object? I think it would be an ugly kludge. I don't like the id

[issue13285] signal module ignores external signal changes

2011-11-02 Thread Petri Lehtinen
Petri Lehtinen added the comment: > Could it return an opaque wrapper object, rather than just the raw address? > Something like: Are you suggesting that it would return either a Python function object or a wrapper object? -- ___ Python tracker <

[issue13285] signal module ignores external signal changes

2011-10-29 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- nosy: +petri.lehtinen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue13285] signal module ignores external signal changes

2011-10-28 Thread Florent Xicluna
Changes by Florent Xicluna : -- components: +Library (Lib) nosy: +flox versions: +Python 3.3 -Python 2.6, Python 3.1 ___ Python tracker ___ __

[issue13285] signal module ignores external signal changes

2011-10-28 Thread Vilya Harvey
Vilya Harvey added the comment: Could it return an opaque wrapper object, rather than just the raw address? Something like: typedef struct _PyNativeSignalHandler { PyObject_HEAD sighandler_t handler_func; } PyNativeSignalHandler; where the type object doesn't expose any way to read or man

[issue13285] signal module ignores external signal changes

2011-10-28 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue13285] signal module ignores external signal changes

2011-10-28 Thread Charles-François Natali
Charles-François Natali added the comment: > So it's impossible to reliably save and restore signal handlers through > python when they can also be changed outside the python interpreter. signal.getsignal() or signal.signal() return the current/previous handler as a Python function. How could

[issue13285] signal module ignores external signal changes

2011-10-28 Thread Vilya Harvey
Changes by Vilya Harvey : -- title: signal module in ignores external signal changes -> signal module ignores external signal changes ___ Python tracker ___