You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Committed to 2.7 in r87515. On second thought there's no reason to forward port the test because Python3 doesn't have the equivalent type-promotion issues.
Activity
xnovakj commentedon Dec 13, 2005
Python: 2.4
Module: email.Header
Method: encode()
In some cases returns unicode (example on line 5)
1>> from email.Header import Header
2>> Header(unicode('abcá','iso-8859-2'),'utf-8').encode()
'=?utf-8?b?YWJjw6E=?='
3>> Header('abc','utf-8').encode()
'=?utf-8?q?abc?='
4>> Header(u'abc','utf-8').encode()
'abc' ???
5>> Header('abc','iso-8859-2').encode()
u'=?iso-8859-2?q?abc?=' (P2.4)
6>> Header('abc','iso-8859-2').encode()
'=?iso-8859-2?q?abc?=' (P2.3)
xnovakj commentedon Mar 23, 2009
I made some new tests in P2.6.1
but
but if you use alias latin-2 it's OK
Error is here for unicode input-charset:
self.input_charset->conv->self.output_charset
module email/charset.py line 219
for the charsets where aren't output conversions
and if you don't use alias
But the realy source of this error is on line 208
input_charset = unicode(input_charset, 'ascii')
because this construction returns unicode
[-]email.Header encode() unicode P2.3xP2.4[/-][+]email.Header encode() unicode P2.6[/+][-]email.Header encode() unicode P2.3xP2.4[/-][+]email.Header encode() unicode P2.6[/+]exarkun commentedon Jan 7, 2010
Any hope of this being fixed?
BreamoreBoy commentedon Aug 26, 2010
I believe that RDM is working on this sort of issue as part of email6.
bitdancer commentedon Aug 26, 2010
I've attached a fix and test. I've uploaded them separately since the fix only applies to 2.7, but I want to put the test into 3.x as well.
bitdancer commentedon Dec 27, 2010
Committed to 2.7 in r87515. On second thought there's no reason to forward port the test because Python3 doesn't have the equivalent type-promotion issues.