From 10f2d76c62b2361329830b1f1d99e6226e7754c5 Mon Sep 17 00:00:00 2001 From: Valentin Sarthou Date: Fri, 15 Mar 2019 15:52:49 +0100 Subject: [PATCH] Write files in binary format in parse_xml.py Issue: On Windows platforms, when writing files with python in text-mode, LF characters get converted to CRLF. This behavior leads to incorrect code generation in the steps following parse_xml.py Fix: Replace file access mode by 'wb' to avoid any platform-dependent behavior regarding newlines. --- auto/bin/parse_xml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto/bin/parse_xml.py b/auto/bin/parse_xml.py index ff5567f..8c9e7e8 100755 --- a/auto/bin/parse_xml.py +++ b/auto/bin/parse_xml.py @@ -147,13 +147,13 @@ if __name__ == '__main__': if len(options.core): for i in api[2].keys(): - f = open('%s/%s'%(options.core, i), 'w') + f = open('%s/%s'%(options.core, i), 'wb') writeExtension(f, i, api[2][i], api[0], api[1]) f.close() if len(options.extensions): for i in api[3].keys(): - f = open('%s/%s'%(options.extensions, i), 'w') + f = open('%s/%s'%(options.extensions, i), 'wb') writeExtension(f, i, api[3][i], api[0], api[1]) f.close()