Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #20665 > unrolled thread
| Started by | Petite Abeille <petite.abeille@gmail.com> |
|---|---|
| First post | 2012-02-21 10:31 +0100 |
| Last post | 2012-02-21 10:31 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
[bug] imaplib case sensitive Petite Abeille <petite.abeille@gmail.com> - 2012-02-21 10:31 +0100
| From | Petite Abeille <petite.abeille@gmail.com> |
|---|---|
| Date | 2012-02-21 10:31 +0100 |
| Subject | [bug] imaplib case sensitive |
| Message-ID | <mailman.31.1329816701.3037.python-list@python.org> |
Hello,
Looks like imaplib is case sensitive, even though the IMAP protocol isn't:
(1) Except as noted otherwise, all alphabetic characters
are case-insensitive. The use of upper or lower case
characters to define token strings is for editorial clarity
only. Implementations MUST accept these strings in a
case-insensitive fashion.
http://tools.ietf.org/html/rfc3501#section-9
For example:
[Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) ]
[imaplib 2.58]
import imaplib
M = imaplib.IMAP4( 'localhost', 1143 )
M.login( 'user', 'password' )
M.select()
typ, data = M.search(None, 'ALL')
for num in data[0].split():
typ, data = M.fetch(num, '(ENVELOPE)')
print 'Message %s\n%s\n' % (num, data[0][1])
M.close()
M.logout()
Traceback (most recent call last):
File "Test.py", line 3, in <module>
M = imaplib.IMAP4( 'localhost', 1143 )
File "python2.6/imaplib.py", line 184, in __init__
self.welcome = self._get_response()
File "python2.6/imaplib.py", line 935, in _get_response
raise self.abort("unexpected response: '%s'" % resp)
imaplib.abort: unexpected response: '* ok imap4rev1'
Note the 'ok' tag in lower case.
Back to top | Article view | comp.lang.python
csiph-web