Patchwork D2274: py3: stringify integer with %d instead of bytes()

login
register
mail settings
Submitter phabricator
Date Feb. 15, 2018, 12:42 a.m.
Message ID <differential-rev-PHID-DREV-u7kq3254oiipgdrxnvyi-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27936/
State Superseded
Headers show

Comments

phabricator - Feb. 15, 2018, 12:42 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The unbundle wire protocol command now returns a properly formatted
  reply in Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/wireprotoserver.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -445,7 +445,7 @@ 
                 _sshv1respondstream(self._fout, rsp)
             elif isinstance(rsp, wireprototypes.pushres):
                 _sshv1respondbytes(self._fout, b'')
-                _sshv1respondbytes(self._fout, bytes(rsp.res))
+                _sshv1respondbytes(self._fout, b'%d' % rsp.res)
             elif isinstance(rsp, wireprototypes.pusherr):
                 _sshv1respondbytes(self._fout, rsp.res)
             elif isinstance(rsp, wireprototypes.ooberror):