From 5f966b0b8d61e2abf003439b2f93a9bd19be798c Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 7 Nov 2020 08:41:42 +0100 Subject: 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. --- giscanner/gdumpparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'giscanner/gdumpparser.py') diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py index e7ccf575..3d9720d0 100644 --- a/giscanner/gdumpparser.py +++ b/giscanner/gdumpparser.py @@ -144,7 +144,7 @@ class GDumpParser(object): """Load the library (or executable), returning an XML blob containing data gleaned from GObject's primitive introspection.""" in_path = os.path.join(self._binary.tmpdir, 'functions.txt') - with open(in_path, 'w') as f: + with open(in_path, 'w', encoding='utf-8') as f: for func in self._get_type_functions: f.write('get-type:') f.write(func) -- cgit v1.2.1