bpo-31522: mailbox.get_string: pass from_ parameter to get_bytes (#9857)

This allows *from_* to be successfully set to a non-default value when calling mbox.get_string.
This commit is contained in:
Cheryl Sabella 2018-10-18 20:21:47 -04:00 committed by R. David Murray
parent 5be00247ae
commit d16f012f84
3 changed files with 30 additions and 1 deletions

View file

@ -784,7 +784,7 @@ class _mboxMMDF(_singlefileMailbox):
def get_string(self, key, from_=False):
"""Return a string representation or raise a KeyError."""
return email.message_from_bytes(
self.get_bytes(key)).as_string(unixfrom=from_)
self.get_bytes(key, from_)).as_string(unixfrom=from_)
def get_bytes(self, key, from_=False):
"""Return a string representation or raise a KeyError."""