From 28d78a7487d860397e1f2fe579a5096af41eb58f Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 18 Apr 2020 23:28:59 +0200 Subject: [PATCH] fsck: stop using .encode('hex') An error path is using this still, use hexlify() instead. Signed-off-by: Johannes Berg Reviewed-by: Rob Browning --- cmd/fsck-cmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/fsck-cmd.py b/cmd/fsck-cmd.py index 14a32c8..293024e 100755 --- a/cmd/fsck-cmd.py +++ b/cmd/fsck-cmd.py @@ -10,6 +10,7 @@ import sys, os, glob, subprocess from shutil import rmtree from subprocess import PIPE, Popen from tempfile import mkdtemp +from binascii import hexlify from bup import options, git from bup.compat import argv_bytes @@ -109,7 +110,7 @@ def quick_verify(base): for b in chunkyreader(f, os.fstat(f.fileno()).st_size - 20): sum.update(b) if sum.digest() != wantsum: - raise ValueError('expected %r, got %r' % (wantsum.encode('hex'), + raise ValueError('expected %r, got %r' % (hexlify(wantsum), sum.hexdigest())) -- 2.39.2