Should stdlib files contain 'narrow non breaking space' U+202F?
Chris Angelico
rosuav at gmail.com
Thu Dec 17 19:16:49 EST 2015
On Fri, Dec 18, 2015 at 11:02 AM, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
> A lot of it is down to Windows, as the actual complaint is:-
>
> six.print_(source)
> File "C:\Python35\lib\encodings\cp1252.py", line 19, in encode
> return codecs.charmap_encode(input,self.errors,encoding_table)[0]
> UnicodeEncodeError: 'charmap' codec can't encode character '\u202f' in
> position 407: character maps to <undefined>
>
> And as usual I've answered my own question. The cp1252 shows even if my
> console is set to 65001, *BUT* I'm piping the output to file as it's so much
> faster. Having taken five minutes to run the code without the pipe
> everything runs to completion.
>
> I suppose the original question still holds, but I for one certainly won't
> be losing any sleep over it. Talking of which, good night all :)
Oh. Windows.
Suddenly it all makes sense.
Python source code is (as of 3.0) Unicode text, and is assumed to be
stored as UTF-8 if not otherwise specified. If Windows can't handle
that, too bad for Windows.
ChrisA
More information about the Python-list
mailing list