Patchwork [6,of,8,py3] util: use pycompat.bytestr in checkwinfilename

login
register
mail settings
Submitter Augie Fackler
Date March 19, 2017, 6:11 a.m.
Message ID <e9574463681c17cc07e3.1489903897@imladris.local>
Download mbox | patch
Permalink /patch/19444/
State Accepted
Headers show

Comments

Augie Fackler - March 19, 2017, 6:11 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489896968 14400
#      Sun Mar 19 00:16:08 2017 -0400
# Node ID e9574463681c17cc07e37073beecf16c1b3a82ab
# Parent  bd83fb13fb210ae13eb6325581e164966614f9c5
util: use pycompat.bytestr in checkwinfilename

Fixes `hg add` on python3.

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1177,7 +1177,7 @@  def checkwinfilename(path):
     for n in path.replace('\\', '/').split('/'):
         if not n:
             continue
-        for c in n:
+        for c in pycompat.bytestr(n):
             if c in _winreservedchars:
                 return _("filename contains '%s', which is reserved "
                          "on Windows") % c