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.
Here are a few fixes that make python-gnupg work on Windows.
The main change is about paths: the strategy in this PR is to escape the paths as late as possible in the code.
According to my tests, this solves #199 and #204 on Python 2 & 3.
Below is a summary of the tests results. On Windows, since the GPG class could not be instantiated before, the tests are necessarily better... On Debian, some tests are already failing on the master branch and many even make the process hang (example with "test_gnupg.py crypt" in note [11] of attached file). When removing the ones that make the tests hang, I saw no notable difference between the tests on the master branch and this pull request.
Tests summary (see attached log for the numbered notes):
Python 2.7.13, GnuPG 1.4.22, this pull request (ea96545):
Python 3.6, GnuPG 1.4.22, this pull request (ea96545):
Debian Jessie, Python 2.7, master (705d7f4):
Debian Jessie, Python 2.7, this pull request (ea96545), excluding the tests that hanged above:
pr1_log.txt