Patchwork [Bug,5767] New: python3 hg status causes less to emit a "Number is required after -b" waring

login
register
mail settings
Submitter mercurial-bugs@mercurial-scm.org
Date Jan. 6, 2018, 9:31 a.m.
Message ID <bug-5767-285@https.bz.mercurial-scm.org/>
Download mbox | patch
Permalink /patch/26590/
State Not Applicable
Headers show

Comments

mercurial-bugs@mercurial-scm.org - Jan. 6, 2018, 9:31 a.m.
https://bz.mercurial-scm.org/show_bug.cgi?id=5767

            Bug ID: 5767
           Summary: python3 hg status causes less to emit a "Number is
                    required after -b" waring
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: normal
         Component: pager
          Assignee: bugzilla@mercurial-scm.org
          Reporter: shlomif@shlomifish.org
                CC: mercurial-devel@mercurial-scm.org

shlomif@telaviv1:~/Download/unpack/file/vcs/hg$ python3.6 hg status
Number is required after -b
There is no -' option ("less --help" for help)
-  (press RETURN)

it is fine with python2.

This tentative change fixes it for both versions:

Patch

diff -r 31fe397f2bda mercurial/util.py
--- a/mercurial/util.py Wed Dec 27 00:24:53 2017 +0530
+++ b/mercurial/util.py Sat Jan 06 16:31:02 2018 +0200
@@ -1153,7 +1153,7 @@ 
             return '0'
         if val is True:
             return '1'
-        return str(val)
+        return val.decode('utf-8')
     env = dict(encoding.environ)
     if environ:
         env.update((k, py2shell(v)) for k, v in environ.iteritems())