diff options
author | Paul Varner <fuzzyray@gentoo.org> | 2016-06-30 18:09:52 -0500 |
---|---|---|
committer | Paul Varner <fuzzyray@gentoo.org> | 2016-06-30 18:30:54 -0500 |
commit | 51f3cf18de49ca9dffc34053da53e62930be9fab (patch) | |
tree | 2357f76caec95597a9955d88526c262c29835b9d /pym/gentoolkit/helpers.py | |
parent | equery: Change option --ignore-linguas to --ignore-l10n (diff) | |
download | gentoolkit-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.py | 3 |
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 |