From 5ca0810ca876deb5a2c2819dbaf65eb53e20108a Mon Sep 17 00:00:00 2001 From: pichenettes Date: Mon, 21 Oct 2013 11:27:34 +0200 Subject: [PATCH] Explicitly read input file in binary mode to prevent newline characters from being converted on Windows machines --- stm32loader/stm32loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stm32loader/stm32loader.py b/stm32loader/stm32loader.py index 67e3b6f..6cd5d12 100755 --- a/stm32loader/stm32loader.py +++ b/stm32loader/stm32loader.py @@ -402,7 +402,7 @@ if __name__ == "__main__": # cmd.cmdWriteProtect([0, 1]) if (conf['write'] or conf['verify']): - data = map(lambda c: ord(c), file(args[0]).read()) + data = map(lambda c: ord(c), file(args[0], 'rb').read()) if conf['erase']: cmd.cmdEraseMemory()