Message191840
This subprocess.communicate() call fails with pythonw.exe
--cut testhg.py--
import subprocess
hg = "hg"
output, _err = subprocess.Popen([hg, 'id', '-nib'],
stdout=subprocess.PIPE).communicate()
open("-hg-", "w").write(output)
--cut testhg.py--
When testhg.py is run with python.exe from cmd.exe session, the -hg- file is created ok. When pythonw.exe is used, nothing happens. When redirecting stderr from pythonw.exe with:
C:\Python27\pythonw.exe testhg.py 2>1
1 contains the following stacktrace:
Traceback (most recent call last):
File "testhg.py", line 5, in <module>
stdout=subprocess.PIPE).communicate()
File "C:\Python27\lib\subprocess.py", line 672, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "C:\Python27\lib\subprocess.py", line 787, in _get_handles
p2cread = self._make_inheritable(p2cread)
File "C:\Python27\lib\subprocess.py", line 826, in _make_inheritable
_subprocess.DUPLICATE_SAME_ACCESS)
WindowsError: [Error 6] The handle is invalid |
|
Date |
User |
Action |
Args |
2013-06-25 09:26:22 | techtonik | set | recipients:
+ techtonik |
2013-06-25 09:26:22 | techtonik | set | messageid: <1372152382.7.0.499650109634.issue18298@psf.upfronthosting.co.za> |
2013-06-25 09:26:22 | techtonik | link | issue18298 messages |
2013-06-25 09:26:22 | techtonik | create | |
|