[New-bugs-announce] [issue12537] mailbox's _become_message is very fragile

R. David Murray report at bugs.python.org
Mon Jul 11 20:31:15 CEST 2011

New submission from R. David Murray <rdmurray at bitdance.com>:

The mailbox module has a method _become_message that copies attributes from an object that is an email.message.Message subclass to the calling object (which is also a subclass of email.message.Message).  This method is very fragile in the face of any changes to the email.message.Message attribute set.

Instead it would be better to decouple the mailbox and email modules by copying *all* __dict__ attributes from the source message to the new object, and then rewrite the _explain_to methods to not only convert the 'special attributes' to the correct format for the new subclass, but also delete any leftover "special" attributes.

components: Library (Lib)
keywords: easy
messages: 140157
nosy: r.david.murray
priority: normal
severity: normal
status: open
title: mailbox's _become_message is very fragile
versions: Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list