New submission from Shai Berger <s...@platonix.com>:

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.

----------
components: Library (Lib), email
messages: 305572
nosy: barry, r.david.murray, shai
priority: normal
severity: normal
status: open
title: mailbox.MH.add loses status info from other formats
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31946>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to