This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _mboxMMDF.get_string() fails to pass param to get_bytes()
Type: behavior Stage: resolved
Components: email Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, bpoaugust, iritkatriel, r.david.murray
Priority: normal Keywords: patch

Created on 2017-09-19 22:34 by bpoaugust, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9857 merged cheryl.sabella, 2018-10-13 23:13
Messages (8)
msg302564 - (view) Author: (bpoaugust) Date: 2017-09-19 22:34
See:
https://github.com/python/cpython/blob/master/Lib/mailbox.py#L787

The code should be

self.get_bytes(key, from_)).as_string(unixfrom=from_)
msg302569 - (view) Author: (bpoaugust) Date: 2017-09-19 23:25
https://github.com/python/cpython/blob/master/Lib/mailbox.py#L778

The code here reads the first line, but fails to save it as the unixfrom line.

Alternatively perhaps it should reset the file back to the start so the message factory has sight of the envelope.

The end result is that the envelope is lost.
msg302571 - (view) Author: (bpoaugust) Date: 2017-09-19 23:28
Ignore msg302569 - that was supposed to be a new issue.
msg328013 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2018-10-19 00:21
New changeset d16f012f842e5719ff9fb90e217efc0f795853f2 by R. David Murray (Cheryl Sabella) in branch 'master':
bpo-31522: mailbox.get_string: pass `from_` parameter to `get_bytes` (#9857)
https://github.com/python/cpython/commit/d16f012f842e5719ff9fb90e217efc0f795853f2
msg378757 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-10-16 21:54
This seems complete, can it be closed?
msg378758 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-10-16 21:55
Well, the PR doesn't have a unit test so maybe not.
msg379378 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2020-10-22 22:59
Actually, it looks to me like the PR *does* include unittests, and I see them in the repo, so I'm closing this bug.
msg379379 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-10-22 23:01
Right!
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75703
2020-10-22 23:01:02iritkatrielsetmessages: + msg379379
2020-10-22 22:59:21barrysetstatus: open -> closed
resolution: fixed
messages: + msg379378

stage: patch review -> resolved
2020-10-16 21:55:31iritkatrielsetmessages: + msg378758
2020-10-16 21:54:52iritkatrielsetnosy: + iritkatriel
messages: + msg378757
2018-10-19 00:21:52r.david.murraysetmessages: + msg328013
2018-10-13 23:16:29cheryl.sabellasetversions: + Python 3.8, - Python 3.5, Python 3.6, Python 3.7
2018-10-13 23:13:23cheryl.sabellasetkeywords: + patch
stage: patch review
pull_requests: + pull_request9225
2017-09-19 23:28:39bpoaugustsetmessages: + msg302571
2017-09-19 23:26:26bpoaugustsettitle: mailbox._mboxMMDF.get_message throws away From envelope -> _mboxMMDF.get_string() fails to pass param to get_bytes()
2017-09-19 23:25:41bpoaugustsetmessages: + msg302569
title: _mboxMMDF.get_string() fails to pass param to get_bytes() -> mailbox._mboxMMDF.get_message throws away From envelope
2017-09-19 22:34:29bpoaugustcreate