Open e3rd opened 6 years ago
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.
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.