Re:So you think you know what a number is
by evincarofautumn on Friday April 28, 2017 @09:02PM
(#14224377)
I’d guess because CPython is assuming the input to -c is ISO-8859-1 (Latin-1) when it decodes it using Py_DecodeLocale():
While the REPL’s encoding (sys.stdin.encoding) is set to UTF-8 due to LANG/LC_CTYPE settings. You can get the same error when invoking the REPL as:
So the shell isn’t doing anything to the text—it’s providing UTF-8 bytes in both cases, it’s just that Python is interpreting them differently.
[ Parent
| on HN ]
There are no comments on this comment yet.