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

R. David Murray report at bugs.python.org
Wed Jun 5 16:26:38 CEST 2013


R. David Murray added the comment:

My preliminary thought (and I haven't checked the code yet to make sure this will actually work), is that under the new email policies we are dealing with full-blown header objects, meaning that they can know the header name they represent.  This should theoretically make it possible to have a 'create header' function to create a header object (there may be one already...it's been way too long since I've worked on this code) and then have:

  message[:0] = [my_new_header]

do the right thing.  As well as all the other list methods working as expected.  We'd also want a 'find_header' method that takes the header name and returns the index of the header in the list.

But, as I say, this is just a preliminary thought, it needs careful consideration before we decide to actually do something.

----------

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


More information about the Python-bugs-list mailing list