New submission from George Prekas:

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

----------
components: Library (Lib)
files: testcase.py
messages: 253547
nosy: George Prekas
priority: normal
severity: normal
status: open
title: subprocess with redirection fails after FreeConsole
type: behavior
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file40868/testcase.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25492>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to