[New-bugs-announce] [issue7126] Contradictory documentation for os.putenv and os.system

Daniel Stutzbach report at bugs.python.org
Wed Oct 14 17:09:38 CEST 2009

New submission from Daniel Stutzbach <daniel at stutzbachenterprises.com>:

The documentation for os.putenv states that "changes to the environment
affect subprocesses started with os.system(), popen() or fork() and
execv()" and "assignments to items in os.environ are automatically
translated into corresponding calls to putenv()".

However, the documentation for os.system() states "Changes to os.environ
... are not reflected in the environment of the executed command."

A simple test confirms that the os.putenv documentation is the correct one:

Python 2.6
>>> import os
>>> os.environ['foo'] = 'bar'
>>> os.system('echo $foo')

assignee: georg.brandl
components: Documentation
messages: 93994
nosy: georg.brandl, stutzbach
severity: normal
status: open
title: Contradictory documentation for os.putenv and os.system
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list