[Python-checkins] cpython: Improve imap error message in unusual failure mode.

r.david.murray python-checkins at python.org
Fri Jun 28 20:53:16 CEST 2013


http://hg.python.org/cpython/rev/d1cf33b01f11
changeset:   84357:d1cf33b01f11
user:        R David Murray <rdmurray at bitdance.com>
date:        Fri Jun 28 14:52:57 2013 -0400
summary:
  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.

files:
  Lib/imaplib.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/imaplib.py b/Lib/imaplib.py
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -1073,7 +1073,7 @@
 
         # 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__:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list