Open
Conversation
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.
Closed
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.