Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'result,': 0.07; 'subject:Getting': 0.07; 'archiving': 0.09; 'debugger': 0.09; 'password)': 0.09; 'true)': 0.09; 'try:': 0.09; 'reason.': 0.16; 'exception': 0.16; 'skip:# 20': 0.16; 'result.': 0.19; 'select': 0.22; 'import': 0.22; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'host': 0.29; "doesn't": 0.30; 'errors': 0.30; 'skip:( 20': 0.30; 'gives': 0.31; 'username': 0.31; 'subject:from': 0.34; "can't": 0.35; 'except': 0.35; 'received:84': 0.35; 'but': 0.35; 'accessing': 0.36; 'thanks': 0.36; 'hi,': 0.36; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'how': 0.40; 'header:Message-Id:1': 0.63; 'direct': 0.67; 'mailbox': 0.68; 'anything.': 0.68; 'from:addr:mail': 0.83; '"not': 0.84; 'received:212.162': 0.84; 'mails': 0.89 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Getting errors from Imaplib - reloaded From: Beatrix Willius from Moth Software In-Reply-To: <4B0DF114-E705-47B3-9815-003899F174CE@beatrixwillius.de> Date: Wed, 10 Dec 2014 17:41:22 +0100 Content-Transfer-Encoding: quoted-printable References: <4B0DF114-E705-47B3-9815-003899F174CE@beatrixwillius.de> To: python-list@python.org X-Mailer: Apple Mail (2.1990.1) X-Info: valid message X-Info: original Date X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1418231649 news.xs4all.nl 2855 [2001:888:2000:d::a6]:58427 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:82300 Hi, thanks to your help I can get traceback errors for the imaplib. But what = about accessing direct imap errors? In the following part of my script I = can't select the not-deleted mails for some reason. But how do I access = the error? The debugger goes to the exception line but OSError.strerror = doesn't have anything. And print(imaplib.IMAP4.error) only gives me = as result. import imaplib host =3D "xxx" username =3D "bla" password =3D "blub" mailbox =3D "\"Ablage.Kunden\"" imap_connection =3D imaplib.IMAP4(host) result, data =3D imap_connection.login(username, password) result, data =3D imap_connection.select(mailbox, True) try: result, messages_data =3D imap_connection.search(None, "NOT = DELETED") print('okay') except (imaplib.IMAP4.error, OSError): #print(OSError.strerror) #print(imaplib.IMAP4.error) print('xxxerrorxxx: select mails exception') imap_connection.logout() Mit freundlichen Gr=C3=BC=C3=9Fen/Regards Trixi Willius http://www.mothsoftware.com Mail Archiver X: The email archiving solution for professionals