Skip to content

Commit

Permalink
Merge pull request #1756 from globus/fix_task_info_mypy
Browse files Browse the repository at this point in the history
fix possible issue regarding bytes/str decoding
  • Loading branch information
LeiGlobus authored Jan 9, 2025
2 parents 61dc09a + 1422d77 commit 52d15e4
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ def pack(self) -> bytes:
#
# all of this code is going to be eliminated soonish by
# globus_compute_common.messagepack in part because of issues like this
add_ons = (
f"TID={self.task_id};CID={self.container_id};" # type: ignore
f"{self.task_buffer}"
)
if isinstance(self.task_buffer, bytes):
buf = self.task_buffer.decode()
else:
buf = self.task_buffer
add_ons = f"TID={self.task_id};CID={self.container_id};{buf}"
self.raw_buffer = add_ons.encode("utf-8")

return self.type.pack() + self.raw_buffer
Expand Down

0 comments on commit 52d15e4

Please sign in to comment.