D2459: py3: use encoding.strtolocal() to convert str to bytes

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Mon Feb 26 18:53:33 UTC 2018


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2459

AFFECTED FILES
  hgext/patchbomb.py

CHANGE DETAILS

diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -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



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list