Subject encoding error with Python3.4
This line https://github.com/mattupstate/flask-mail/blob/master/flask_mail.py#L385 don't work with Python3.4
With :
return self._message().as_string().encode(self.charset or 'utf-8')
Subject encoding work with success.
With :
return self._message().as_bytes()
Subject encoding fail.
I suggest to always use :
return self._message().as_string().encode(self.charset or 'utf-8')
which python are you 3.4.2?
https://github.com/mattupstate/flask-mail/pull/85 that's why that patch was accepted, can you created a counter-test?
Yes, 3.4.2
@jamesonjlee Ok, I've appended one test for this bug. Without my patch, this new test fail with python 3.4
@harobed thanks for following up (and sorry for late follow up), can you make sure you retain the as_string() portion of the test as well as adding the as_byte()?
other than that, looks good to merge.
bump
If email.Message.as_bytes() is failing on something it shouldn't, that seems to be an issue to report to Python's smtplib. 3.8 is the lowest supported version in 2024, and it does not appear to have an issue.