Ronald Oussoren <ronaldousso...@mac.com> added the comment: What filesystem is used on macOS? If it is HFS+ you're likely running into unicode normalisation in the filesystem.
That is, 'й' can be represented as a single unicode codepoint (and likely is in your script), but in the NFD normalisation used by HFS+ the same character is represented using two codepoints (one of which is a combining character). Python string comparison compares code points and is not normalisation aware. For APFS (used by default in recent macOS versions) the situation is more complicated according to what I've found on Google. However, APFS doesn't seen to normalise names (I've created a file name 'й' and os.listdir() returns a name with a single codepoint). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42614> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com