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 <rep...@bugs.python.org>
<http://bugs.python.org/issue21619>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to