[PATCH 08 of 10] ui: pass string to ConfigError

timeless timeless at fmr.im
Wed May 11 21:23:16 EDT 2016


# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1461182731 0
#      Wed Apr 20 20:05:31 2016 +0000
# Node ID 25f8295b734c14c16273663d7a16066cb0abaa88
# Parent  0032690e7a78694700632fe1fed541ab2f2ff3b0
# Available At bb://timeless/mercurial-crew
#              hg pull bb://timeless/mercurial-crew -r 25f8295b734c
ui: pass string to ConfigError

diff -r 0032690e7a78 -r 25f8295b734c mercurial/ui.py
--- a/mercurial/ui.py	Tue Apr 19 16:31:10 2016 +0000
+++ b/mercurial/ui.py	Wed Apr 20 20:05:31 2016 +0000
@@ -178,7 +178,7 @@
         except error.ConfigError as inst:
             if trusted:
                 raise
-            self.warn(_("ignored: %s\n") % str(inst))
+            self.warn(_("ignored: %s\n").decode('utf-8') % str(inst))
 
         if self.plain():
             for k in ('debug', 'fallbackencoding', 'quiet', 'slash',
@@ -358,7 +358,7 @@
             return v
         b = util.parsebool(v)
         if b is None:
-            raise error.ConfigError(_("%s.%s is not a boolean ('%s')")
+            raise error.ConfigError(_("%s.%s is not a boolean ('%s')").decode('utf-8')
                                     % (section, name, v))
         return b
 
@@ -387,7 +387,7 @@
         try:
             return int(v)
         except ValueError:
-            raise error.ConfigError(_("%s.%s is not an integer ('%s')")
+            raise error.ConfigError(_("%s.%s is not an integer ('%s')").decode('utf-8')
                                     % (section, name, v))
 
     def configbytes(self, section, name, default=0, untrusted=False):
@@ -420,7 +420,7 @@
         try:
             return util.sizetoint(value)
         except error.ParseError:
-            raise error.ConfigError(_("%s.%s is not a byte quantity ('%s')")
+            raise error.ConfigError(_("%s.%s is not a byte quantity ('%s')").decode('utf-8')
                                     % (section, name, value))
 
     def configlist(self, section, name, default=None, untrusted=False):


More information about the Mercurial-devel mailing list