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/eshowkw/keywords_header.py | |
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/eshowkw/keywords_header.py')
-rw-r--r-- | pym/gentoolkit/eshowkw/keywords_header.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pym/gentoolkit/eshowkw/keywords_header.py b/pym/gentoolkit/eshowkw/keywords_header.py index 9ca0364..7bf71d0 100644 --- a/pym/gentoolkit/eshowkw/keywords_header.py +++ b/pym/gentoolkit/eshowkw/keywords_header.py @@ -31,7 +31,7 @@ def load_profile_data(portdir=None, repo='gentoo'): try: arch_list = os.path.join(portdir, 'profiles', 'arch.list') - with open(_unicode_encode(arch_list), encoding=_encodings['fs']) as f: + with open(_unicode_encode(arch_list, encoding=_encodings['fs'])) as f: for line in f: line = line.split('#', 1)[0].strip() if line: @@ -47,7 +47,7 @@ def load_profile_data(portdir=None, repo='gentoo'): None: 3, } profiles_list = os.path.join(portdir, 'profiles', 'profiles.desc') - with open(_unicode_encode(profiles_list), encoding=_encodings['fs']) as f: + with open(_unicode_encode(profiles_list, encoding=_encodings['fs'])) as f: for line in f: line = line.split('#', 1)[0].split() if line: |