FAQ
Hi there,

I have this, say timeTol = 5 (5 seconds) and 'cmd' takes minutes to execute
:

import subprocess as sub

...

p = sub.Popen(cmd, shell=True, stderr = sub.STDOUT, stdout =
sub.PIPE)

pid = p.pid

signal.signal(signal.SIGALRM, signal_handler)

signal.alarm(timeTol)

And it works on python 2.x.

However, on python 3.x, the signal_handler is only called when 'p =
sub.Popen...' has finished (after minutes) and signal.alarm appears to not
be called at 5 sec. Can someone please explain me this behaviour and how to
solve this?

Many thanks in advance,

Alan
--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100715/00d670b5/attachment.html>

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedJul 15, '10 at 1:13p
activeJul 15, '10 at 1:13p
posts1
users1
websitepython.org

1 user in discussion

Alan: 1 post

People

Translate

site design / logo © 2022 Grokbase