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

Add error handling for GPGME imports and add logic to shell out if the module is not present #268

Merged
merged 2 commits into from
Apr 7, 2017

Conversation

dephekt
Copy link
Contributor

@dephekt dephekt commented Mar 22, 2017

This PR adds error handling for the recently added GPGME module imports. If the correct GPGME module is not available on a system, the program will fall back to the legacy method of shelling out to the GPG executable.

I removed python-gpg from the stdeb.cfg file in order to prevent unresolvable dependencies, since the target Ubuntu suite is Trusty (14.04 LTS) and python-gpg doesn't exist in Ubuntu repositories until Zesty (17.04).

Fixes #267 regression from PR #266

@dephekt dephekt changed the title Fix for Issue 267 Mar 22, 2017
@dephekt dephekt changed the title Add error handling for GPGME imports and logic to shell out if GPGME is not present Mar 22, 2017
@micahflee
Copy link
Collaborator

So I'm just now looking at merging this. Do you know what the difference are between the ubuntu packages python-gpg and python-gpgme?

Only the newest ubuntu (zesty) includes python-gpg, and also only the newest debian (stretch) includes python-gpg. However older ubuntus and debians include python-gpgme. Are they the same library? If so, would it make sense to just rely on python-gpgme for now, to avoid all the extra logic?

@dephekt
Copy link
Contributor Author

dephekt commented Apr 7, 2017

See #267 for the info on python-gpg and python-gpgme in Ubuntu (they are entirely different and not compatible). If you want to target any Ubuntu platforms prior to Zesty 17.04 it'll need that shell out logic still.

Ubuntu 14.04 LTS relies on gpgme 1.6 C libraries and they were from before python bindings were rolled into the gpgme project (in libgpgme 1.7+), so using the 1.7+ python bindings will not work against the 1.6 libgpgme as the python bindings weren't present there prior to libgpgme 1.7+

You can clone the launcher source on an Ubuntu LTS VM, install python-gpgme and try to run the app and see that it dies in a fire for more reasons than just the module name being different.

@micahflee micahflee merged commit 44ceaf6 into torproject:master Apr 7, 2017
@micahflee
Copy link
Collaborator

Sorry it took so long to get around to reviewing this, but looks good!

@dephekt dephekt deleted the issue-267 branch April 8, 2017 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants