aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Varner <fuzzyray@gentoo.org>2015-11-24 13:59:02 -0600
committerPaul Varner <fuzzyray@gentoo.org>2015-11-24 13:59:02 -0600
commite90e838718c737a1d41e4b8bc64e9e520d65270b (patch)
tree955be636fa2a90f35327246bc9e514591650d51e /pym/gentoolkit/enalyze
parentChange all open() calls to use Unicode. (diff)
downloadgentoolkit-e90e838718c737a1d41e4b8bc64e9e520d65270b.tar.gz
gentoolkit-e90e838718c737a1d41e4b8bc64e9e520d65270b.tar.bz2
gentoolkit-e90e838718c737a1d41e4b8bc64e9e520d65270b.zip
Fix the file open() calls to work with Python 2
The generalized file open call needs to look like: with open(_unicode_encode(path, encoding=_encodings['fs'])) as open_file
Diffstat (limited to 'pym/gentoolkit/enalyze')
-rw-r--r--pym/gentoolkit/enalyze/rebuild.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pym/gentoolkit/enalyze/rebuild.py b/pym/gentoolkit/enalyze/rebuild.py
index 3f9527a..11feb31 100644
--- a/pym/gentoolkit/enalyze/rebuild.py
+++ b/pym/gentoolkit/enalyze/rebuild.py
@@ -352,7 +352,7 @@ class Rebuild(ModuleBase):
"""
if not self.options["quiet"]:
print(' - Saving file: %s' %filepath)
- with open(_unicode_encode(filepath), encoding=_encodings['fs'], mode="w") as output:
+ with open(_unicode_encode(filepath, encoding=_encodings['fs']), mode="w") as output:
output.write('\n'.join(data))
print(" - Done")