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

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2018, 6:53 p.m.
Message ID <differential-rev-PHID-DREV-dv4jblsbpfwocmzq2xfd-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28417/
State Superseded
Headers show

Comments

phabricator - Feb. 26, 2018, 6:53 p.m.
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




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

Patch

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