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 89C0759CA3 for ; Mon, 14 Mar 2016 03:18:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A3E4F21C028; Mon, 14 Mar 2016 03:18:41 +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 C3CC621C027 for ; Mon, 14 Mar 2016 03:18:40 +0000 (UTC) Received: from localhost.localdomain (ip68-5-185-102.oc.oc.cox.net [68.5.185.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id B5C8134091A; Mon, 14 Mar 2016 03:18:39 +0000 (UTC) From: Zac Medico To: gentoo-portage-dev@lists.gentoo.org Cc: Zac Medico Subject: [gentoo-portage-dev] [PATCH] dispatch-conf: fix popen UnicodeDecode error (bug 576788) Date: Sun, 13 Mar 2016 20:18:12 -0700 Message-Id: <1457925492-28252-1-git-send-email-zmedico@gentoo.org> X-Mailer: git-send-email 2.7.2 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: 46aa276f-b36d-4f89-9528-d38c8cbd120c X-Archives-Hash: 94d01378b176c482c06233c35de66c0d X-Gentoo-Bug: 576788 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576788 --- 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"): -- 2.7.2