]> granicus.if.org Git - python/commit
#5610: use \Z not $ so we don't eat extra chars when body part ends with \r\n.
authorR. David Murray <rdmurray@bitdance.com>
Thu, 3 Jun 2010 15:43:20 +0000 (15:43 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Thu, 3 Jun 2010 15:43:20 +0000 (15:43 +0000)
commit61746d580e956bc2dda7fcf230a581e463a4d186
tree1e84de1954226de043d62d82ce411bcdb2e9d2ed
parent23152ea5bdf4b2e54bbf9a1efa0c7eba292d38cf
#5610: use \Z not $ so we don't eat extra chars when body part ends with \r\n.

If a body part ended with \r\n, feedparser, using '$' to terminate its
search for the newline, would match on the \r\n, and think that it needed
to strip two characters in order to account for the line end before the
boundary.  That made it chop one too many characters off the end of
the body part.  Using \Z makes the match correct.

Patch and test by Tony Nelson.
Lib/email/feedparser.py
Lib/email/test/test_email.py
Misc/NEWS