posix: always pass a native str to unicodedata.normalize's first arg
authorAugie Fackler <raf@durin42.com>
Fri, 15 Sep 2017 19:44:32 -0400
changeset 39694 d477498074648382c023656e94ce0a0c7830f7a3
parent 39693 310c151a07055a0d209bb7b63c241fa3cb2af808
child 39695 3a5d8e2996f897b6f13997e65bce63963e27fb4f
push id569
push usergszorc@mozilla.com
push dateSat, 23 Sep 2017 03:02:59 +0000
posix: always pass a native str to unicodedata.normalize's first arg
mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -374,17 +374,17 @@ if pycompat.sysplatform == 'darwin':
                 except ValueError:
                     c = '%%%02X' % ord(path[pos:pos + 1])
                     pos += 1
                 s += c
 
             u = s.decode('utf-8')
 
         # Decompose then lowercase (HFS+ technote specifies lower)
-        enc = unicodedata.normalize('NFD', u).lower().encode('utf-8')
+        enc = unicodedata.normalize(r'NFD', u).lower().encode('utf-8')
         # drop HFS+ ignored characters
         return encoding.hfsignoreclean(enc)
 
 if pycompat.sysplatform == 'cygwin':
     # workaround for cygwin, in which mount point part of path is
     # treated as case sensitive, even though underlying NTFS is case
     # insensitive.