Sanitise input 'options' to GPG.__init__().

feature/documentation-builds-dirhtml
Isis Lovecruft 2013-03-07 04:19:49 +00:00 committed by Isis Lovecruft
parent a228c91fa7
commit 845ac96de8
1 changed files with 3 additions and 5 deletions

View File

@ -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):
""" """