summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorPaul Varner <fuzzyray@gentoo.org>2014-02-13 16:07:26 -0600
committerPaul Varner <fuzzyray@gentoo.org>2014-02-13 16:07:26 -0600
commit8efbfa771e341b1aac91a098fac7d7fb89e261b5 (patch)
tree51ae4d645e189f1317a15483ece71680e21eff83 /pym
parent0bb06b4a715d4d16be5d7983ec5aa19c6b9bd4ee (diff)
downloadgentoolkit-8efbfa771e341b1aac91a098fac7d7fb89e261b5.tar.gz
Open CONTENTS files as utf-8 to prevent UnicodeDecodeError.
Diffstat (limited to 'pym')
-rw-r--r--pym/gentoolkit/revdep_rebuild/assign.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/gentoolkit/revdep_rebuild/assign.py b/pym/gentoolkit/revdep_rebuild/assign.py
index 2df6532..22565e8 100644
--- a/pym/gentoolkit/revdep_rebuild/assign.py
+++ b/pym/gentoolkit/revdep_rebuild/assign.py
@@ -7,6 +7,7 @@ Functions used for determining the package the broken lib belongs to.
from __future__ import print_function
import os
+import io
import re
import time
current_milli_time = lambda: int(round(time.time() * 1000))
@@ -39,7 +40,7 @@ def assign_packages(broken, logger, settings):
f = pkgpath + '/CONTENTS'
if os.path.exists(f):
try:
- with open(f, 'r') as cnt:
+ with io.open(f, 'r', encoding='utf_8') as cnt:
for line in cnt.readlines():
m = re.match('^obj (/[^ ]+)', line)
if m is not None: