mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685)
This commit is contained in:
parent
45a78f906d
commit
30f7a77f35
3 changed files with 11 additions and 2 deletions
|
@ -948,7 +948,7 @@ class MIMEPart(Message):
|
|||
if policy is None:
|
||||
from email.policy import default
|
||||
policy = default
|
||||
Message.__init__(self, policy)
|
||||
super().__init__(policy)
|
||||
|
||||
|
||||
def as_string(self, unixfrom=False, maxheaderlen=None, policy=None):
|
||||
|
@ -965,7 +965,7 @@ class MIMEPart(Message):
|
|||
policy = self.policy if policy is None else policy
|
||||
if maxheaderlen is None:
|
||||
maxheaderlen = policy.max_line_length
|
||||
return super().as_string(maxheaderlen=maxheaderlen, policy=policy)
|
||||
return super().as_string(unixfrom, maxheaderlen, policy)
|
||||
|
||||
def __str__(self):
|
||||
return self.as_string(policy=self.policy.clone(utf8=True))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue