Author vstinner
Recipients a.badger, dstufft, eric.araujo, vstinner
Date 2019-05-21.21:40:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558474803.42.0.20808203669.issue36998@roundup.psfhosted.org>
In-reply-to
Content
The traceback comes from Python 3.5. Python 3.7 now uses UTF-8 when the LC_CTYPE locale is "C" or "POSIX", thanks to C locale coercion (PEP 538) and UTF-8 Mode (PEP 540):
https://vstinner.github.io/posix-locale.html
https://vstinner.github.io/python37-new-utf8-mode.html

Can you please retry your test using Python 3.7?

I would prefer to not start to use errors="surrogateescape" everywhere, especially if the issue is already fixed.

errors="surrogateescape" basically means: "I want to produce a file that other people will unable to read...

---

def write_file (filename, contents):
    """Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    """
    f = open(filename, "w")
    ...

For me, the first obvious bug is that the encoding is not specified. I don't see how an application on a different computer is supposed to read a text file if the encoding is not well defined...
History
Date User Action Args
2019-05-21 21:40:03vstinnersetrecipients: + vstinner, eric.araujo, a.badger, dstufft
2019-05-21 21:40:03vstinnersetmessageid: <1558474803.42.0.20808203669.issue36998@roundup.psfhosted.org>
2019-05-21 21:40:03vstinnerlinkissue36998 messages
2019-05-21 21:40:03vstinnercreate