[New-bugs-announce] [issue2679] email.feedparser regex duplicate
Jim Jewett
report at bugs.python.org
Thu Apr 24 15:52:20 CEST 2008
New submission from Jim Jewett <jimjjewett at users.sourceforge.net>:
feedparser defines four regexs for end-of-line, but two are redundant.
NLCRE checks for the three common line endings.
NLCRE_crack also captures the line ending.
NLCRE_eol also adds a $ to ensure it is at the end.
NLCRE_bol ... is identical to NLCRE_crack.
It should either use a ^ to insist on line-start, or be explicitly the
same. (e.g., NLCRE_bol=NLCRE_crack.) (It gets away with not listing the ^
because the current code only uses NLCRE_bol.match.
(Actually, if the regexes are considered private, then the current code
could just use the bound methods directly ... setting NLCRE_bol to the
.match method, NLCRE_eol to the .search method, and NLCRE_crack to the
.split method.)
----------
components: Library (Lib)
messages: 65723
nosy: jimjjewett
severity: normal
status: open
title: email.feedparser regex duplicate
versions: Python 2.6, Python 3.0
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2679>
__________________________________
More information about the New-bugs-announce
mailing list