isislovecruft / python-gnupg

A modified version of python-gnupg, including security patches, extensive documentation, and extra features.
Other
424 stars 172 forks source link

importing gnupg fails when zombies are around #201

Closed phryk closed 6 years ago

phryk commented 7 years ago

At least on FreeBSD, import gnupg seems to fail as soon as there's any zombie process around.

If I'm reading this traceback right, _find_agent in _meta.py is probably the relevant place for a fix.

    import gnupg  
  File "/usr/local/lib/python2.7/site-packages/gnupg/__init__.py", line 23, in <module>
    from . import gnupg
  File "/usr/local/lib/python2.7/site-packages/gnupg/gnupg.py", line 42, in <module>
    from ._meta    import GPGBase  
  File "/usr/local/lib/python2.7/site-packages/gnupg/_meta.py", line 134, in <module>
    class GPGBase(object):  
  File "/usr/local/lib/python2.7/site-packages/gnupg/_meta.py", line 72, in __new__
    if cls._find_agent():  
  File "/usr/local/lib/python2.7/site-packages/gnupg/_meta.py", line 115, in _find_agent
    if (proc.name() == "gpg-agent") and proc.is_running():  
  File "/usr/local/lib/python2.7/site-packages/psutil/__init__.py", line 641, in name
    name = self._proc.name()  
  File "/usr/local/lib/python2.7/site-packages/psutil/_psbsd.py", line 504, in wrapper
    raise ZombieProcess(self.pid, self._name, self._ppid)  
psutil.ZombieProcess: psutil.ZombieProcess process still exists but it's a zombie (pid=39254)

If I make a pull request for a fix, should I create a new branch within the repo or use a specified one (!= master)?

phryk commented 6 years ago

Bumping because

isislovecruft commented 6 years ago

Hi @phryk! Thank you for reporting this, and I'm very sorry it took me so long to get around to addressing it. This should be fixed for you in version pretty-bad-protocol-3.0.1. If not, please feel free to reopen the issue.