[New-bugs-announce] [issue10635] Calling subprocess.Popen with preexec_fn=signal.pause blocks forever

joseph.h.garvin report at bugs.python.org
Mon Dec 6 01:05:25 CET 2010

New submission from joseph.h.garvin <joseph.h.garvin at 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 <report at bugs.python.org>

More information about the New-bugs-announce mailing list