# HG changeset patch # User Gregory Szorc # Date 2019-10-08 01:21:16 # Node ID c32531444cdc6fa75dd2aca262ff9e0df038c188 # Parent 5617b748aad8a54d5efe93cf1f003caa489e32db notify: cast hash to bytes This is needed to avoid a str/bytes mismatch when interpolating a line or 2 later. Differential Revision: https://phab.mercurial-scm.org/D7021 diff --git a/hgext/notify.py b/hgext/notify.py --- a/hgext/notify.py +++ b/hgext/notify.py @@ -161,6 +161,7 @@ from mercurial import ( logcmdutil, mail, patch, + pycompat, registrar, util, ) @@ -559,7 +560,10 @@ def messageid(ctx, domain, messageidseed host = encoding.strtolocal(socket.getfqdn()) if messageidseed: messagehash = hashlib.sha512(ctx.hex() + messageidseed) - messageid = b'' % (messagehash.hexdigest()[:64], host) + messageid = b'' % ( + pycompat.sysbytes(messagehash.hexdigest()[:64]), + host, + ) else: messageid = b'' % ( ctx,