Patchwork [3,of,5] py3: manually escape control character to be embedded in win filename error

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 27, 2017, 12:34 p.m.
Message ID <1f783de54c8cce12807b.1506515680@mimosa>
Download mbox | patch
Permalink /patch/24182/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 27, 2017, 12:34 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1506507088 -32400
#      Wed Sep 27 19:11:28 2017 +0900
# Node ID 1f783de54c8cce12807b92f41a670d16fbbad6aa
# Parent  40669eaa31e2c2371481fc50f7ed725b17063f6e
py3: manually escape control character to be embedded in win filename error

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1284,8 +1284,8 @@  def checkwinfilename(path):
                 return _("filename contains '%s', which is reserved "
                          "on Windows") % c
             if ord(c) <= 31:
-                return _("filename contains %r, which is invalid "
-                         "on Windows") % c
+                return _("filename contains '%s', which is invalid "
+                         "on Windows") % escapestr(c)
         base = n.split('.')[0]
         if base and base.lower() in _winreservednames:
             return _("filename contains '%s', which is reserved "