Mercurial > cpython-lru_cache-weakref
diff Lib/email/feedparser.py @ 62347:58413676befb
Merged revisions 81675 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81675 | r.david.murray | 2010-06-03 11:43:20 -0400 (Thu, 03 Jun 2010) | 10 lines
#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.
........
| author | R. David Murray <rdmurray@bitdance.com> |
|---|---|
| date | Wed, 16 Jun 2010 02:19:40 +0000 |
| parents | ace45b361e87 |
| children | 3c73010bd0b0 |
line wrap: on
line diff
--- a/Lib/email/feedparser.py Tue Jun 15 23:46:40 2010 +0000 +++ b/Lib/email/feedparser.py Wed Jun 16 02:19:40 2010 +0000 @@ -28,7 +28,7 @@ NLCRE = re.compile('\r\n|\r|\n') NLCRE_bol = re.compile('(\r\n|\r|\n)') -NLCRE_eol = re.compile('(\r\n|\r|\n)$') +NLCRE_eol = re.compile('(\r\n|\r|\n)\Z') NLCRE_crack = re.compile('(\r\n|\r|\n)') # RFC 2822 $3.6.8 Optional fields. ftext is %d33-57 / %d59-126, Any character # except controls, SP, and ":".
