Current annotation for email.mime.application.MIMEApplication constructor expects first argument to be bytes, while it should be Union[str, bytes], as both are accepted and work fine, and moreover, the internal engine of email.message.Message.set_payload() actually transforms bytes to str.