diff options
author | Paul Varner <fuzzyray@gentoo.org> | 2015-11-24 13:59:02 -0600 |
---|---|---|
committer | Paul Varner <fuzzyray@gentoo.org> | 2015-11-24 13:59:02 -0600 |
commit | e90e838718c737a1d41e4b8bc64e9e520d65270b (patch) | |
tree | 955be636fa2a90f35327246bc9e514591650d51e /pym/gentoolkit/enalyze | |
parent | Change all open() calls to use Unicode. (diff) | |
download | gentoolkit-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.py | 2 |
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") |