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 1SPKWP-0002QW-TP for garchives@archives.gentoo.org; Tue, 01 May 2012 21:22:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7144EE0AA2; Tue, 1 May 2012 21:22:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3D335E0AA2 for ; Tue, 1 May 2012 21:22:01 +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 7563E1B4037 for ; Tue, 1 May 2012 21:22:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 32382E5403 for ; Tue, 1 May 2012 21:21:59 +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: <1335907304.09bdb69ac31146cbb3f258118a1aea0744b96379.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/_desktop_entry.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 09bdb69ac31146cbb3f258118a1aea0744b96379 X-VCS-Branch: master Date: Tue, 1 May 2012 21:21:59 +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: 4298161f-80d6-431e-aef4-45a6ccceacb8 X-Archives-Hash: b9791f2579d1f7129f8b2da16e520e98 commit: 09bdb69ac31146cbb3f258118a1aea0744b96379 Author: Zac Medico gentoo org> AuthorDate: Tue May 1 21:21:44 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue May 1 21:21:44 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D09bdb69a validate_desktop_entry: handle Python 3.1 --- pym/portage/util/_desktop_entry.py | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/pym/portage/util/_desktop_entry.py b/pym/portage/util/_deskt= op_entry.py index 101965f..7901780 100644 --- a/pym/portage/util/_desktop_entry.py +++ b/pym/portage/util/_desktop_entry.py @@ -3,6 +3,7 @@ =20 import io import subprocess +import sys =20 try: from configparser import Error as ConfigParserError, RawConfigParser @@ -41,7 +42,11 @@ _ignored_service_errors =3D ( ) =20 def validate_desktop_entry(path): - proc =3D subprocess.Popen([b"desktop-file-validate", _unicode_encode(pa= th)], + args =3D ["desktop-file-validate", path] + if sys.hexversion < 0x3000000 or sys.hexversion >=3D 0x3020000: + # Python 3.1 does not support bytes in Popen args. + args =3D [_unicode_encode(x, errors=3D'strict') for x in args] + proc =3D subprocess.Popen(args, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT) output_lines =3D _unicode_decode(proc.communicate()[0]).splitlines() proc.wait()