This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make Imap Error more helpful
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, georg.brandl, guettli, mark-roberts
Priority: normal Keywords: patch

Created on 2006-11-29 11:52 by guettli, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
imaplib.py.patch guettli, 2006-11-29 11:52
Messages (4)
msg51418 - (view) Author: Thomas Guettler (guettli) * Date: 2006-11-29 11:52
Hi,

In my app I got this error:

 imaplib.error: command SEARCH illegal in state AUTH.

but I did successfully login. After reading the source
of imaplib.py I realized that this was meant:

imaplib.error: command SEARCH illegal in state AUTH. Allowed after: SELECTED

Attached is a small patch to make the error message
more helpful.
msg51419 - (view) Author: Mark Roberts (mark-roberts) Date: 2006-12-27 17:52
The patch looks great (Not as though I have a lot of say to say so..), but it seems incongruous that you say "allowed after" when it might seem more explicit to say "Allowed in states", like so:
    "Allowed in states: %s" % (", ".join(Commands[command])

Otherwise, I'm all for more explicit error messages!

- Mark
msg51420 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-03-13 18:24
Thanks for the patch, applied a similar one in rev. 54343.
msg174691 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2012-11-03 20:53
Can this be closed as the code from rev. 54343 is live on Python 3.3.  See also Issue6426.
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44290
2013-02-15 15:05:43r.david.murraylinkissue6426 superseder
2012-11-03 20:53:23BreamoreBoysetnosy: + BreamoreBoy
messages: + msg174691
2006-11-29 11:52:03guettlicreate