]> granicus.if.org Git - python/commit
Fixes for SF #1076485, which I'll apply to the CVS head too. The problem was
authorBarry Warsaw <barry@python.org>
Sun, 5 Dec 2004 03:45:42 +0000 (03:45 +0000)
committerBarry Warsaw <barry@python.org>
Sun, 5 Dec 2004 03:45:42 +0000 (03:45 +0000)
commit7cf9ce24409efb70efde08e350a4170dc98008a1
tree0bb15e7e9f836e06f95db9509b18d21d1d99ec0e
parent6c92d76abc730ca7a77da3c7a8627192f7ac3add
Fixes for SF #1076485, which I'll apply to the CVS head too.  The problem was
caused by a self._input.readline() call that wasn't checking for the
NeedsMoreData marker.

msg_43.txt contains a message that illustrates the problem, when
email.message_from_*() is called.  That interface uses the Parser API, which
splits reads into 8192 byte chunks.  It so happens that for the test message,
the 8192 chunk falls inside a message/delivery-status, which is where in the
FeedParser the readline() call was that didn't check for NeedsMoreData.

I also added an assert to unreadline() so it'll be more evident if an attempt
to push back NeedsMoreData ever happens again.

Bump the email package version number.
Lib/email/FeedParser.py
Lib/email/__init__.py
Lib/email/test/data/msg_43.txt [new file with mode: 0644]
Lib/email/test/test_email.py