[issue15649] subprocess.Popen.communicate: accept str for input parameter if universal_newlines is False

Chris Jerdonek report at bugs.python.org
Tue Aug 14 18:35:40 CEST 2012


Chris Jerdonek added the comment:

> What to do if stdin doesn't have `encoding` attribute? Convert to bytes using filesystemencoding?

If choosing an encoding, it probably makes sense to default to the same as for when universal_newlines=True, namely locale.getpreferredencoding(False).

> Adding `encode` parameter for .communicate doesn't looks elegant.

Also see issue 6135 (to allow setting encoding).

----------
nosy: +cjerdonek

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


More information about the Python-bugs-list mailing list