R. David Murray added the comment:
Per the RFC, this is the correct behavior. An encoded word *must* begin and
end either at the field boundary or with whitespace. So ...?=Arobase, with no
whitespace between the = and Arobase, makes your first example into an invalid
encoded word, and thus
New submission from grumetz :
Examples:
s = '=?UTF-8?B?QWNjdXPDqSBkZSByw6ljZXB0aW9uIChhZmZpY2jDqSkgLSA=?=Arobase !'
decode_header(s) --->
[('=?UTF-8?B?QWNjdXPDqSBkZSByw6ljZXB0aW9uIChhZmZpY2jDqSkgLSA=?=Arobase !',
None)]
which seems bad...
but
ss ='=?UTF-8?B?QWNjdXPDqSBkZSByw6ljZXB0aW9uIChhZmZpY