Patchwork D2144: py3: more robustly cast UUID to bytes

login
register
mail settings
Submitter phabricator
Date Feb. 12, 2018, 1:40 a.m.
Message ID <82ea0f0e4915da5dc1be22ef87399e0c@localhost.localdomain>
Download mbox | patch
Permalink /patch/27612/
State Not Applicable
Headers show

Comments

phabricator - Feb. 12, 2018, 1:40 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG223ed0b53f08: py3: more robustly cast UUID to bytes (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2144?vs=5429&id=5445

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

AFFECTED FILES
  mercurial/sshpeer.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -220,7 +220,7 @@ 
 
     # Generate a random token to help identify responses to version 2
     # upgrade request.
-    token = bytes(uuid.uuid4())
+    token = pycompat.sysbytes(str(uuid.uuid4()))
     upgradecaps = [
         ('proto', wireprotoserver.SSHV2),
     ]