[issue5305] imaplib should support international mailbox names
C Fraire added the comment: the twisted imap API is problematic for imaplib because twisted seems to expect its arguments to already be Python unicode. Could you elaborate on this? As far as I can tell, it works fine: I wasn't addressing encode/decode specifically. Both twisted and PloneMailList offer implementations with same encoding name, imap4-utf-7. I meant that it's difficult for the twisted API to inform what might be done for imaplib since twisted takes full unicode but imaplib expects only unicode-ASCII subset. The first part of jamesh's original issue is just encoder/decoder, so either twisted or PloneMailList would seem to suffice. I was addressing jamesh's second part whether optionally if imaplib would perform the encoding and decoding at the appropriate points. Point 2 of my response seems the more difficult. imaplib list and lsub return str instances with ASCII + utf-7 stuffed together. (twisted avoids this by returning tuples of unicode, if I understand correctly). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5305] imaplib should support international mailbox names
C Fraire cfra...@yahoo.com added the comment: I've used the PloneMailList implementation in another project. It works well to add 'imap4-utf-7' as codec. The twisted imap implementation seems to have been updated to properly support non-printable ASCII, but the twisted imap API is problematic for imaplib because twisted seems to expect its arguments to already be Python unicode. So can we be specific about what kind of API change would satisfy this issue: 1) a number of API methods take one or more mailbox arguments. Of course, imaplib currently expects these to be ASCII, but what kind of argument should the methods take? UTF? Unicode? So would the library need a class property to describe an optional specified input encoding? Would it be expected to take Python unicode? 2) some methods, such as list and lsub, return mailbox names UTF-7 encoded and embedded in larger ASCII strings. Would imaplib be expected to alter the contents of these large strings and transform them into another other encoding (when a switch as described in 1) is active)? -- nosy: +cfraire ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5305 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com