R. David Murray <rdmur...@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 <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

Reply via email to