The filesystem layout has changed with MicroPython 1.8.7. os.listdir('/') will now list all filesystems as directory mounts, os.listdir('//') generates an error, so we need to be more careful about what we send to it. Trying to read or create directories or files in '/' will generate 'ENODEV' or sometimes 'EINVAL' so we need to handle these error conditions as well. Also start out the user on '/flash' on connection, as this is where you should, and can, put your files; which should give the same behavior as before. Cherry-picked the commit by mhoffma which instead asks the board for the current directory.
The filesystem layout has changed with MicroPython 1.8.7. os.listdir('/') will now list all filesystems as directory mounts, os.listdir('//') generates an error, so we need to be more careful about what we send to it. Trying to read or create directories or files in '/' will generate 'ENODEV' or sometimes 'EINVAL' so we need to handle these error conditions as well.
Also start out the user on '/flash' on connection, as this is where you should, and can, put your files; which should give the same behavior as before.Cherry-picked the commit by mhoffma which instead asks the board for the current directory.