Commit 0fad3496 authored by Michael Büsch's avatar Michael Büsch

awlFileWrite: Fix binary encoding

Signed-off-by: Michael Büsch's avatarMichael Buesch <[email protected]>
parent fdb7c724
......@@ -100,7 +100,8 @@ def awlFileRead(filename, encoding="latin_1"):
return data
def awlFileWrite(filename, data, encoding="latin_1"):
data = "\r\n".join(data.splitlines()) + "\r\n"
if encoding != "binary":
data = "\r\n".join(data.splitlines()) + "\r\n"
for count in range(1000):
tmpFile = "%s-%d-%d.tmp" %\
(filename, random.randint(0, 0xFFFF), count)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment