[New-bugs-announce] [issue30798] Document that subprocess.Popen does not set PWD

James Lin report at bugs.python.org
Wed Jun 28 22:32:34 EDT 2017


New submission from James Lin:

Even though http://bugs.python.org/issue4057 was rejected (which I think is fair), I think it would be worth mentioning something about PWD in the Python docs for subprocess.Popen's cwd parameter (and possibly for os.chdir):

1. It's pretty common for people to use Python to execute other things.
2. I don't think it's that uncommon to come across binaries/scripts that directly read PWD instead of calling getcwd() or equivalent.
3. For people who encounter this problem for the first time, it can be really puzzling.

My suggestion would be to add something like:

   Note: Some programs might expect that the current directory is specified in a PWD environment variable.  Callers should explicitly set it themselves when invoking such programs.

or even just:

   Note: Callers are responsible for setting a PWD environment variable if necessary.

----------
assignee: docs at python
components: Documentation
messages: 297244
nosy: docs at python, jamesdlin
priority: normal
severity: normal
status: open
title: Document that subprocess.Popen does not set PWD
type: enhancement
versions: Python 3.6

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


More information about the New-bugs-announce mailing list