[issue42441] UnicodeEncodeError

Eryk Sun report at bugs.python.org
Mon Nov 23 04:07:05 EST 2020


Eryk Sun <eryksun at gmail.com> added the comment:

The default encoding for files in Windows is the process active code page, which defaults to the system code page, e.g. code page 1252 if the system locale is "en-IN". You need to explicitly use a Unicode encoding such as UTF-8 when opening the file, e.g. open('some.csv', newline='', encoding='utf-8').

----------
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42441>
_______________________________________


More information about the Python-bugs-list mailing list