From ffaee4c577dd9e7cc2e1d3fb19307f330a34a3c8 Mon Sep 17 00:00:00 2001 From: Taylor Hornby Date: Tue, 8 Oct 2013 17:00:55 -0600 Subject: [PATCH] Correctly encode 'keyhome' into a gpg command. --- GnuPG/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GnuPG/__init__.py b/GnuPG/__init__.py index 7a358d5..7f9c27d 100644 --- a/GnuPG/__init__.py +++ b/GnuPG/__init__.py @@ -2,8 +2,8 @@ import os import subprocess def public_keys( keyhome ): - cmd = '/usr/bin/gpg --homedir %s --list-keys --with-colons' % keyhome - p = subprocess.Popen( cmd.split(' '), stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) + cmd = ['/usr/bin/gpg', '--homedir', keyhome, '--list-keys', '--with-colons'] + p = subprocess.Popen( cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) p.wait() keys = list() for line in p.stdout.readlines():