[ python-Bugs-1032960 ] Confusing description of strict option for email.Parser

SourceForge.net noreply at sourceforge.net
Wed Sep 22 22:50:46 CEST 2004


Bugs item #1032960, was opened at 2004-09-23 06:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1032960&group_id=5470

Category: Documentation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew Bennetts (spiv)
Assigned to: Nobody/Anonymous (nobody)
Summary: Confusing description of strict option for email.Parser

Initial Comment:
The docs at
http://www.python.org/dev/doc/devel/lib/node534.html say:

"Normally, when things like MIME terminating boundaries
are missing, or when messages contain other formatting
problems, the Parser will raise a MessageParseError. 
However, when lax parsing is enabled, the Parser will
attempt to work around such broken formatting ..."

Which strongly suggests that the 'strict' flag defaults
to True.  However, it later says:

"The strict flag defaults to False since lax parsing
usually provides the most convenient behavior."

I suggest the paragraph be reworded to avoid giving the
impression that strict is True by default.  Perhaps
something like:

"The optional strict flag specifies whether strict or
lax parsing should be performed. When things like MIME
terminating boundaries are missing, or when messages
contain other formatting problems, the Parser will
raise a MessageParseError if the strict flag is True.
Otherwise, it uses lax parsing, and the Parser will
attempt to work around such broken formatting to
produce a usable message structure (this doesn't mean
MessageParseErrors are never raised; some ill-formatted
messages just can't be parsed). The strict flag
defaults to False since lax parsing usually provides
the most convenient behavior."

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1032960&group_id=5470


More information about the Python-bugs-list mailing list