-
Notifications
You must be signed in to change notification settings - Fork 172
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
UnicodeDecodeError #49
Comments
Hello @Nando-bog! Thanks for reporting this bug. I don't have a Mac to test it on, but on a Linux machine I get the following:
This is with Python 2.7.6 and It could have something to do with locale settings in your terminal. @Nando-bog, do you think you could try again, using |
I believe this issue was fixed in my Please reopen if the issue persists. |
I got a lot of UnicodeDecode errors while doing Here is a key that gave me one of these errors: I was using the current pypi version, should I switch to the develop branch or is it unstable?
|
This solution needs to be rethought. Changing this global callback is affecting other code, most notably the DataStax Cassandra driver. The exception in the following code is never raised, so what is already valid UTF-8 has its characters replaced with garbage: https://github.com/datastax/python-driver/blob/master/cassandra/cqltypes.py#L675 |
This solution definitely needs to be rethought. It breaks MIME encodings of attachments even if I am not applying PGP to them. For example, the base64 representation of an image will be munged here:
|
Note that a workaround of the monkey-patch is to define If code like this is used when a package is loaded, it will wrangle this situation:
|
Thanks for posting this workaround!! I've expanded it so that you may use GPGSafe class instead of gnupg.GPG without having to manage anything. gpg = GPGSafe(use_agent=False, homedir="~/.gnupg/") # (instead of gpg = gnupg.GPG(...))
gpg.sign(text)
... https://gist.github.com/e3rd/45aed2e93ac20843b6790b6b642da396 (Since this issue remains closed, I've also created a pull request so that it is noted by project visitors.) |
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.
I am getting a UnicodeDecodeError when decrypting a text that was encrypted using the library. However, the text is decypted properly despite the error.
Details:
OS: Mac OS Mavericks 10.9.2
Python: 2.7.6
gnupg: 1.2.5
Sample error from my Terminal:
As the last line shows, decryption worked, but it still threw the error.
Thanks!
The text was updated successfully, but these errors were encountered: