Message148850
| Author |
tim.golden |
| Recipients |
Andrey.Morozov, pitrou, tim.golden |
| Date |
2011年12月04日.10:41:34 |
| SpamBayes Score |
0.00083711173 |
| Marked as misclassified |
No |
| Message-id |
<4EDB4E59.7000207@timgolden.me.uk> |
| In-reply-to |
<4EDAA03C.9050003@timgolden.me.uk> |
| Content |
OK, the long and short is that spwaning a process without passing
in SystemRoot is asking for trouble. There's a blog post here
which gives an example:
http://jpassing.com/2009/12/28/the-hidden-danger-of-forgetting-to-specify-systemroot-in-a-custom-environment-block/
And, certainly this works:
import os
import subprocess
subprocess.Popen(
"notepad.exe",
env={"SystemRoot" : os.environ['SystemRoot']}
)
I'm not quite sure what approach we should take in the subprocess
module. Is it a docs warning? Should we refuse to proceed if there's
no SystemRoot? Is it the caller's responsibility?
I'll ask on python-dev to gather opinions. |
|