mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
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:
parent
5be00247ae
commit
d16f012f84
3 changed files with 30 additions and 1 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue