# HG changeset patch # User Augie Fackler # Date 1489303730 14400 # Node ID d57aa655ce97011855867ee8c9bed2439b7ded9a # Parent d30fb3de4b403209b09c14e4ccaee5fb80accbbf lock: encode result of gethostname into a bytestring diff -r d30fb3de4b40 -r d57aa655ce97 mercurial/lock.py --- a/mercurial/lock.py Sun Mar 12 12:56:12 2017 -0700 +++ b/mercurial/lock.py Sun Mar 12 03:28:50 2017 -0400 @@ -15,6 +15,7 @@ import warnings from . import ( + encoding, error, pycompat, util, @@ -27,7 +28,8 @@ confidence. Typically it's just hostname. On modern linux, we include an extra Linux-specific pid namespace identifier. """ - result = socket.gethostname() + result = socket.gethostname().encode( + pycompat.sysstr(encoding.encoding), 'replace') if pycompat.sysplatform.startswith('linux'): try: result += '/%x' % os.stat('/proc/self/ns/pid').st_ino