Patchwork D2208: ui: use pycompat.bytestr() to get a bytes-repr of config default

login
register
mail settings
Submitter phabricator
Date Feb. 13, 2018, 3:30 a.m.
Message ID <differential-rev-PHID-DREV-qor2jo4cplmhomwhg5tn-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27781/
State Superseded
Headers show

Comments

phabricator - Feb. 13, 2018, 3:30 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We don't know what type we'll get here, so we need something that'll
  behave like a repr without returning a unicode.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2208

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -498,7 +498,7 @@ 
               and default != itemdefault):
             msg = ("specifying a mismatched default value for a registered "
                    "config item: '%s.%s' '%s'")
-            msg %= (section, name, default)
+            msg %= (section, name, pycompat.bytestr(default))
             self.develwarn(msg, 2, 'warn-config-default')
 
         for s, n in alternates: