Skip to content

Commit

Permalink
Load file in binary mode in upload-file.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmattsson committed Dec 3, 2024
1 parent 3579f52 commit 4e1a4cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/upload-file.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def parse_args():
def load_file(filename):
"""Open a file and read its contents into memory."""
try:
with open(filename, "r") as f:
with open(filename, "rb") as f:
data = f.read()
return data
except IOError as e:
Expand Down Expand Up @@ -201,7 +201,7 @@ def transmission(data):
for b in data:
if b == STX or b == ETX or b == DLE:
out.append(DLE)
out.append(ord(b))
out.append(b)
out.append(ETX)
return bytes(out)

Expand Down

0 comments on commit 4e1a4cf

Please sign in to comment.