[PyQt] Add Unix signal handler class to PyQt

Phil Thompson phil at riverbankcomputing.com
Tue Aug 2 10:18:16 BST 2016


On 2 Aug 2016, at 9:04 am, Kovid Goyal <kovid at kovidgoyal.net> wrote:
> 
> On Tue, Aug 02, 2016 at 01:21:36PM +0530, Kovid Goyal wrote:
>> On Tue, Aug 02, 2016 at 08:11:22AM +0200, Florian Bruhin wrote:
>>> FWIW I implemented something similar in Python, and it's relatively
>>> straight-forward:
>>> 
>>> https://github.com/The-Compiler/qutebrowser/blob/v0.8.1/qutebrowser/misc/crashsignal.py#L272-L398
>> 
>> For unix it is possible thanks to signal.set_wakeup_fd, but on windows
>> as far as I know, you would have to use QTimer to poll for signals,
>> which is sub-optimal for obvious reasons.
> 
> Well, I just looked at the docs for set_wakeup_fd and at least for
> python >= 3.5 it supports sockets on windows, so it should be possible
> to make it work there as well.
> 
> @Phil: So this is only necessary for python versions < 3.5. It's up to
> you whether you still think it important enough.

I'll leave it for now but let me know if you have problems creating a pure Python implementation.

Phil


More information about the PyQt mailing list