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: mailbox.MH.add loses status info from other formats
Type: behavior Stage:
Components: email, Library (Lib) Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, r.david.murray, shai
Priority: normal Keywords:

Created on 2017-11-04 22:55 by shai, last changed 2022-04-11 14:58 by admin.

Messages (1)
msg305572 - (view) Author: Shai Berger (shai) Date: 2017-11-04 22:55
In mailbox.py in the stdlib, the functions MH.add and MH.__setitem__ take a message object and dump it to a file in the MH folder, which is good and well. However, they only call self._dump_sequences() if the message was already an MHMessage.

Since in the MH format, status details (whether the message was read, replied or flagged) are saved in these sequences, this effectively loses this information.

This means that, if "folder" is an MH folder and "message" is a message of any class other than MHMessage, 

   folder.add(message)

loses the information, while

   folder.add(MHMEssage(message))

retains it. This seems surprising and suboptimal.
History
Date User Action Args
2022-04-11 14:58:54adminsetgithub: 76127
2017-11-04 22:55:29shaicreate