[issue21315] email._header_value_parser does not recognise in-line encoding changes

R. David Murray report at bugs.python.org
Fri May 17 14:06:45 EDT 2019


R. David Murray <rdmurray at bitdance.com> added the comment:

A cleaner/safer solution here would be:

  tok, *remainder = _wsp_splitter(value, 1)
  if _rfc2047_matcher(tok):
      tok, *remainder = value.partition('=?')
      
where _rfc2047_matcher would be a regex that matches a correctly formatted encoded word. There a regex for that in the header.py module, though for this application we don't need the groups it has.

Abhilash, I'm not sure why you say the proposed solution only works for utf-8 and 'q'?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21315>
_______________________________________


More information about the Python-bugs-list mailing list