# HG changeset patch # User Gregory Szorc # Date 2019-01-30 21:07:20 # Node ID fb28dc97e38fbba793d765caa08e46d50e13f219 # Parent b13280f7fead95b4465567f97160448a19377d22 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 diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -504,6 +504,7 @@ test-profile.t 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 diff --git a/mercurial/wireprotov1server.py b/mercurial/wireprotov1server.py --- a/mercurial/wireprotov1server.py +++ b/mercurial/wireprotov1server.py @@ -7,6 +7,7 @@ from __future__ import absolute_import +import binascii import os from .i18n import _ @@ -344,7 +345,7 @@ def find_pullbundle(repo, proto, opts, c 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: