[New-bugs-announce] [issue31946] mailbox.MH.add loses status info from other formats

Shai Berger report at bugs.python.org
Sat Nov 4 18:55:29 EDT 2017


New submission from Shai Berger <shai at 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 <report at bugs.python.org>
<https://bugs.python.org/issue31946>
_______________________________________


More information about the New-bugs-announce mailing list