This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author techtonik
Recipients techtonik
Date 2013-06-25.09:26:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1372152382.7.0.499650109634.issue18298@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2013-06-25 09:26:22techtoniksetrecipients: + techtonik
2013-06-25 09:26:22techtoniksetmessageid: <1372152382.7.0.499650109634.issue18298@psf.upfronthosting.co.za>
2013-06-25 09:26:22techtoniklinkissue18298 messages
2013-06-25 09:26:22techtonikcreate