STINNER Victor <[EMAIL PROTECTED]> added the comment: New patch: resp() returns bytes - self.file is now a binary file - encode commands using POP3.encoding charset, default is UTF-8 - use md5.hexdigest() - factorize POP3_SSL code: code specific for SSL is just the creation of the socket
The default charset is UTF-8, but most servers only accept pure ASCII login/password (eg. gmail.com) or a smaller subset of ASCII (eg. only A-Z, a-z, 0-9 and some ponctuation signs :-/). If you user non-ASCII login/password and your server doesn't use UTF-8, change POP3.encoding or <your pop object>.encoding (encoding is not used in the constructor). welcome attribute (and getwelcome() results) is a bytes string. You have to parse the message headers to get the right charset to decode bytes to unicode characters. A multipart message may contains two or more charsets and different encoding. But poplib is not responsible to decode messages, just to download a message as bytes. Arguments (username (login), password, a message identifier) are unicode strings. For a message identifier, you can also use an integer (nothing new, it was already possible). I hope that apop() works. No Python error is raised but no server does support his authentication method. I tested 3 servers (pop3.haypocalc.com, pop.laposte.net and pop.gmail.com) and none supports APOP. I tested POP3 and POP3_SSL (gmail requires SSL). Added file: http://bugs.python.org/file11812/poplib-bytes.patch _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3727> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com