Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81738

Re: Getting errors from Imaplib

References <4B0DF114-E705-47B3-9815-003899F174CE@beatrixwillius.de> <CAPTjJmo_eZ=Ga=J6vqasD0EG8ZiVP9OLJE7CGxHa1ba8Jkv9WA@mail.gmail.com> <B32A0BD4-1298-4F20-A864-B20C6ACF86D9@beatrixwillius.de>
Date 2014-12-01 07:11 +1100
Subject Re: Getting errors from Imaplib
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.16441.1417378322.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Dec 1, 2014 at 1:42 AM, Beatrix Willius from Moth Software
<mail@beatrixwillius.de> wrote:
> no, pinging Yahoo doesn't work. But this is an additional problem - perhaps I tested too often. This is one of my accounts for Imap testing and I only copied the value from Mail.
>
> For getting the error back this doesn't really matter.

I'm not sure what you mean here. There are two ways I could see this
being handled:

1) A network connection failure is fundamentally different from an
auth problem. That's what you're currently seeing; only auth problems
are caught.

2) Network failures and auth problems should be dealt with the same
way. Change one line of code:
except (imaplib.IMAP4.error, OSError):

Now it'll cope with OSError the same way it copes with IMAP errors.

Does that answer your question?

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Getting errors from Imaplib Chris Angelico <rosuav@gmail.com> - 2014-12-01 07:11 +1100

csiph-web