This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Confusing description of strict option for email.Parser
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, spiv
Priority: normal Keywords:

Created on 2004-09-22 20:50 by spiv, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg22522 - (view) Author: Andrew Bennetts (spiv) Date: 2004-09-22 20:50
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."
msg22523 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2004-10-09 21:22
Logged In: YES 
user_id=12800

Changing group to Python 2.3, since the 'strict' argument is
deprecated in Python 2.4.
msg22524 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2004-10-09 21:29
Logged In: YES 
user_id=12800

I've improved the docs for the Python 2.3 version; it should
show up in Python 2.3.5.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40944
2004-09-22 20:50:46spivcreate