aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Varner <fuzzyray@gentoo.org>2016-06-30 18:09:52 -0500
committerPaul Varner <fuzzyray@gentoo.org>2016-06-30 18:30:54 -0500
commit51f3cf18de49ca9dffc34053da53e62930be9fab (patch)
tree2357f76caec95597a9955d88526c262c29835b9d /pym/gentoolkit/helpers.py
parentequery: Change option --ignore-linguas to --ignore-l10n (diff)
downloadgentoolkit-51f3cf18de49ca9dffc34053da53e62930be9fab.tar.gz
gentoolkit-51f3cf18de49ca9dffc34053da53e62930be9fab.tar.bz2
gentoolkit-51f3cf18de49ca9dffc34053da53e62930be9fab.zip
Change open function to use UTF-8 encoding for content.
Uses io.open for Python 2 and built-in open for Python 3 All data from files is treated as Unicode and this should fix most UnicodeDecodeErrors.
Diffstat (limited to 'pym/gentoolkit/helpers.py')
-rw-r--r--pym/gentoolkit/helpers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index b7314b9..0d985b6 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -195,7 +195,8 @@ class ChangeLog(object):
result = []
partial_entries = []
with open(_unicode_encode(self.changelog_path,
- encoding=_encodings['fs'], errors="replace")) as log:
+ encoding=_encodings['fs'], errors="replace"),
+ encoding=_encodings['content']) as log:
for line in log:
if line.startswith('#'):
continue