Patchwork D3324: py3: use stringutil.forcebytestr() instead of str()

login
register
mail settings
Submitter phabricator
Date April 13, 2018, 8:48 p.m.
Message ID <differential-rev-PHID-DREV-oxkqmvjcvqkmyvistesy-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30886/
State Superseded
Headers show

Comments

phabricator - April 13, 2018, 8:48 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We need to convert errors to bytes using stringutil.forcebytestr()

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/exchange.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel
phabricator - April 14, 2018, 3:07 a.m.
yuja added a comment.


  FYI, this one could be just `bytes(e)`.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -2257,7 +2257,7 @@ 
                     continue
 
             except error.InvalidBundleSpecification as e:
-                repo.ui.debug(str(e) + '\n')
+                repo.ui.debug(stringutil.forcebytestr(e) + '\n')
                 continue
             except error.UnsupportedBundleSpecification as e:
                 repo.ui.debug('filtering %s because unsupported bundle '