Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix possible issue regarding bytes/str decoding #1756

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading