[docs] [issue23288] subprocess.Popen close_fds behaviour differs between 3.2 and 3.4

Mike Sampson report at bugs.python.org
Wed Jan 21 11:37:56 CET 2015


New submission from Mike Sampson:

I'm seeing differing behaviour with subprocess.Popen(..., close_fds = False) between 3.2 and 3.4. The docs don't say this is meant to be the case as far as I can see.

Python 3.2.3 on Debian Wheezy
=============================

>>> import subprocess
>>> import os
>>> r,w = os.pipe()
>>> p = subprocess.Popen('ls /dev/fd/*', shell = True, close_fds = False)
>>> ls: cannot access /dev/fd/5: No such file or directory
/dev/fd/0  /dev/fd/1  /dev/fd/2  /dev/fd/3  /dev/fd/4

Python 3.4.2 on Arch Linux
==========================

>>> import subprocess
>>> import os
>>> r,w = os.pipe()
>>> p = subprocess.Popen('ls /dev/fd/*', shell = True, close_fds = False)                                                                                                            
>>> ls: cannot access /dev/fd/3: No such file or directory
/dev/fd/0  /dev/fd/1  /dev/fd/2

In 3.4 even though close_fds is False the fds are closed in the child. Using pass_fds works around this though I would like to know if this is a bug, documentation issue, or am I missing something here?

----------
assignee: docs at python
components: Documentation
messages: 234428
nosy: docs at python, mfs
priority: normal
severity: normal
status: open
title: subprocess.Popen close_fds behaviour differs between 3.2 and 3.4
type: behavior
versions: Python 3.2, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23288>
_______________________________________


More information about the docs mailing list