Message74775
The server can send raw 8 bits email in any charset (charset is
specified in the email headers). That's why I think that it's better
to keep bytes instead of the unicode conversion using a fixed charset.
Each email can use a different charset.
Types used in my new patch:
- unicode:
* IMAP commands (charset=ASCII)
* untagged_responses keys (charset=ASCII)
- bytes:
* answer
* regex
* tagre attribute
* untagged_responses values
I chooosed to keep unicode for some variables to minimize the changes
in imaplib library and to keep readable code.
Patch TODO:
- Remove the assert (added for quicker debugging)
- Test more functions
- Restore _checkquote() in _command() method or use
_quote()/_checkquote() in method which need it. login() already quote
the password (but why not the login?)
I also wrote a patch for a "pure bytes string" version, but the patch
is complex, long and the resulting module source code is hard to read. |
|
Date |
User |
Action |
Args |
2008-10-14 22:14:05 | vstinner | set | recipients:
+ vstinner, loewis, barry, nnorwitz, exarkun, janssen, draghuram, christian.heimes, donmez, rtmq |
2008-10-14 22:14:05 | vstinner | set | messageid: <1224022445.55.0.222886605619.issue1210@psf.upfronthosting.co.za> |
2008-10-14 22:14:05 | vstinner | link | issue1210 messages |
2008-10-14 22:14:04 | vstinner | create | |
|