fix: handle binary data in GoogleCloudFileStore.write (#6145)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Robert Brennan 2025-01-08 12:36:34 -05:00 committed by GitHub
parent ff9058e28a
commit 8028e2c2dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,8 @@ class GoogleCloudFileStore(FileStore):
def write(self, path: str, contents: str | bytes) -> None:
blob = self.bucket.blob(path)
with blob.open('w') as f:
mode = 'wb' if isinstance(contents, bytes) else 'w'
with blob.open(mode) as f:
f.write(contents)
def read(self, path: str) -> str: