[issue18139] email module should have a way to prepend and insert headers

Barry A. Warsaw report at bugs.python.org
Mon Aug 22 11:30:25 EDT 2016


Barry A. Warsaw added the comment:

I've updated this to Python 3.6, but I don't know if there's time to design an API and implementation in the time left before beta 1.  But a use case has come up, so I want to reboot this discussion (yes, it should go to email-sig too).

Apparently ARC headers <http://arc-spec.org/> requires a header order.  In Mailman we have a GSoC student who is working on an implementation, and he's stuck because he needs to *prepend* ARC headers on the message, but the API gives him no direct way to do this.

We do have all the API problems that RDM points out.  I'm not going to suggest to the student that they use Message._headers.  It seems like the only way to do what he needs is to .get() all the headers in order, then del them all, manipulate the list out-of-band, and then re-add them all in the original order with the ARC headers at the front.  Yuck.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18139>
_______________________________________


More information about the Python-bugs-list mailing list