Patchwork D2460: py3: convert bytes to str using encoding.strfromlocal

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2018, 6:53 p.m.
Message ID <differential-rev-PHID-DREV-l3uhl52qrsau6miyiloq-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28418/
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.

REVISION SUMMARY
  using encoding.strfromlocal because sender is provided from user config or
  argument.

REPOSITORY
  rHG Mercurial

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

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
@@ -748,7 +748,7 @@ 
         if not parent.endswith('>'):
             parent += '>'
 
-    sender_addr = eutil.parseaddr(sender)[1]
+    sender_addr = eutil.parseaddr(encoding.strfromlocal(sender))[1]
     sender = mail.addressencode(ui, sender, _charsets, opts.get('test'))
     sendmail = None
     firstpatch = None