D2167: py3: cast character set to bytes

2018-02-12 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6ea7f1c10c81: py3: cast character set to bytes (authored by 
indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2167?vs=5468=5590

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

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -187,7 +187,7 @@
 
 def codec2iana(cs):
 ''
-cs = email.charset.Charset(cs).input_charset.lower()
+cs = pycompat.sysbytes(email.charset.Charset(cs).input_charset.lower())
 
 # "latin1" normalizes to "iso8859-1", standard calls for "iso-8859-1"
 if cs.startswith("iso") and not cs.startswith("iso-"):



To: indygreg, #hg-reviewers, pulkit, durin42
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2167: py3: cast character set to bytes

2018-02-11 Thread indygreg (Gregory Szorc)
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The returned value from this function is eventually fed into
  email.charset.Charset.__init__. However, the standard library
  appears to handle both string types in Python 2 and 3. So there
  shouldn't be any problem returning a bytes here.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/mail.py

CHANGE DETAILS

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -187,7 +187,7 @@
 
 def codec2iana(cs):
 ''
-cs = email.charset.Charset(cs).input_charset.lower()
+cs = pycompat.sysbytes(email.charset.Charset(cs).input_charset.lower())
 
 # "latin1" normalizes to "iso8859-1", standard calls for "iso-8859-1"
 if cs.startswith("iso") and not cs.startswith("iso-"):



To: indygreg, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel