diff options
author | Zac Medico <zmedico@gentoo.org> | 2016-03-08 22:46:24 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2016-05-18 09:48:13 -0700 |
commit | 899fe21d9829275816455206a9fb48c496755b96 (patch) | |
tree | 3b94dcc3cc554a982970ba816609ea14ed25f9c7 /bin/dispatch-conf | |
parent | Manifest._apply_max_mtime: handle EPERM from utime (bug 582388) (diff) | |
download | portage-899fe21d9829275816455206a9fb48c496755b96.tar.gz portage-899fe21d9829275816455206a9fb48c496755b96.tar.bz2 portage-899fe21d9829275816455206a9fb48c496755b96.zip |
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 <bernalex@gentoo.org>
Diffstat (limited to 'bin/dispatch-conf')
-rwxr-xr-x | bin/dispatch-conf | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 678a66d7c..fdf564e69 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"): |