Decode message only if encoding is known
When python does not know the encoding of stdout, sys.stdout.encoding is None. Then calling decode(None) raises an exception. We just skip decoding when the encoding is unknown.
Showing
Please
register
or
sign in
to comment