diff options
author | Florian Bruhin <git@the-compiler.org> | 2014-08-20 20:33:14 +0200 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2014-08-20 20:33:14 +0200 |
commit | 17dd4732ae4807d73ce6f780fbafb5c46cf0999d (patch) | |
tree | 431b91d29a4fb94030940a45dc5cf07a1ff03ea5 /scripts/setupcommon.py | |
parent | fb8ef69a6306f424d35696e0a3db6c139d4559a2 (diff) | |
download | qutebrowser-17dd4732ae4807d73ce6f780fbafb5c46cf0999d.tar.gz qutebrowser-17dd4732ae4807d73ce6f780fbafb5c46cf0999d.zip |
Add explicit encoding to open() calls.
Diffstat (limited to 'scripts/setupcommon.py')
-rw-r--r-- | scripts/setupcommon.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/setupcommon.py b/scripts/setupcommon.py index 047b1816c..65179dc15 100644 --- a/scripts/setupcommon.py +++ b/scripts/setupcommon.py @@ -35,7 +35,7 @@ BASEDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), def read_file(name): """Get the string contained in the file named name.""" - with open(name, encoding='utf-8') as f: + with open(name, 'r', encoding='utf-8') as f: return f.read() @@ -87,7 +87,8 @@ def write_git_file(): gitstr = _git_str() if gitstr is None: gitstr = '' - with open(os.path.join(BASEDIR, 'qutebrowser', 'git-commit-id'), 'w') as f: + path = os.path.join(BASEDIR, 'qutebrowser', 'git-commit-id') + with open(path, 'w', encoding='utf-8') as f: f.write(gitstr) |