Fix the rest of issue #1 and some other stuff
We now handle the following exceptions when parsing headers: * "UnicodeEncodeError: 'utf-8' codec can't encode character '\udcf8' in position 64: surrogates not allowed (also from absorb_headers()" * "email.errors.HeaderParseError: expected ':' at end of group display name but found '@GMAIL.COM" (which would then lead to "TypeError: 'ValueTerminal' object does not support item assignment") * "ValueError: hour must be in 0..23" (from bogus Date headers) Also: * Solve a newly-discovered quoting problem in the output * Ingest 'reply-to' as an address-containing header.
Showing
- mailaprop.py 198 additions, 37 deletionsmailaprop.py
- test-data/date-header-value-error.mbox 9 additions, 0 deletionstest-data/date-header-value-error.mbox
- test-data/expected-output.txt 11 additions, 1 deletiontest-data/expected-output.txt
- test-data/header-parsing-type-error.mbox 10 additions, 0 deletionstest-data/header-parsing-type-error.mbox
- test-data/odd-backslash-quotes-in-name.mbox 40 additions, 0 deletionstest-data/odd-backslash-quotes-in-name.mbox
- test-data/unicode-decode-error.mbox 28 additions, 0 deletionstest-data/unicode-decode-error.mbox
Loading
Please register or sign in to comment