aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-09-10 13:45:23 -0700
committerZac Medico <zmedico@gentoo.org>2012-09-10 13:45:23 -0700
commit11d08aca93d6a458cdf71473c22c205d66df57f6 (patch)
tree89a60f59943f0304c3d4b74c9cad24744648294d
parentrepoman: ElementTree.parse: encode unicode path (diff)
downloadportage-11d08aca93d6a458cdf71473c22c205d66df57f6.tar.gz
portage-11d08aca93d6a458cdf71473c22c205d66df57f6.tar.bz2
portage-11d08aca93d6a458cdf71473c22c205d66df57f6.zip
repoman: fix os.system() unicode, bug #310789
-rwxr-xr-xbin/repoman8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/repoman b/bin/repoman
index 54a7c5b8e..53d138c8d 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2786,7 +2786,13 @@ else:
if options.pretend:
print("("+gpgcmd+")")
else:
- rValue = os.system(gpgcmd)
+ # Encode unicode manually for bug #310789.
+ gpgcmd = portage.util.shlex_split(gpgcmd)
+ if sys.hexversion < 0x3000000 or sys.hexversion >= 0x3020000:
+ # Python 3.1 does not support bytes in Popen args.
+ gpgcmd = [_unicode_encode(arg,
+ encoding=_encodings['fs'], errors='strict') for arg in gpgcmd]
+ rValue = subprocess.call(gpgcmd)
if rValue == os.EX_OK:
os.rename(filename+".asc", filename)
else: