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: Add a policy argument to email.mime.MIMEBase
Type: enhancement Stage: resolved
Components: email Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, berker.peksag, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2016-06-16 10:40 by berker.peksag, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mimebase_policy.diff berker.peksag, 2016-06-16 10:40 review
Messages (5)
msg268653 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-06-16 10:40
Quoting Barry's message msg268430 from issue 10839:

    On Jun 13, 2016, at 06:38 AM, Berker Peksag wrote:

    >I don't know if it's a good idea or API but can we add a 'policy' keyword
    >argument to email.mime.base.MIMEBase? Right now, this is the only way to
    >change the default policy without using high level functions like
    >email.message_from_string():
    >
    >    m = MIMEMultipart()
    >    m.policy = email.policy.default

    I think we just need to plumb a `policy` argument through to the ultimate base
    class, email.message.Message
msg274880 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-09-07 20:29
I'm going to commit this, but leave the issue open for someone to provide tests.
msg274882 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-09-07 20:46
Sorry, I must have mispaged or something and missed the tests on the first readthrough.
msg274883 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-07 20:48
New changeset 481d14cb7595 by R David Murray in branch 'default':
#27331: add policy keyword argument to all MIME subclasses.
https://hg.python.org/cpython/rev/481d14cb7595
msg274886 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-09-07 20:50
Thanks, Berker.
History
Date User Action Args
2022-04-11 14:58:32adminsetgithub: 71518
2016-09-07 20:50:47r.david.murraysetstatus: open -> closed
resolution: fixed
messages: + msg274886

stage: test needed -> resolved
2016-09-07 20:48:59python-devsetnosy: + python-dev
messages: + msg274883
2016-09-07 20:46:18r.david.murraysetmessages: + msg274882
2016-09-07 20:29:37r.david.murraysetmessages: + msg274880
stage: patch review -> test needed
2016-06-16 10:40:47berker.peksagcreate