summaryrefslogtreecommitdiff
path: root/giscanner/scannermain.py
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2020-11-07 08:41:42 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2020-11-07 08:57:06 +0100
commit5f966b0b8d61e2abf003439b2f93a9bd19be798c (patch)
tree530128d2a9ee1a0b4cd3c9702d5de5862943aa1f /giscanner/scannermain.py
parent19c67f77e23cf80da957bfa0b28c1b31d81339f0 (diff)
downloadgobject-introspection-5f966b0b8d61e2abf003439b2f93a9bd19be798c.tar.gz
Always pass an encoding to open() using text mode
Otherwise we'll end up using the locale encoding. While it's usually utf-8, that's not the case on Windows. There is one place where a file with filenames is passed, not sure there so I left it and passed a explicit None.
Diffstat (limited to 'giscanner/scannermain.py')
-rw-r--r--giscanner/scannermain.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index ca9065b2..f80b2cfe 100644
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -334,7 +334,7 @@ def extract_filelist(options):
filenames = []
if not os.path.exists(options.filelist):
_error('%s: no such filelist file' % (options.filelist, ))
- with open(options.filelist, "r") as filelist_file:
+ with open(options.filelist, "r", encoding=None) as filelist_file:
lines = filelist_file.readlines()
for line in lines:
# We don't support real C++ parsing yet, but we should be able