[issue21619] Cleaning up a subprocess with a broken pipe

Serhiy Storchaka report at bugs.python.org
Sun Mar 1 14:48:43 CET 2015


Serhiy Storchaka added the comment:

When you write to the file you don't want the error was silently ignored.

    with open(filename, 'w') as f:
        f.write(content)

And also I don't want the error was silently ignored when write to the subprocess.

    with subprocess.Popen(cmd, universal_newlines=True, stdin=subprocess.PIPE) as p:
        p.stdin.write(content)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21619>
_______________________________________


More information about the Python-bugs-list mailing list