diff mercurial/scmutil.py @ 41442:b6673e9bdcf6

dispatch: quote filename in IOError as well It's explicitly added for OSError at 720308f741cb "dispatch: show empty filename in OSError aborts". Let's do the same for IOError.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 26 Jan 2019 17:51:55 +0900
parents b5169e79c31c
children f83b230b7fb3
line wrap: on
line diff
--- a/mercurial/scmutil.py	Sat Jan 26 17:44:07 2019 +0900
+++ b/mercurial/scmutil.py	Sat Jan 26 17:51:55 2019 +0900
@@ -248,8 +248,8 @@
               and inst.args and inst.args[0] == errno.EPIPE):
             pass
         elif getattr(inst, "strerror", None): # common IOError
-            if getattr(inst, "filename", None):
-                ui.error(_("abort: %s: %s\n") % (
+            if getattr(inst, "filename", None) is not None:
+                ui.error(_("abort: %s: '%s'\n") % (
                     encoding.strtolocal(inst.strerror),
                     stringutil.forcebytestr(inst.filename)))
             else: