Problem with subprocess.Popen and EINTR
Piet van Oostrum
piet-l at vanoostrum.org
Sun Oct 29 03:22:16 EDT 2017
Cameron Simpson <cs at cskk.id.au> writes:
[...]
> What if you did this:
>
> os.signal(SIGINT, SIG_IGN)
> ... code code code, including the Popen/wait ...
> old_handler = os.signal(SIGINT, do_nothing_handler)
> sleep(...)
> os.signal(SIGINT, old_handler)
>
> SIG_IGN is different from a do-nothing handler; it prevents the process
> seeing the signal at all, and therefore prevents the signal interrupting
> system calls.
>
> So you activate your dummy-quit-sleeping function only around the sleep itself.
Thanks. That is a good idea. I'll try that out.
Or I could first try to switch to Python 3, as Chris suggested, to see if that makes the problem disappear.
--
Piet van Oostrum <piet-l at vanoostrum.org>
WWW: http://piet.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
More information about the Python-list
mailing list