Consider this example:
考虑一下这个例子:
>>> import subprocess as sp
>>> sp.Popen("notepad2.exe",env={"PATH":"C:\users\guillermo\smallapps\bin"})
<subprocess.Popen object at 0x030DF430>
>>> sp.Popen("notepad2.exe",env={"PATH":u"C:\users\guillermo\smallapps\bin"})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\subprocess.py", line 633, in __init__
errread, errwrite)
File "C:\Python26\lib\subprocess.py", line 842, in _execute_child
startupinfo)
TypeError: environment can only contain strings
>>> import