class email.policy.Compat32(**kw)
This concrete Policy is the backward compatibility policy. It replicates the behavior of the email package in Python 3.2. The policy module also defines an instance of this class, compat32, that is used as the default policy. Thus the default behavior of the email package is to maintain compatibility with Python 3.2.
The following attributes have values that are different from the Policy default:
-
mangle_from_ -
The default is
True.
The class provides the following concrete implementations of the abstract methods of Policy:
-
header_source_parse(sourcelines) -
The name is parsed as everything up to the ‘
:‘ and returned unmodified. The value is determined by stripping leading whitespace off the remainder of the first line, joining all subsequent lines together, and stripping any trailing carriage return or linefeed characters.
-
header_store_parse(name, value) -
The name and value are returned unmodified.
-
header_fetch_parse(name, value) -
If the value contains binary data, it is converted into a
Headerobject using theunknown-8bitcharset. Otherwise it is returned unmodified.
-
fold(name, value) -
Headers are folded using the
Headerfolding algorithm, which preserves existing line breaks in the value, and wraps each resulting line to themax_line_length. Non-ASCII binary data are CTE encoded using theunknown-8bitcharset.
-
fold_binary(name, value) -
Headers are folded using the
Headerfolding algorithm, which preserves existing line breaks in the value, and wraps each resulting line to themax_line_length. Ifcte_typeis7bit, non-ascii binary data is CTE encoded using theunknown-8bitcharset. Otherwise the original source header is used, with its existing line breaks and any (RFC invalid) binary data it may contain.
Please login to continue.