This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <>
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):

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...
Date User Action Args
2019-05-21 21:40:03vstinnersetrecipients: + vstinner, eric.araujo, a.badger, dstufft
2019-05-21 21:40:03vstinnersetmessageid: <>
2019-05-21 21:40:03vstinnerlinkissue36998 messages
2019-05-21 21:40:03vstinnercreate