mirror of
https://github.com/python/cpython.git
synced 2025-08-25 03:04:55 +00:00
#gh-75705: Set unixfrom envelope in mailbox._mboxMMDF (GH-107117)
This commit is contained in:
parent
7fdd4235d7
commit
76108b8b05
3 changed files with 15 additions and 3 deletions
|
@ -830,10 +830,11 @@ class _mboxMMDF(_singlefileMailbox):
|
|||
"""Return a Message representation or raise a KeyError."""
|
||||
start, stop = self._lookup(key)
|
||||
self._file.seek(start)
|
||||
from_line = self._file.readline().replace(linesep, b'')
|
||||
from_line = self._file.readline().replace(linesep, b'').decode('ascii')
|
||||
string = self._file.read(stop - self._file.tell())
|
||||
msg = self._message_factory(string.replace(linesep, b'\n'))
|
||||
msg.set_from(from_line[5:].decode('ascii'))
|
||||
msg.set_unixfrom(from_line)
|
||||
msg.set_from(from_line[5:])
|
||||
return msg
|
||||
|
||||
def get_string(self, key, from_=False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue