Walter Dörwald added the comment:
The problem seems to be in that line:
except imaplib.IMAP4_SSL.abort, imaplib.IMAP4.abort:
This does *not* catch both exception classes, but catches only IMAP4_SSL.abort
and stores the exception object in imaplib.IMAP4.abort.
What you want is:
except
Apple Grew added the comment:
Oops. I totally missed this. Thanks for pointing this out. I would have never
found this.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21968
R. David Murray added the comment:
That's why we made the syntax require the 'as' keyword in 3.x :)
--
nosy: +r.david.murray
resolution: - not a bug
stage: - resolved
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21968
New submission from Apple Grew:
I am sometimes getting the following error from imaplib.
Traceback (most recent call last):
File client.py, line 105, in get_new_mail_uids
result, data = retryableCall(lambda : mail.uid('search', None, UNSEEN),
retries, delay) # search and return uids
Ezio Melotti added the comment:
Do you assign anything to self.abort in your code?
Without further information we can't determine if this is a bug with impalib, I
checked the code and I don't see anything that might change self.abort.
--
nosy: +ezio.melotti
type: crash - behavior
Apple Grew added the comment:
That is the problem. I don't assign anything to that. I in fact grepped my
code for the word abort but could find none, except in the following code
block.
def retryableCall(f, retries, delay):
while True:
try:
return f()
except
Ezio Melotti added the comment:
In imaplib, abort is either raised or caught (in addition to be the defined
once), so the error doesn't seem to be there.
I suggest you to try and print self.abort (and possibly its repr()/id() or
similar informations) and try to determine if/when it gets
Apple Grew added the comment:
Yes, I actually doing - print '', self.abort, from _init_, and other methods
I am invoking. However, that seems to print nothing! I don't know why. My codes
which is using impalib is able to print stuffs.
--
___
Python