[Python-Dev] Issue 13524: subprocess on Windows

Glyph glyph at twistedmatrix.com
Fri Mar 23 21:46:53 CET 2012


On Mar 23, 2012, at 1:26 PM, Brad Allen wrote:

> Thanks, Glyph. In that case maybe the Python subprocess docs need not
> single out SystemRoot, but instead plaster a big warning around the
> use of the 'env' parameter.

I agree.  I'm glad that my bitter experience here might be useful to someone in the future - all those late nights trying desperately to get my unit tests to run on some newly configured, slightly weird buildbot didn't go to waste :).

> The "Note" section could instead state something like: "In most cases,
> the child process will need many of the same environment variables as
> the current process. Usually the safest course of action is to build
> the env dict to contain all the same keys and values from os.environ.
> For example... <insert Glyph's examples here>"

I think including all the examples might be overstating the case.  It is probably best to say that other operating systems, vendors, and integration tools may set necessary environment variables that there is no way for you to be aware of in advance, unless you are an expert sysadmin on every platform where you expect your code to run, and that many of these variables are required for libraries to function properly, both libraries bundled with python and those from third parties.

-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120323/daa2b685/attachment.html>


More information about the Python-Dev mailing list