MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / as_string

Method as_string

tools/python-3.11.9-amd64/Lib/email/message.py:982–996  ·  view source on GitHub ↗

Return the entire formatted message as a string. Optional 'unixfrom', when true, means include the Unix From_ envelope header. maxheaderlen is retained for backward compatibility with the base Message class, but defaults to None, meaning that the policy value f

(self, unixfrom=False, maxheaderlen=None, policy=None)

Source from the content-addressed store, hash-verified

980
981
982 def as_string(self, unixfrom=False, maxheaderlen=None, policy=None):
983 """Return the entire formatted message as a string.
984
985 Optional 'unixfrom', when true, means include the Unix From_ envelope
986 header. maxheaderlen is retained for backward compatibility with the
987 base Message class, but defaults to None, meaning that the policy value
988 for max_line_length controls the header maximum length. 'policy' is
989 passed to the Generator instance used to serialize the message; if it
990 is not specified the policy associated with the message instance is
991 used.
992 """
993 policy = self.policy if policy is None else policy
994 if maxheaderlen is None:
995 maxheaderlen = policy.max_line_length
996 return super().as_string(unixfrom, maxheaderlen, policy)
997
998 def __str__(self):
999 return self.as_string(policy=self.policy.clone(utf8=True))

Callers 1

__str__Method · 0.95

Calls 1

as_stringMethod · 0.45

Tested by

no test coverage detected