Close process FDs after __init__() sanity check.
* FIXES and issue discovered by ttanner (https://github.com/ttanner) in `gnupg._meta.GPGBase._check_sane_and_get_gpg_version()` where the GnuPG process wasn't closed and its file descriptors were left hanging. * FIXES part of Issue #63. https://github.com/isislovecruft/python-gnupg/issues/63 There were so many hanging FD issues when I started patching upstream python-gnupg ― I doubt I found all of them. I probably even introduced some along the way. And, as ttanner pointed out, this patch doesn't fix the issue fully, so there are likely more.fix/63-hanging-fd
parent
432833bdcb
commit
4a8a8c8592
|
@ -448,6 +448,8 @@ class GPGBase(object):
|
|||
self._read_data(proc.stdout, result)
|
||||
if proc.returncode:
|
||||
raise RuntimeError("Error invoking gpg: %s" % result.data)
|
||||
else:
|
||||
proc.terminate()
|
||||
|
||||
version_line = str(result.data).partition(':version:')[2]
|
||||
self.binary_version = version_line.split('\n')[0]
|
||||
|
|
Loading…
Reference in New Issue