STINNER Victor added the comment: """ Today we're doing something like this:
tmpdir = tempfile.mkdtemp('', 'hgtests.', d and d.decode('utf-8')).encode('utf-8') """ Don't do that. UTF-8 is not the right encoding. Use os.fsencode() and os.fsdecode(). Internally, Python uses sys.getfilesystemencoding() with 'surrogateescape' error handler (but 'strict' error handler on Windows). If you use UTF-8, you can get indirectly mojibake. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24230> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com