Patchwork D1104: peer: ensure command names are always ascii bytestrs

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2017, 1:31 a.m.
Message ID <differential-rev-PHID-DREV-6ivbyfhwfeln5hkk4mmu-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/24963/
State Superseded
Headers show

Comments

phabricator - Oct. 16, 2017, 1:31 a.m.
durin42 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/D1104

AFFECTED FILES
  mercurial/peer.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 16, 2017, 9:15 a.m.
ryanmce accepted this revision.
ryanmce added a comment.
This revision is now accepted and ready to land.


  queued

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers, ryanmce
Cc: ryanmce, mercurial-devel

Patch

diff --git a/mercurial/peer.py b/mercurial/peer.py
--- a/mercurial/peer.py
+++ b/mercurial/peer.py
@@ -10,6 +10,7 @@ 
 
 from . import (
     error,
+    pycompat,
     util,
 )
 
@@ -92,7 +93,8 @@ 
         if not encresref:
             return encargsorres # a local result in this case
         self = args[0]
-        encresref.set(self._submitone(f.__name__, encargsorres))
+        cmd = pycompat.bytesurl(f.__name__)  # ensure cmd is ascii bytestr
+        encresref.set(self._submitone(cmd, encargsorres))
         return next(batchable)
     setattr(plain, 'batchable', f)
     return plain