Skip to content

Commit 3bca8ac

Browse files
committed
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.
1 parent 9a2f139 commit 3bca8ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/imaplib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ def _get_line(self):
10731073

10741074
# Protocol mandates all lines terminated by CRLF
10751075
if not line.endswith(b'\r\n'):
1076-
raise self.abort('socket error: unterminated line')
1076+
raise self.abort('socket error: unterminated line: %r' % line)
10771077

10781078
line = line[:-2]
10791079
if __debug__:

0 commit comments

Comments
 (0)