Ma7moud3ly / micro-repl

MIT License
56 stars 4 forks source link

FilesManager.decodeFiles doesn't support tuples without size #5

Closed antweb closed 2 months ago

antweb commented 11 months ago

Hi!

I'm trying to get the file explorer feature to work on the flow3r badge (ESP32-S3 / MicroPython with a bunch of customizations) and ran into the following issue:

FilesManager.decodeFiles() is assuming that all elements returned by os.ilistdir() have four tuple members. But according to the MicroPython docs, the last element (size) is optional.

From what I can see, the size value in MicroFile is not used anyway, so it should be safe to fall back to 0/-1. I've created a a potential fix. Let me know what you think about the approach.

Ma7moud3ly commented 2 months ago

Hello @antweb I'm sorry, I'm too late to see that issue. But thanks to your suggestion it should be fixed now ✅ I hope you made a pull request since then it would have helped a lot. Thanks