Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: don't fail if searching for marimo apps fail on a file (#1201)

Myles Scolnickddcdf3b42f87
diff --git a/marimo/_server/file_router.py b/marimo/_server/file_router.py
index 896b7ba433..65e212821c 100644
--- a/marimo/_server/file_router.py
+++ b/marimo/_server/file_router.py
@@ -180,14 +180,17 @@ class LazyListOfFilesAppFileRouter(AppFileRouter):
full_path = os.path.join(root, filename)
relative_path = os.path.relpath(full_path, directory)
with open(full_path, "r", encoding="utf-8") as f:
- if "marimo.App" in f.read():
- files.append(
- MarimoFile(
- name=filename,
- path=relative_path,
- last_modified=os.path.getmtime(full_path),
+ try:
+ if "marimo.App" in f.read():
+ files.append(
+ MarimoFile(
+ name=filename,
+ path=relative_path,
+ last_modified=os.path.getmtime(full_path),
+ )
)
- )
+ except Exception as e:
+ LOGGER.debug("Error reading file %s: %s", full_path, e)
LOGGER.debug("Found %d files in directory %s", len(files), directory)
return files