[3.12] GH-gh-75705: Set unixfrom envelope in mailbox._mboxMMDF (GH-107117) (GH-115098)

(cherry picked from commit 76108b8b05)

Co-authored-by: Matthieu Caneill <matthieucan@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2024-02-06 20:05:05 +01:00 committed by GitHub
parent 5fb2204ad4
commit 831b95d9b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

View file

@ -778,10 +778,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):