Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Fix possible type inconsistency

Tomas Valenta3bd742678092
diff --git a/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py b/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
index 41d1d81c3..8188f144b 100644
--- a/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
+++ b/packages/python-sdk/e2b/sandbox/filesystem/filesystem.py
@@ -1,5 +1,6 @@
from enum import Enum
from dataclasses import dataclass
+from typing import Optional
from e2b.envd.filesystem import filesystem_pb2
@@ -19,5 +20,5 @@ def map_file_type(ft: filesystem_pb2.FileType):
@dataclass
class EntryInfo:
name: str
- type: FileType
+ type: Optional[FileType]
path: str
diff --git a/packages/python-sdk/e2b/sandbox_async/filesystem/filesystem.py b/packages/python-sdk/e2b/sandbox_async/filesystem/filesystem.py
index 981827e87..7fa1dc5cc 100644
--- a/packages/python-sdk/e2b/sandbox_async/filesystem/filesystem.py
+++ b/packages/python-sdk/e2b/sandbox_async/filesystem/filesystem.py
@@ -212,7 +212,12 @@ class Filesystem:
),
headers=authentication_header(user),
)
- return r.entry
+
+ return EntryInfo(
+ name=r.entry.name,
+ type=map_file_type(r.entry.type),
+ path=r.entry.path,
+ )
except Exception as e:
raise handle_rpc_exception(e)