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 George Prekas
Recipients George Prekas
Date 2015-10-27.15:33:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445959994.99.0.328533880523.issue25492@psf.upfronthosting.co.za>
In-reply-to
Content
Under Windows, if I do FreeConsole and then subprocess.call with redirected stdin or stdout or stderr, then subprocess.call fails. The only solution is either DO NOT redirect any handle OR to redirect ALL of them. The problem lies in function _get_handles at subprocess.py:810 (Python 2.7.10), which does:
* GetStdHandle
* DuplicateHandle via _make_inheritable.

DuplicateHandle fails if called on stdin, stdout or stderr after FreeConsole.

$ cygstart /mnt/c/utils/Python35/python.exe testcase.py fails
$ cygstart /mnt/c/utils/Python35/python.exe testcase.py works1
$ cygstart /mnt/c/utils/Python35/python.exe testcase.py works2
$ cygstart /mnt/c/utils/Python35/python.exe testcase.py works3
History
Date User Action Args
2015-10-27 15:33:15George Prekassetrecipients: + George Prekas
2015-10-27 15:33:14George Prekassetmessageid: <1445959994.99.0.328533880523.issue25492@psf.upfronthosting.co.za>
2015-10-27 15:33:14George Prekaslinkissue25492 messages
2015-10-27 15:33:14George Prekascreate