Sanitise input 'options' to GPG.__init__().
parent
a228c91fa7
commit
845ac96de8
8
gnupg.py
8
gnupg.py
|
@ -1001,9 +1001,7 @@ class GPG(object):
|
||||||
assert isinstance(use_agent, bool), "'use_agent' must be boolean"
|
assert isinstance(use_agent, bool), "'use_agent' must be boolean"
|
||||||
self.use_agent = use_agent
|
self.use_agent = use_agent
|
||||||
|
|
||||||
if isinstance(options, str):
|
self.options = _sanitize(options)
|
||||||
options = [options]
|
|
||||||
self.options = options
|
|
||||||
|
|
||||||
## xxx TODO: hack the locale module away so we can use this on android
|
## xxx TODO: hack the locale module away so we can use this on android
|
||||||
self.encoding = locale.getpreferredencoding()
|
self.encoding = locale.getpreferredencoding()
|
||||||
|
@ -1014,8 +1012,8 @@ class GPG(object):
|
||||||
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)
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise ValueError("Error invoking gpg: %s: %s" % (p.returncode,
|
raise ValueError("Error invoking gpg: %s: %s"
|
||||||
result.stderr))
|
% (p.returncode, result.stderr))
|
||||||
|
|
||||||
def make_args(self, args, passphrase):
|
def make_args(self, args, passphrase):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue