Patchwork [4,of,4,python3] posix: always pass a native str to unicodedata.normalize's first arg

login
register
mail settings
Submitter Augie Fackler
Date Sept. 16, 2017, 12:34 a.m.
Message ID <4fd8345c78af58b6303a.1505522046@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/23932/
State Accepted
Headers show

Comments

Augie Fackler - Sept. 16, 2017, 12:34 a.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1505519072 14400
#      Fri Sep 15 19:44:32 2017 -0400
# Node ID 4fd8345c78af58b6303a06590a83b8fd6c8fa00f
# Parent  8a1f211ac2afb3e49a15def443b7f556ee3c0d47
posix: always pass a native str to unicodedata.normalize's first arg

Patch

diff --git a/mercurial/posix.py b/mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -379,7 +379,7 @@  if pycompat.sysplatform == 'darwin':
             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)