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

Fix utf8 encoding with a text/plain mailcap entry. #1526

Merged
merged 1 commit into from
Jun 15, 2020

Conversation

ryneeverett
Copy link
Contributor

This seems to essentially revert 777823f,
the reasoning of which I don't yet follow.

This may resolve the issue in #1522.

This seems to essentially revert 777823f,
the reasoning of which I don't yet follow.

This may resolve the issue in pazz#1522.
@pazz
Copy link
Owner

pazz commented Jun 14, 2020

I think that the email module's behaviour has changed since that ugly work-around was written, so good riddance. I'm surprised that our tests did not pick it up! Time for new tests?

@ryneeverett
Copy link
Contributor Author

This issue only exists if one has a text/plain mailcap entry (which apparently is commonly included in distributions). This comes down to the logic of the change I made in #1477. If there is no text/plain mailcap entry then the behavior does not change at all. If there is a text/plain mailcap entry, after #1477 the mail gets encoded and written to a temporary file where it is read by the mailcap program. This encoding step is where the bug lies.

As was pointed out in #1522, the mock I added on the plaintext test prevents this issue from emerging by emulating the behavior as if there were no text/plain entry.

Not sure if you noticed but this commit does add a test of utf8 with a text/plain entry.

@pazz
Copy link
Owner

pazz commented Jun 15, 2020

Thanks for the explanation. And yes, I did not notice the test :)
I'll push this as is. Cheers,

@pazz pazz merged commit 3739580 into pazz:master Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants