Patchwork [4,of,4] py3: use bytes() to byte-stringify Abort message in handleremotechangegroup()

login
register
mail settings
Submitter Yuya Nishihara
Date July 12, 2018, 2:17 p.m.
Message ID <ef9f6f9a5d37b9159b9e.1531405050@mimosa>
Download mbox | patch
Permalink /patch/32817/
State Accepted
Headers show

Comments

Yuya Nishihara - July 12, 2018, 2:17 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1531047155 -32400
#      Sun Jul 08 19:52:35 2018 +0900
# Node ID ef9f6f9a5d37b9159b9e8b31749b57805c5811b3
# Parent  e06128d929f7ae7bde69af75d6030e4a71db4fba
py3: use bytes() to byte-stringify Abort message in handleremotechangegroup()

Patch

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -41,6 +41,7 @@  test-bundle2-exchange.t
 test-bundle2-format.t
 test-bundle2-multiple-changegroups.t
 test-bundle2-pushback.t
+test-bundle2-remote-changegroup.t
 test-cappedreader.py
 test-casecollision.t
 test-cat.t
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1878,7 +1878,7 @@  def handleremotechangegroup(op, inpart):
         real_part.validate()
     except error.Abort as e:
         raise error.Abort(_('bundle at %s is corrupted:\n%s') %
-            (util.hidepassword(raw_url), str(e)))
+                          (util.hidepassword(raw_url), bytes(e)))
     assert not inpart.read()
 
 @parthandler('reply:changegroup', ('return', 'in-reply-to'))