changeset 36449:a918c996a881

py3: use encoding.strtolocal() to convert str to bytes Differential Revision: https://phab.mercurial-scm.org/D2459
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 26 Feb 2018 23:50:30 +0530
parents 39c9f339b692
children d478c8cd89d1
files hgext/patchbomb.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/patchbomb.py	Mon Feb 26 16:19:53 2018 +0530
+++ b/hgext/patchbomb.py	Mon Feb 26 23:50:30 2018 +0530
@@ -85,6 +85,7 @@
 from mercurial import (
     cmdutil,
     commands,
+    encoding,
     error,
     formatter,
     hg,
@@ -669,7 +670,8 @@
         start_time = util.makedate()
 
     def genmsgid(id):
-        return '<%s.%d@%s>' % (id[:20], int(start_time[0]), socket.getfqdn())
+        return '<%s.%d@%s>' % (id[:20], int(start_time[0]),
+                               encoding.strtolocal(socket.getfqdn()))
 
     # deprecated config: patchbomb.from
     sender = (opts.get('from') or ui.config('email', 'from') or