D2259: py3: use pycompat.bytestr to convert int/bytes to bytes

2018-02-14 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.


  > The item value can be integer or can be bytes, so cannot use "%d" here.
  
  Sounds like a bug. IIUC, the item should be a byte string because it is
  passed to `ui.progress(item=)`. Can you take a look?

REPOSITORY
  rHG Mercurial

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

To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2259: py3: use pycompat.bytestr to convert int/bytes to bytes

2018-02-14 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The item value can be integer or can be bytes, so cannot use "%d" here.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/worker.py

CHANGE DETAILS

diff --git a/mercurial/worker.py b/mercurial/worker.py
--- a/mercurial/worker.py
+++ b/mercurial/worker.py
@@ -156,7 +156,7 @@
 def workerfunc():
 os.close(rfd)
 for i, item in func(*(staticargs + (pargs,))):
-os.write(wfd, '%d %s\n' % (i, item))
+os.write(wfd, '%d %s\n' % (i, pycompat.bytestr(item)))
 return 0
 
 ret = scmutil.callcatch(ui, workerfunc)



To: pulkit, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel