wireprotov1server: use binascii.unhexlify
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 30 Jan 2019 13:07:20 -0800
changeset 41468 9cb51e74e9ad
parent 41467 1016b81fa43e
child 41469 c9ff93889550
wireprotov1server: use binascii.unhexlify The "hex" codec doesn't exist in Python 3. We could use `codecs.decode(h, 'hex_codec')`. But `binascii.unhexlify()` exists and should work the same on Python 2 and 3. Differential Revision: https://phab.mercurial-scm.org/D5755
contrib/python3-whitelist
mercurial/wireprotov1server.py
--- a/contrib/python3-whitelist	Wed Jan 30 12:55:44 2019 -0800
+++ b/contrib/python3-whitelist	Wed Jan 30 13:07:20 2019 -0800
@@ -504,6 +504,7 @@
 test-progress.t
 test-propertycache.py
 test-pull-branch.t
+test-pull-bundle.t
 test-pull-http.t
 test-pull-permission.t
 test-pull-pull-corruption.t
--- a/mercurial/wireprotov1server.py	Wed Jan 30 12:55:44 2019 -0800
+++ b/mercurial/wireprotov1server.py	Wed Jan 30 13:07:20 2019 -0800
@@ -7,6 +7,7 @@
 
 from __future__ import absolute_import
 
+import binascii
 import os
 
 from .i18n import _
@@ -344,7 +345,7 @@
       one specific branch of many.
     """
     def decodehexstring(s):
-        return set([h.decode('hex') for h in s.split(';')])
+        return set([binascii.unhexlify(h) for h in s.split(';')])
 
     manifest = repo.vfs.tryread('pullbundles.manifest')
     if not manifest: