On Fri, Nov 11, 2022 at 8:16 PM Eryk Sun <eryk...@gmail.com> wrote:
> If sys.std* are console files, then in Python 3.6+, sys.std*.buffer.raw will 
> be _io._WindowsConsoleIO
> io.TextIOWrapper uses locale.getpreferredencoding(False) as the default 
> encoding

Thank you for your replies - checking the sys.stdout.buffer.raw value
is what finally helped me understand. Turns out, the Windows agent is
redirecting the output of all python commands to a file, so sys.stdout
is a file using the locale encoding of cp1252, instead of being a
stream using encoding utf8. I wrote up a gist with my findings to
hopefully help out some other poor soul in the future:
https://gist.github.com/NodeJSmith/e7e37f2d3f162456869f015f842bcf15
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to