mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
fix: handle binary data in GoogleCloudFileStore.write (#6145)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
parent
ff9058e28a
commit
8028e2c2dd
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user