Neeed help with gnupg on windows

1,107 views
Skip to first unread message

Lance Bermudez

unread,
Apr 25, 2015, 6:04:14 PM4/25/15
to python...@googlegroups.com
I have gnu4win installed on my widnows my python scripts looks like this

import gnupg
from pprint import pprint

gpg = gnupg.GPG(binary='G:\Pearsonhighered_python_books\python-gpg', homedir=r'G:\Pearsonhighered_python_books\python-gpg', ignore_homedir_permissions='True', verbose=True)

public_keys = gpg.list_keys(False)

print("public_keys")
pprint(public_keys)

the error I get in idle is
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
  File "G:\Pearsonhighered_python_books\python-gpg\list-keys1.py", line 10, in <module>
    gpg = gnupg.GPG(binary='G:\Pearsonhighered_python_books\python-gpg', homedir=r'G:\Pearsonhighered_python_books\python-gpg', ignore_homedir_permissions='True', verbose=True)
  File "C:\Python34\lib\site-packages\gnupg\gnupg.py", line 162, in __init__
    self.create_trustdb()
  File "C:\Python34\lib\site-packages\gnupg\gnupg.py", line 172, in create_trustdb
    if self.is_gpg2():
  File "C:\Python34\lib\site-packages\gnupg\gnupg.py", line 212, in is_gpg2
    return _util._is_gpg2(self.binary_version)
  File "C:\Python34\lib\site-packages\gnupg\_util.py", line 529, in _is_gpg2
    (major, minor, micro) = _match_version_string(version)
  File "C:\Python34\lib\site-packages\gnupg\_util.py", line 607, in _match_version_string
    major, minor, micro = int(g[0]), int(g[2]), int(g[4])
TypeError: int() argument must be a string or a number, not 'NoneType'

I did a googel search and found this
https://github.com/isislovecruft/python-gnupg/issues/44

How do I get this to work on windows? it work fine on ubuntu.

Vinay Sajip

unread,
Apr 25, 2015, 6:09:54 PM4/25/15
to python...@googlegroups.com
Dear Lance,

Sorry, this mailing list is for the original python-gnupg project - not the incompatible fork of it which you appear to be using.

Regards,

Vinay Sajip

Lance Bermudez

unread,
May 19, 2015, 5:17:09 AM5/19/15
to python...@googlegroups.com
pip install python-gnupg from the cli on my windows box says it has the latest version but I still get this error

Lance Bermudez

unread,
May 19, 2015, 5:30:34 AM5/19/15
to python...@googlegroups.com
I did >>help(gnupg) and it said it is version 2.0.2


On Saturday, April 25, 2015 at 4:04:14 PM UTC-6, Lance Bermudez wrote:

Elias Pardo

unread,
Jul 15, 2015, 6:29:23 AM7/15/15
to python...@googlegroups.com
Hello Lance,

I just had the same problem as you. I'm not very sure if what I did to get pass this problem is correct, but anyways, this is what I did.

I checked with PIP what packages I had installed. It happened that I had python-gnupg and gnupg both. I uninstalled both and installed only python-gnupg.
I dont know if this worked for you but, for me at least it got me passed the instantiation of the GPG object

Good luck :)
Elias
Reply all
Reply to author
Forward
0 new messages