Skip to content

Commit 4faa3b8

Browse files
fs_driver.py: fix "Back" issue on VfsFat due to trailing slash
1 parent c4eece4 commit 4faa3b8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

internal_filesystem/lib/mpos/fs_driver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def _fs_dir_open_cb(drv, path):
7979
#print(f"_fs_dir_open_cb for path '{path}'")
8080
try:
8181
import os # for ilistdir()
82+
path = path.rstrip('/') # LittleFS handles trailing flashes fine, but vfs.VfsFat returns an [Errno 22] EINVAL
8283
return {'iterator' : os.ilistdir(path)}
8384
except Exception as e:
8485
print(f"_fs_dir_open_cb exception: {e}")

0 commit comments

Comments
 (0)