changeset 34733:115efdd97088

peer: ensure command names are always ascii bytestrs Differential Revision: https://phab.mercurial-scm.org/D1104
author Augie Fackler <augie@google.com>
date Sun, 15 Oct 2017 00:05:00 -0400
parents 67e9678efd98
children 3572b2031cec
files mercurial/peer.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/peer.py	Sun Oct 15 00:03:31 2017 -0400
+++ b/mercurial/peer.py	Sun Oct 15 00:05:00 2017 -0400
@@ -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