[issue6734] Imap lib implicit conversion from bytes to string

2011-06-19 Thread R. David Murray
R. David Murray added the comment: This was fixed in issue 4471 by Antoine when he added some tests that call login. He fixed it by changing _quote to work with strings. Per the discussion here I'm not sure this is the best fix, but until someone reports a bug with it it we may as well let

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-21 Thread Marcin Bachry
Marcin Bachry added the comment: Ok, it think it's good to leave internal _quote() function operating on bytes and convert password argument in login(). The method now works with both str and bytes as arguments. -- keywords: +patch Added file: http://bugs.python.org/file14752/imaplib-lo

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-20 Thread STINNER Victor
STINNER Victor added the comment: > It seems most IMAP4 methods accept str as arguments right now (I > checked: list, lsub, myrights, select, status, search, fetch) and > login() is a sole exception. I know the protocol is mostly ascii only, > but still having possibility of using str in the API

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-20 Thread Marcin Bachry
Marcin Bachry added the comment: It seems most IMAP4 methods accept str as arguments right now (I checked: list, lsub, myrights, select, status, search, fetch) and login() is a sole exception. I know the protocol is mostly ascii only, but still having possibility of using str in the API feels co

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-20 Thread STINNER Victor
STINNER Victor added the comment: > I can't find any reference to needing to encode information > myself for the login procedure. Is there some other > documentation you are referring to? Exactly, the Python imaplib documentation should be fixed (the doc, not the code). -- _

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-20 Thread Eric
Eric added the comment: I checked the latest documentation for 3.1.1 (http://docs.python.org/3.1/library/imaplib.html), but I can't find any reference to needing to encode information myself for the login procedure. Is there some other documentation you are referring to? In any case, the error

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-19 Thread STINNER Victor
STINNER Victor added the comment: IMAP4 protocol uses bytes, not characters. There is no "standard charset", so you have to encode (manually) your login and password as bytes. login method prototype: IMAP4.login(login: bytes, password: bytes) You server may use UTF-8, but another server may u

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-19 Thread R. David Murray
R. David Murray added the comment: See issue 1210 for background on the imaplib bytes/string issues. A quick glance at the imaplib code leaves me confused. _checkquote, for example, appears to be mixing string comparisons and byte comparisons. Issue 1210 says imaplib _command should only quot

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-19 Thread Eric
New submission from Eric : using imaplib IMAP4_SSL, would fail at login due to TypeError, implicit conversion from bytes object to string around line 1068 involving function "_quote". My fix: def _quote(self, arg): #Could not implicitly convert to bytes object to string arg = a