[issue25960] Popen.wait() hangs with SIGINT when os.waitpid() does not

2015-12-27 Thread Chris Jerdonek
New submission from Chris Jerdonek: I came across a situation where Popen.wait() hangs and os.waitpid() doesn't hang. It seems like a bug, but I don't know for sure. This is with Python 3.5.1. To reproduce, save the following to demo.py: import os, signal, subprocess class State:

[issue25960] Popen.wait() hangs with SIGINT when os.waitpid() does not

2015-12-27 Thread Chris Jerdonek
Chris Jerdonek added the comment: More information: No hang: 2.7.11, 3.3.6, 3.4.0 Hang: 3.4.1 3.4.3, 3.5.0, 3.5.1 Is this a regression or a bug fix? Maybe issue #21291 is related which was fixed in 3.4.1. Also, this is on Mac OS X 10.11 for me. -- nosy: +gregory.p.smith

[issue25960] Popen.wait() hangs with SIGINT when os.waitpid() does not

2015-12-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: fundamentally: this shouldn't work anyways. You are calling wait() from a signal handler. That is a blocking operation. You cannot do that from a signal handler. os.waitpid(p.pid, 1) is os.waitpid(p.pid, os.WNOHANG) which is a non-blocking operation so it

[issue25960] Popen.wait() hangs with SIGINT when os.waitpid() does not

2015-12-27 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- assignee: -> gregory.p.smith ___ Python tracker ___ ___

[issue25960] Popen.wait() hangs with SIGINT when os.waitpid() does not

2015-12-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: This appears due to Popen._waitpid_lock. It is not being released when the signal fires and the while loop containing the with self._waitpid_lock repeats. This also reproduces when using subprocess32. -- ___