This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients barry, christian.heimes, donmez, draghuram, exarkun, janssen, loewis, nnorwitz, rtmq, vstinner
Date 2008-10-14.22:14:02
SpamBayes Score 2.9125086e-10
Marked as misclassified No
Message-id <1224022445.55.0.222886605619.issue1210@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-10-14 22:14:05vstinnersetrecipients: + vstinner, loewis, barry, nnorwitz, exarkun, janssen, draghuram, christian.heimes, donmez, rtmq
2008-10-14 22:14:05vstinnersetmessageid: <1224022445.55.0.222886605619.issue1210@psf.upfronthosting.co.za>
2008-10-14 22:14:05vstinnerlinkissue1210 messages
2008-10-14 22:14:04vstinnercreate