From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6D90C138262 for ; Wed, 18 May 2016 16:49:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 790D5142E4; Wed, 18 May 2016 16:49:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1DE20142E4 for ; Wed, 18 May 2016 16:49:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 98ABE34082B for ; Wed, 18 May 2016 16:49:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BF864964 for ; Wed, 18 May 2016 16:49:26 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1463590093.899fe21d9829275816455206a9fb48c496755b96.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/dispatch-conf X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 899fe21d9829275816455206a9fb48c496755b96 X-VCS-Branch: master Date: Wed, 18 May 2016 16:49:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4f260c03-9fa6-47d8-81fa-45487c611fbb X-Archives-Hash: c6aaa86b85ff6e8f00621d4e93856aae commit: 899fe21d9829275816455206a9fb48c496755b96 Author: Zac Medico gentoo org> AuthorDate: Wed Mar 9 06:46:24 2016 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed May 18 16:48:13 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=899fe21d dispatch-conf: fix popen UnicodeDecode error (bug 576788) X-Gentoo-Bug: 576788 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576788 Acked-by: Alexander Berntsen gentoo.org> bin/dispatch-conf | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 678a66d..fdf564e 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -1,5 +1,5 @@ #!/usr/bin/python -bO -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @@ -16,6 +16,7 @@ from __future__ import print_function, unicode_literals import atexit import io import re +import subprocess import sys from stat import ST_GID, ST_MODE, ST_UID @@ -137,9 +138,15 @@ class dispatch: path, basename = os.path.split(path) find_opts = "-maxdepth 1" - with os.popen(FIND_EXTANT_CONFIGS % - (path, find_opts, basename)) as proc: - confs += self.massage(proc.readlines()) + try: + path_list = _unicode_decode(subprocess.check_output( + portage.util.shlex_split(FIND_EXTANT_CONFIGS % + (path, find_opts, basename))), + errors='strict').splitlines() + except subprocess.CalledProcessError: + pass + else: + confs.extend(self.massage(path_list)) if self.options['use-rcs'] == 'yes': for rcs_util in ("rcs", "ci", "co", "rcsmerge"):