Message93100
When stream is codecs.writer object, stream.write(string) does
string.decode() internally and it may cause UnicodeDecodeError.
Then, fallback to utf-8 is not good.
I think good fallback logic is:
* When message is unicode, message.encode(stream.encoding or 'ascii',
'backslashreplace')
* When message is bytes, message.encode('string_escape')
Attached patch contains this logic, refactoring and test. |
|
Date |
User |
Action |
Args |
2009-09-25 05:29:27 | methane | set | recipients:
+ methane |
2009-09-25 05:29:27 | methane | set | messageid: <1253856567.46.0.952425276077.issue6991@psf.upfronthosting.co.za> |
2009-09-25 05:29:25 | methane | link | issue6991 messages |
2009-09-25 05:29:24 | methane | create | |
|