Inconsistent behaviour of methods waiting for child process

Hi, I've previously asked about this issue on Python General but there was no response and I hope this post qualifies for Python Devel. I've done some experiments with: 1) multiprocessing.Process.join() 2) os.waitpid() 3) subprocess.Popen.wait() These three methods behave completely different when interrupted with a signal which I find disturbing. Reactions are: 1) exit with no exception or special return code 2) OSError exception 3) quiet retry (no exit) The 1) case is very impractical. Is there any movement towards standardization of those 3? Am I missing something and there is a way to get more information from Process.join()? My environment is: $ python --version Python 2.7.3rc2 $ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 7.0 (wheezy) Release: 7.0 Codename: wheezy $ uname -a Linux magazyn-ziarno 3.2.0-4-686-pae #1 SMP Debian 3.2.35-2 i686 GNU/Linux -- Marcin Szewczyk http://wodny.org mailto:Marcin.Szewczyk@wodny.borg <- remove b / usuń b xmpp:wodny@ubuntu.pl xmpp:wodny@jabster.pl

On 22/01/2013 12:16pm, Marcin Szewczyk wrote:
With Process.join(), it looks like version 2.6 raises OSError but later versions do not. Could you file an issue at bugs.python.org? You can work around the problem by checking the exitcode attribute, e.g. while proc.exitcode is None: proc.join() -- Richard

On Tue, Jan 22, 2013 at 05:35:06PM +0000, Richard Oudkerk wrote:
With Process.join(), it looks like version 2.6 raises OSError but later versions do not. Could you file an issue at bugs.python.org?
Done. I've linked an associated bug report and the commit changing that behaviour. http://bugs.python.org/issue17018 Thank for the hint on looping. -- Marcin Szewczyk http://wodny.org mailto:Marcin.Szewczyk@wodny.borg <- remove b / usuń b xmpp:wodny@ubuntu.pl xmpp:wodny@jabster.pl

On 22/01/2013 12:16pm, Marcin Szewczyk wrote:
With Process.join(), it looks like version 2.6 raises OSError but later versions do not. Could you file an issue at bugs.python.org? You can work around the problem by checking the exitcode attribute, e.g. while proc.exitcode is None: proc.join() -- Richard

On Tue, Jan 22, 2013 at 05:35:06PM +0000, Richard Oudkerk wrote:
With Process.join(), it looks like version 2.6 raises OSError but later versions do not. Could you file an issue at bugs.python.org?
Done. I've linked an associated bug report and the commit changing that behaviour. http://bugs.python.org/issue17018 Thank for the hint on looping. -- Marcin Szewczyk http://wodny.org mailto:Marcin.Szewczyk@wodny.borg <- remove b / usuń b xmpp:wodny@ubuntu.pl xmpp:wodny@jabster.pl
participants (3)
-
Marcin Szewczyk
-
Marcin Szewczyk
-
Richard Oudkerk