summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-16 19:51:00 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-16 19:51:00 -0700
commit753d35cb6784fc361c9804800355ff8b6b70a247 (patch)
tree5d29d8e784f7643dbf4739f1d7293ad33399ecb3
parent0d9a52d90144614f813811e59107a75daa888a0a (diff)
downloadportage-753d35cb6784fc361c9804800355ff8b6b70a247.tar.gz
portage-753d35cb6784fc361c9804800355ff8b6b70a247.tar.bz2
portage-753d35cb6784fc361c9804800355ff8b6b70a247.zip
repoman: handle subprocess bug with Python 3.1
-rwxr-xr-xbin/repoman10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/repoman b/bin/repoman
index efd8a01ad..ba810c66c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -2466,7 +2466,15 @@ else:
portage.writemsg_stdout("(%s)\n" % " ".join(add_cmd),
noiselevel=-1)
else:
- add_cmd = [_unicode_encode(arg) for arg in add_cmd]
+ if not (sys.hexversion >= 0x3000000 and sys.hexversion < 0x3020000):
+ # Python 3.1 produces the following TypeError if raw bytes are
+ # passed to subprocess.call():
+ # File "/usr/lib/python3.1/subprocess.py", line 646, in __init__
+ # errread, errwrite)
+ # File "/usr/lib/python3.1/subprocess.py", line 1157, in _execute_child
+ # raise child_exception
+ # TypeError: expected an object with the buffer interface
+ add_cmd = [_unicode_encode(arg) for arg in add_cmd]
retcode = subprocess.call(add_cmd)
if retcode != os.EX_OK:
logging.error(