Create the gpghome directory if specified and if it doesn't exist.
parent
1f51375676
commit
8419542494
13
gnupg.py
13
gnupg.py
|
@ -941,11 +941,11 @@ class GPG(object):
|
||||||
self.gpgbinary = safe_gpgbinary
|
self.gpgbinary = safe_gpgbinary
|
||||||
assert self.gpgbinary, "Could not find gpgbinary %s" % safe_gpgbinary
|
assert self.gpgbinary, "Could not find gpgbinary %s" % safe_gpgbinary
|
||||||
|
|
||||||
if gpghome:
|
safe_gpghome = _fix_unsafe(gpghome)
|
||||||
self.gpghome = gpghome
|
self.gpghome = safe_gpghome
|
||||||
assert _has_readwrite(gpghome), "Need read+write: %s" % gpghome
|
if not os.path.isdir(self.gpghome):
|
||||||
else:
|
os.makedirs(self.gpghome, 0x1C0)
|
||||||
self.gpghome = gpghome
|
assert _has_readwrite(safe_gpghome), "Need read+write: %s" % safe_gpghome
|
||||||
|
|
||||||
safe_keyring = _fix_unsafe(keyring)
|
safe_keyring = _fix_unsafe(keyring)
|
||||||
self.keyring = safe_keyring
|
self.keyring = safe_keyring
|
||||||
|
@ -963,8 +963,7 @@ class GPG(object):
|
||||||
self.encoding = locale.getpreferredencoding()
|
self.encoding = locale.getpreferredencoding()
|
||||||
if self.encoding is None: # This happens on Jython!
|
if self.encoding is None: # This happens on Jython!
|
||||||
self.encoding = sys.stdin.encoding
|
self.encoding = sys.stdin.encoding
|
||||||
if gpghome and not os.path.isdir(self.gpghome):
|
|
||||||
os.makedirs(self.gpghome,0x1C0)
|
|
||||||
p = self._open_subprocess(["--version"])
|
p = self._open_subprocess(["--version"])
|
||||||
result = self.result_map['verify'](self) # any result will do for this
|
result = self.result_map['verify'](self) # any result will do for this
|
||||||
self._collect_output(p, result, stdin=p.stdin)
|
self._collect_output(p, result, stdin=p.stdin)
|
||||||
|
|
Loading…
Reference in New Issue