[New-bugs-announce] [issue12383] subprocess.Popen(..., env={}) fails to pass empty env.

Thomas Wouters report at bugs.python.org
Tue Jun 21 16:36:02 CEST 2011


New submission from Thomas Wouters <thomas at python.org>:

The addition of the _posixsubprocess module in 3.2 introduced a change of behaviour when passing an empty dict (or other false value besides None) as env:

python3.1 -c 'import subprocess; print(subprocess.Popen(["env"], env={}, stdout=subprocess.PIPE).communicate())'
(b'', None)

python3.2 -c 'import subprocess; print(subprocess.Popen(["env"], env={}, stdout=subprocess.PIPE).communicate())'
(b'LC_MONETARY=C\nSHELL=/bin/bash\nTERM=scr....', None)

The test for 'env' being the default (None) is not explicit enough.

----------
assignee: gregory.p.smith
components: Library (Lib)
files: subprocess.diff.txt
keywords: needs review, patch
messages: 138787
nosy: gregory.p.smith, twouters
priority: high
severity: normal
stage: patch review
status: open
title: subprocess.Popen(..., env={}) fails to pass empty env.
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22419/subprocess.diff.txt

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


More information about the New-bugs-announce mailing list