Should stdlib files contain 'narrow non breaking space' U+202F?

eryk sun eryksun at gmail.com
Fri Dec 18 05:35:37 EST 2015


On Fri, Dec 18, 2015 at 3:51 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> On Fri, 18 Dec 2015 11:02 am, Mark Lawrence wrote:
>
>> A lot of it is down to Windows, as the actual complaint is:-
>>
>>      six.print_(source)
>
> Looks like a bug in six to me.
>
> See, without Unicode comments in the std lib, you never would have found
> that bug.

I think Mark said he's piping the output. In this case it's not
looking at the current console/terminal encoding. Instead it defaults
to the platform's preferred encoding. On Windows that's the system
ANSI encoding, such as codepage 1252. You can set
PYTHONIOENCODING=UTF-8 to override this for stdin, stdout, and stderr.



More information about the Python-list mailing list