From: Mark Wooding Date: Sat, 1 Jun 2024 03:24:08 +0000 (+0100) Subject: fshash.in: Use `binascii.hexlify' rather than `str.encode("hex")'. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/rsync-backup/commitdiff_plain/54742e7156e035523026245dd1ff27468a411e9a?ds=sidebyside fshash.in: Use `binascii.hexlify' rather than `str.encode("hex")'. The latter was a much better notation, so it was dropped from Python 3. --- diff --git a/fshash.in b/fshash.in index 467cddd..1f1a34d 100644 --- a/fshash.in +++ b/fshash.in @@ -24,6 +24,7 @@ ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. from sys import argv, exc_info, exit, stdin, stdout, stderr +import binascii as B import errno as E import hashlib as H import optparse as OP @@ -301,7 +302,7 @@ class HashCache (object): fi.st = None fi.err = excval() return None - hash = hash.encode('hex') + hash = B.hexlify(hash) ## Insert a record into the database. if me._db: