From patchwork Wed Sep 27 12:34:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3, of, 5] py3: manually escape control character to be embedded in win filename error From: Yuya Nishihara X-Patchwork-Id: 24182 Message-Id: <1f783de54c8cce12807b.1506515680@mimosa> To: mercurial-devel@mercurial-scm.org Date: Wed, 27 Sep 2017 21:34:40 +0900 # HG changeset patch # User Yuya Nishihara # 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 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 "