RoundupMessage._decode_header (formerly known as
Message._decode_header_to_utf8) is incorrect when the encoding is missing:
def _decode_header(self, hdr):
parts = 
for part, encoding in decode_header(hdr):
part = part.decode(encoding)
return ''.join([u2s(p) for p in parts])
If the encoding is specified, the parts will be decoded to a list of
unicode strings, if it isn't, parts will be a list of byte strings. In
the latter case, u2s() will fail to encode the byte strings on Python 2
if they contain non-ascii characters, and it will always fail on Python
3 since byte strings don't have an .encode() method.
I fixed this downstream by attempting the decoding using utf-8 first and
falling back on iso-8859-1 if that fails:
The code on 1.5 is slightly different, but the logic is the same.