Patchwork D2166: py3: cast decode() argument to system string

login
register
mail settings
Submitter phabricator
Date Feb. 13, 2018, 2:48 a.m.
Message ID <847d131fbe16ac70fd99701f0bb75c2e@localhost.localdomain>
Download mbox | patch
Permalink /patch/27767/
State Not Applicable
Headers show

Comments

phabricator - Feb. 13, 2018, 2:48 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9e47bfbeb723: py3: cast decode() argument to system string (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2166?vs=5467&id=5589

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

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -206,7 +206,7 @@ 
         return mimetextqp(s, subtype, 'us-ascii')
     for charset in cs:
         try:
-            s.decode(charset)
+            s.decode(pycompat.sysstr(charset))
             return mimetextqp(s, subtype, codec2iana(charset))
         except UnicodeDecodeError:
             pass