STINNER Victor added the comment: Your problem has two solutions.
1) Upgrade to Python 3 which handles correctly your use case (thanks to the PEP 383, surrogateescape error handler) 2) Only process filenames as bytes, and encode/decode manually (so you can decide how to handle undecodable filenames) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22862> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com