]> khamidou — GitHub mirrors - flanker.git/commit
fix exception in serialization of messages with malformed headers
authorJeremy Schlatter <jeremy.schlatter@gmail.com>
Thu, 11 Jun 2015 18:21:12 +0000 (11:21 -0700)
committerJeremy Schlatter <jeremy.schlatter@gmail.com>
Thu, 11 Jun 2015 18:21:12 +0000 (11:21 -0700)
commit45e70dc61a8cb979fa16fba1c62fb535fa190670
tree74fb3fc306a4d48f504999ee734a94872f88ef97
parentf40c046eefc92533f1855d63a631a84738e5149c
fix exception in serialization of messages with malformed headers

flanker.mime.create.from_string does not fully parse message headers.
Instead, headers are parsed lazily the first time they are accessed. So
even though flanker.mime.create.from_string does not support malformed
headers, this isn't a problem if they are never accessed.

Commits 9c89b875dc0eafc01c7f9725d5db5aff8f798f70 and
cd271929bf831999c40e616da3dfacd3694eae56 caused headers to be accessed
every time a message is serialized. This made it impossible to parse and
then re-serialize a message with broken headers, even though this used
to be possible if the headers were never accessed after parsing.

This commit brings back that option: it is again possible to parse and
then re-serialize a message with broken headers.
flanker/mime/message/part.py
tests/__init__.py
tests/fixtures/messages/outlook-express.eml [new file with mode: 0644]
tests/mime/message/part_test.py