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

MIME encoding note #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

MIME encoding note #219

wants to merge 1 commit into from

Conversation

e3rd
Copy link

@e3rd e3rd commented Jan 4, 2018

Since codecs library are seriously changed when iniciating GPG object and concerning issue remains closed I think it's worth noting this workaround. It would save me fifteen hours because it was very difficult to find such a bug – an independent iniciation changing whole Python behaviour.

Since codecs library are seriously changed when iniciating GPG object and concerning issue remains closed I think it's worth noting this workaround. It would save me fifteen hours because it was very difficult to find such a bug – an independent iniciation changing whole Python behaviour.
@e3rd e3rd mentioned this pull request Jan 4, 2018
@isislovecruft isislovecruft self-requested a review July 25, 2018 20:32
@jannschu
Copy link

jannschu commented Oct 6, 2018

Indeed, the current workaround leads to very serious bugs. I spent many hours searching for a bug related to sending binary email attachments. Consider the following example:

'\udcff'.encode()  # raises Exception
from pretty_bad_protocol import gnupg
gpg = gnupg.GPG()
'\udcff'.encode()  # returns b'?'

The base 64 encoding in Python's email library relies on that exception! Please put this big notice in the README that this library breaks emails and significantly modifies unicode handling.

jannschu added a commit to jannschu/python-gnupg that referenced this pull request Oct 7, 2018
This removes the monkey-patch from isislovecruft/python-gnupg@d9116ba and instead uses a local modification of the StreamReader by switching from ›strict‹ error handlers (the default) to ›replace‹ error handlers.

This should resolve isislovecruft#219 and isislovecruft#49, as well as email attachments.
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