From 3d79793ee855b8e385797fcc72ed5e38f0789d03 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Thu, 17 Sep 2020 15:38:08 -0400 Subject: [PATCH] Try to fix hashutil. --- src/allmydata/util/hashutil.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/allmydata/util/hashutil.py b/src/allmydata/util/hashutil.py index 46f361287..ebb2f12af 100644 --- a/src/allmydata/util/hashutil.py +++ b/src/allmydata/util/hashutil.py @@ -11,7 +11,9 @@ from __future__ import unicode_literals from future.utils import PY2 if PY2: # Don't import bytes to prevent leaking future's bytes. - from builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, dict, list, object, range, str, max, min # noqa: F401 + from builtins import filter, map, zip, ascii, chr, hex, input, next, oct, open, pow, round, super, dict, list, object, range, str, max, min, bytes as future_bytes # noqa: F401 +else: + future_bytes = bytes from past.builtins import chr as byteschr @@ -214,7 +216,7 @@ def bucket_cancel_secret_hash(file_cancel_secret, peerid): def _xor(a, b): - return b"".join([byteschr(c ^ b) for c in a]) + return b"".join([byteschr(c ^ b) for c in future_bytes(a)]) def hmac(tag, data):