Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subject encoding error with Python3.4 #88

Closed
harobed opened this issue Oct 16, 2014 · 7 comments
Closed

Subject encoding error with Python3.4 #88

harobed opened this issue Oct 16, 2014 · 7 comments
Assignees

Comments

@harobed
Copy link

harobed commented Oct 16, 2014

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')
@jamesonjlee
Copy link
Collaborator

which python are you 3.4.2?

@jamesonjlee
Copy link
Collaborator

#85
that's why that patch was accepted, can you created a counter-test?

@harobed
Copy link
Author

harobed commented Oct 20, 2014

Yes, 3.4.2

harobed pushed a commit to harobed/flask-mail that referenced this issue Oct 20, 2014
@harobed
Copy link
Author

harobed commented Oct 20, 2014

@jamesonjlee Ok, I've appended one test for this bug. Without my patch, this new test fail with python 3.4

@jamesonjlee
Copy link
Collaborator

@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.

@harobed

This comment was marked as off-topic.

sergeikaretnikov pushed a commit to monterosa/flask-mail that referenced this issue Apr 11, 2016
sergeikaretnikov pushed a commit to monterosa/flask-mail that referenced this issue Apr 11, 2016
drdaeman pushed a commit to drdaeman/flask-mail that referenced this issue Oct 23, 2016
drdaeman pushed a commit to drdaeman/flask-mail that referenced this issue Oct 23, 2016
@davidism davidism added this to the 0.10.0 milestone May 23, 2024
@davidism
Copy link
Member

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.

@davidism davidism closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
@davidism davidism removed this from the 0.10.0 milestone May 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants