From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SPfee-00073a-BP for garchives@archives.gentoo.org; Wed, 02 May 2012 19:56:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 40D35E04AB; Wed, 2 May 2012 19:55:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 155FDE04AB for ; Wed, 2 May 2012 19:55:50 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7BBA01B4006 for ; Wed, 2 May 2012 19:55:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3BCE3E5403 for ; Wed, 2 May 2012 19:55:48 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1335988531.15b98eb570a734c9505cb3b82674e7dc36c90b56.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dispatch_conf.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 15b98eb570a734c9505cb3b82674e7dc36c90b56 X-VCS-Branch: master Date: Wed, 2 May 2012 19:55:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 24f4d693-9392-4137-a35d-ac593219d339 X-Archives-Hash: 345895d5fa7944144b6fd45ec6a4ffc8 commit: 15b98eb570a734c9505cb3b82674e7dc36c90b56 Author: Zac Medico gentoo org> AuthorDate: Wed May 2 19:55:31 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed May 2 19:55:31 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D15b98eb5 dispatch-conf: use shlex to parse diff command --- pym/portage/dispatch_conf.py | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py index c81153a..4c68dfc 100644 --- a/pym/portage/dispatch_conf.py +++ b/pym/portage/dispatch_conf.py @@ -13,7 +13,7 @@ import os, shutil, subprocess, sys import portage from portage.env.loaders import KeyValuePairFileLoader from portage.localization import _ -from portage.util import varexpand +from portage.util import shlex_split, varexpand =20 RCS_BRANCH =3D '1.1.1' RCS_LOCK =3D 'rcs -ko -M -l' @@ -30,8 +30,12 @@ def diffstatusoutput(cmd, file1, file2): """ # Use Popen to emulate getstatusoutput(), since getstatusoutput() ma= y # raise a UnicodeDecodeError which makes the output inaccessible. - proc =3D subprocess.Popen(cmd % (file1, file2), - stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT, shell=3DTr= ue) + args =3D shlex_split(cmd % (file1, file2)) + if sys.hexversion < 0x3000000 or sys.hexversion >=3D 0x3020000: + # Python 3.1 does not support bytes in Popen args. + args =3D [portage._unicode_encode(x, errors=3D'strict') for x in= args] + proc =3D subprocess.Popen(args, + stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT) output =3D portage._unicode_decode(proc.communicate()[0]) if output and output[-1] =3D=3D "\n": # getstatusoutput strips one newline