Patchwork D3569: py3: convert the report to bytes

login
register
mail settings
Submitter phabricator
Date May 16, 2018, 2:49 a.m.
Message ID <differential-rev-PHID-DREV-guddics2u2o5xrtyjsec-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/31618/
State Superseded
Headers show

Comments

phabricator - May 16, 2018, 2:49 a.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/dispatch.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
Yuya Nishihara - May 16, 2018, 11:35 a.m.
> --- a/mercurial/dispatch.py
> +++ b/mercurial/dispatch.py
> @@ -1028,7 +1028,7 @@
>                       '** which supports versions %s of Mercurial.\n'
>                       '** Please disable %s and try your action again.\n'
>                       '** If that fixes the bug please report it to %s\n')
> -                   % (name, testedwith, name, report))
> +                   % (name, testedwith, name, pycompat.bytestr(report)))

Maybe stringutil.forcebytestr()?

The report must be bytes, but a broken extension might provide a unicode
for example, and a unicode can't always be byte-ified with bytestr().
phabricator - May 16, 2018, 11:42 a.m.
yuja added a comment.


  >   - a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -1028,7 +1028,7 @@ '** which supports versions %s of Mercurial.\n' '** Please disable %s and try your action again.\n' '** If that fixes the bug please report it to %s\n')
  > - % (name, testedwith, name, report)) +                   % (name, testedwith, name, pycompat.bytestr(report)))
  
  Maybe stringutil.forcebytestr()?
  
  The report must be bytes, but a broken extension might provide a unicode
  for example, and a unicode can't always be byte-ified with bytestr().

REPOSITORY
  rHG Mercurial

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

To: pulkit, #hg-reviewers
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -1028,7 +1028,7 @@ 
                      '** which supports versions %s of Mercurial.\n'
                      '** Please disable %s and try your action again.\n'
                      '** If that fixes the bug please report it to %s\n')
-                   % (name, testedwith, name, report))
+                   % (name, testedwith, name, pycompat.bytestr(report)))
     else:
         bugtracker = ui.config('ui', 'supportcontact')
         if bugtracker is None: