[Python-Dev] Issue 13524: subprocess on Windows
mail at timgolden.me.uk
Sun Dec 4 13:20:11 CET 2011
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?
> 1. Unset 'SystemRoot' in a windows shell
> 2. Run the test suite and observe the scale of the breakage
Sorry; something I should have highlighted in the earlier post.
Behaviour varies between Windows versions. On WinXP, if you
unset SystemRoot in a cmd shell, you won't be able to run the
test suite: Python won't even start up. On Win7 Python will
start but, eg, the random module will fail.
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.
The case where someone tries to run Python (in general) without
a valid SystemRoot is a tiny cornercase and you'd be quite right
to push that back and say "Don't do that". I don't believe we have
to test for it or add code to work around it.
While I put the idea forward, I agree that an exception is more likely
than not to break existing code. I just can't see any clear alternative,
apart from option 1: we do nothing.
More information about the Python-Dev