On 26Mar2017 0707, Nick Coghlan wrote:
Perhaps it would be worth noting in the table of error handlers at
https://docs.python.org/3/library/codecs.html#error-handlers that
backslashreplace is used by the `ascii()` builtin and the associated
format specifiers
backslashreplace is also the default errors for stderr, which is
arguably the right target for debugging output. Perhaps what we really
want is a shorter way to send output to stderr? Though I guess it's an
easy to invent one-liner, once you know about the difference:
>>> printe = partial(print, file=sys.stderr)
Also worth noting that Python 3.6 supports Unicode characters on the
console by default on Windows. So unless sys.stdout was manually
constructed (a possibility, given this was a GUI app, though I designed
the change such that `open("CON", "w")` would get it right), there
wouldn't have been an encoding issue in the first place.
Cheers,
Steve
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/