New submission from joseph.h.garvin <joseph.h.gar...@gmail.com>:

The following code will cause the interpreter to hang:

import subprocess
import signal
subprocess.Popen("/bin/echo", preexec_fn=signal.pause)

Replace "/bin/echo" with any valid program on your box, it's just the simplest 
Linux example. It's expected for signal.pause to block, but the documentation 
for Popen says that preexec_fn will be run in the /child/ process, so it 
shouldn't cause the interpreter running this code to block.

I'm going to guess Popen is using signals for some reason internally and 
signal.pause interferes with it. It's probably worth making sure that signals 
related functions work with preexec_fn in general.

----------
components: Library (Lib)
messages: 123444
nosy: joseph.h.garvin
priority: normal
severity: normal
status: open
title: Calling subprocess.Popen with preexec_fn=signal.pause blocks forever
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10635>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to