summaryrefslogtreecommitdiff
path: root/misc
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 /misc
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 'misc')
-rw-r--r--misc/update-gtkdoc-tests.py2
-rw-r--r--misc/update-vulkan-gir.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/misc/update-gtkdoc-tests.py b/misc/update-gtkdoc-tests.py
index c182fc11..6f45e348 100644
--- a/misc/update-gtkdoc-tests.py
+++ b/misc/update-gtkdoc-tests.py
@@ -191,7 +191,7 @@ if __name__ == '__main__':
writer = GtkDocCommentBlockWriter(indent=True)
logger.enable_warnings(True)
- with io.open(path, 'r') as f:
+ with io.open(path, 'r', encoding='utf-8') as f:
lines = f.readlines()
chunks = []
diff --git a/misc/update-vulkan-gir.py b/misc/update-vulkan-gir.py
index 89792c12..4154702a 100644
--- a/misc/update-vulkan-gir.py
+++ b/misc/update-vulkan-gir.py
@@ -24,7 +24,7 @@ def show_func_defs(filename, output, extra_cpp_args=None):
ast = parse_file(filename, use_cpp=True,
cpp_args=extra_cpp_args)
- with open(output, 'w') as f:
+ with open(output, 'w', encoding='utf-8') as f:
f.write("""<?xml version="1.0"?>
<repository version="1.2"
xmlns="http://www.gtk.org/introspection/core/1.0"