Skip to content

Commit

Permalink
add byte order (All-Hands-AI#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufansong committed Mar 29, 2024
1 parent 2def49e commit a7b4a7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opendevin/sandbox/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def parse_docker_exec_output(self, logs: bytes) -> Tuple[bytes, bytes]:
res = b""
tail = b""
i = 0
byte_order = sys.byteorder
while i < len(logs):
prefix = logs[i : i + 8]
if len(prefix) < 8:
Expand All @@ -54,7 +55,7 @@ def parse_docker_exec_output(self, logs: bytes) -> Tuple[bytes, bytes]:
msg_type in [b"\x00", b"\x01", b"\x02", b"\x03"]
and padding == b"\x00\x00\x00"
):
msg_length = int.from_bytes(prefix[4:8]) # , byteorder='big'
msg_length = int.from_bytes(prefix[4:8], byteorder=byte_order)
res += logs[i + 8 : i + 8 + msg_length]
i += 8 + msg_length
else:
Expand Down

0 comments on commit a7b4a7c

Please sign in to comment.