Skip to content

Commit 2fa61e1

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents af3eb41 + 63899f1 commit 2fa61e1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

api_drivers/py_api_drivers/fs_driver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ def _fs_dir_open_cb(drv, path):
7878
#print(f"_fs_dir_open_cb for path '{path}'")
7979
try:
8080
import os # for ilistdir()
81+
if path != "/":
82+
path = path.rstrip('/') # LittleFS handles trailing flashes fine, but vfs.VfsFat returns an [Errno 22] EINVAL
8183
return {'iterator' : os.ilistdir(path)}
8284
except Exception as e:
83-
print(f"_fs_dir_open_cb exception: {e}")
85+
print(f"_fs_dir_open_cb exception for path {path}: {e}")
8486
return None
8587

8688
def _fs_dir_read_cb(drv, lv_fs_dir_t, buf, btr):

0 commit comments

Comments
 (0)