Serhiy Storchaka added the comment: I think you should ensure that os.fsdecode(os.fsencode(character)) == character. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue16414> _______________________________________