[Python-Dev] Issue 13524: subprocess on Windows

Paul Moore p.f.moore at gmail.com
Sun Dec 4 13:41:46 CET 2011

On 4 December 2011 12:20, Tim Golden <mail at timgolden.me.uk> wrote:
> On 04/12/2011 11:42, Nick Coghlan wrote:
>> There's actually two questions to be answered:
>> 1. What should we do in 3.2 and 2.7?
>> 2. Should we do anything more in 3.3?

See below...

> This is actually a separate issue: how much of Python will work
> without a valid SystemRoot. The OP's issue was that if you use
> subprocess to start an arbitrary process (you get the same problem
> if you try "notepad.exe") and pass it an env block without a valid
> SystemRoot then that process will likely fail to start up. And it
> won't be obvious why.

I'm not 100% clear on the problem here. From how I'm reading things,
the problem is that not supplying SystemRoot will cause (some or all)
invocations of subprocess.Popen to fail - it's not specific to
starting Python. In that case, it seems to me that it's an OS issue,
but one that we should work around.

My feeling is that option 4 is best - set SystemRoot to its current
value if it's not been set by the user. This leaves the user unable to
set an environment with SystemRoot missing, but if the OS fails to
handle that properly, then I'm OK with that limitation.

As regards the version question above, I'd take the view that as an OS
issue, it's OK to leave it unchanged in 2.7 and 3.2, but add the above
to 3.3.


More information about the Python-Dev mailing list