Skip to content

Commit

Permalink
Fix for list including current directory
Browse files Browse the repository at this point in the history
  • Loading branch information
tofarr committed Nov 22, 2024
1 parent 108765b commit 4f30b38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openhands/storage/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def read(self, path: str) -> str:
raise FileNotFoundError(f'Failed to read from S3 at path {path}: {e}')

def list(self, path: str) -> list[str]:
if path and path != "/" and not path.endswith("/"):
path += "/"
try:
return [
obj.object_name for obj in self.client.list_objects(self.bucket, path)
Expand Down

0 comments on commit 4f30b38

Please sign in to comment.