PyDocs

Nav

Internet Data Handling

EmailPolicy.fold_binary

  • EmailPolicy.fold_binary(name, value)
Given the header name and the value from the model, return binary
data containing linesep characters that implement the folding of the
header according to the policy controls.  The value passed in by the
email package may contain surrogateescaped binary data.

The same as fold if cte_type is 7bit, except that the returned value is
bytes.

If cte_type is 8bit, non-ASCII binary data is converted back into
bytes.  Headers with binary data are not refolded, regardless of the
refold_header setting, since there is no way to know whether the binary
data consists of single byte characters or multibyte characters.

If utf8 is true, headers are encoded to utf8, otherwise to ascii with
non-ASCII characters rendered as encoded words.
0 Examples
No examples for email.policy/EmailPolicy.fold_binary.
See Also
No see-alsos for email.policy/EmailPolicy.fold_binary
0 Notes
No notes for EmailPolicy.fold_binary