From 09c5249203456e86d5a6d15e7a5ba62705389b2b Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Sun, 23 Nov 2025 05:26:34 +0100 Subject: [PATCH] fs_driver.py: don't remove / from / --- internal_filesystem/lib/mpos/fs_driver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal_filesystem/lib/mpos/fs_driver.py b/internal_filesystem/lib/mpos/fs_driver.py index 3637cfb2..3011cdda 100644 --- a/internal_filesystem/lib/mpos/fs_driver.py +++ b/internal_filesystem/lib/mpos/fs_driver.py @@ -79,10 +79,11 @@ def _fs_dir_open_cb(drv, path): #print(f"_fs_dir_open_cb for path '{path}'") try: import os # for ilistdir() - path = path.rstrip('/') # LittleFS handles trailing flashes fine, but vfs.VfsFat returns an [Errno 22] EINVAL + if path != "/": + path = path.rstrip('/') # LittleFS handles trailing flashes fine, but vfs.VfsFat returns an [Errno 22] EINVAL return {'iterator' : os.ilistdir(path)} except Exception as e: - print(f"_fs_dir_open_cb exception: {e}") + print(f"_fs_dir_open_cb exception for path {path}: {e}") return None def _fs_dir_read_cb(drv, lv_fs_dir_t, buf, btr):