mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[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:
parent
5fb2204ad4
commit
831b95d9b9
3 changed files with 15 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue