posix: fix HFS+ normcase doctest to produce valid bytes literals in Python 3
authorAugie Fackler <raf@durin42.com>
Fri, 15 Sep 2017 19:43:02 -0400
changeset 39691 90b0e1639fd48059b5583cc322ce827c42230bb0
parent 39690 402efa8421b8a8a66a69b44415c2e1f7d2580cbe
child 39692 112f118ecb00c9ba265ecceac22c17a0d23b537b
push id569
push usergszorc@mozilla.com
push dateSat, 23 Sep 2017 03:02:59 +0000
posix: fix HFS+ normcase doctest to produce valid bytes literals in Python 3 We were previously getting lucky on Python 2.
mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -339,21 +339,21 @@ if pycompat.sysplatform == 'darwin':
         Normalize a filename for OS X-compatible comparison:
         - escape-encode invalid characters
         - decompose to NFD
         - lowercase
         - omit ignored characters [200c-200f, 202a-202e, 206a-206f,feff]
 
         >>> normcase(b'UPPER')
         'upper'
-        >>> normcase(b'Caf\xc3\xa9')
+        >>> normcase(b'Caf\\xc3\\xa9')
         'cafe\\xcc\\x81'
-        >>> normcase(b'\xc3\x89')
+        >>> normcase(b'\\xc3\\x89')
         'e\\xcc\\x81'
-        >>> normcase(b'\xb8\xca\xc3\xca\xbe\xc8.JPG') # issue3918
+        >>> normcase(b'\\xb8\\xca\\xc3\\xca\\xbe\\xc8.JPG') # issue3918
         '%b8%ca%c3\\xca\\xbe%c8.jpg'
         '''
 
         try:
             return encoding.asciilower(path)  # exception for non-ASCII
         except UnicodeDecodeError:
             return normcasefallback(path)