UnicodeEncodeError in _detectors/simplematch.py
In part, this issue stems from the fact that _scan._find_detectors returns the list of detectors in an unpredictable order and _scan.scan_message runs all the detectors even after one has recognized the message. The specific issue in this case is a message that would have been correctly recognized by _detectors/dsn.py is processed first by _detectors/simplematch.py. The message contains a couple of strings that match one of the scre patterns but nothing matching the corresponding ecre pattern so simplematch processes lines in the message until it comes to the VERPed
Return-path: <python-dev-bounces+python=david...@python.org>
(partially elided for privacy) in the returned message headers and the acre pattern matches python-dev-bounces+python=david...@python.org
. It passes this to _quopri_decode which replaces the =da
with \xda
and then tries to encode the result as us-ascii
resulting in the UnicodeEncodeError.
Probably the way to fix this is to catch the exception in _quopri_decode and ignore the address.