This fix was motivated by a UnicodeEncodeError being raised when using the command line interface with stdout being redirected to a file use >.
For all stdout, use click’s get_text_stream so we can write unicode text and it will handle passing byte stream to stdout. For all stdin, use click’s get_binary_stream, so we get a byte stream input, similar to opening a file in binary mode.
This fix was motivated by a
UnicodeEncodeError
being raised when using the command line interface withstdout
being redirected to a file use>
.For all stdout, use click’s
get_text_stream
so we can write unicode text and it will handle passing byte stream to stdout. For all stdin, use click’sget_binary_stream
, so we get a byte stream input, similar to opening a file in binary mode.