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 pekka.klarck
Recipients pekka.klarck
Date 2018-04-23.08:38:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524472712.16.0.682650639539.issue33339@psf.upfronthosting.co.za>
In-reply-to
Content
It is possible to use `subprocess.run()` with the system's default encoding by using `universal_newlines=True`. This is very handy, but it's not at all obvious (at least for me) that setting such option has effect on encoding. This is especially true when the docs don't explain this explicitly:

"""If encoding or errors are specified, or universal_newlines is true, file objects for stdin, stdout and stderr are opened in text mode using the specified encoding and errors or the io.TextIOWrapper default."""

This is such a useful feature that it ought to be documented better, preferably with an example.

From code reading point of view, I would also consider `encoding=True` to be more explicit that `universal_newlines=True`. I can submit a separate issue about that if others feel the same.
History
Date User Action Args
2018-04-23 08:38:32pekka.klarcksetrecipients: + pekka.klarck
2018-04-23 08:38:32pekka.klarcksetmessageid: <1524472712.16.0.682650639539.issue33339@psf.upfronthosting.co.za>
2018-04-23 08:38:32pekka.klarcklinkissue33339 messages
2018-04-23 08:38:32pekka.klarckcreate