From: R David Murray Date: Fri, 28 Jun 2013 18:52:57 +0000 (-0400) Subject: Improve imap error message in unusual failure mode. X-Git-Tag: v3.4.0a1~375 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3bca8ac3d0296ca152c2a5462720fabb76abade5;p=thirdparty%2FPython%2Fcpython.git Improve imap error message in unusual failure mode. We ran into this during the sprits at PyCon and this patch has been sitting on my disk ever since. This just adds some information to the error message that we found useful during debugging. There's no good way to add a test, since the message only got generated via code that we had modified for debugging purposes. --- diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 30f51da9b44e..ce32c801915f 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -1073,7 +1073,7 @@ class IMAP4: # Protocol mandates all lines terminated by CRLF if not line.endswith(b'\r\n'): - raise self.abort('socket error: unterminated line') + raise self.abort('socket error: unterminated line: %r' % line) line = line[:-2] if __debug__: