#gh-75705: Set unixfrom envelope in mailbox._mboxMMDF (GH-107117)

This commit is contained in:
Matthieu Caneill 2024-02-06 19:44:12 +01:00 committed by GitHub
parent 7fdd4235d7
commit 76108b8b05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

View file

@ -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):