Abhilash Raj <raj.abhila...@gmail.com> added the comment:
According to RFC 2047 5(1) > However, an 'encoded-word' that appears in a header field defined as '*text' MUST be separated from any adjacent 'encoded-word' or 'text' by 'linear-white-space'. So, it seems like splitting on whitespace is the right thing to do (see MUST). While your solution works for your case where the charset and cte are utf-8 and q respectively (not a general case for random chatsets and cte), it seems like a hack to get around the fact the header is non-conformant to RFC. IMO manipulating the original header (value.replace in your patch) isn't something we should do, but @r.david.murray would be the right person to answer how we handle non-conformant messages. ---------- nosy: +maxking _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue21315> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com