Closed Aerolivier closed 5 years ago
Hello.
Very sorry if I'm mistaken but it would appear that files are not closed on the actual MicroPython target device.
I'm using an ESP32-based device (the SHA2017 badge) and notice that I eventually run out of file descriptors and am unable to read more files.
mpfs [/]> cat config.json {} mpfs [/]> cat config.json Failed to read file: config.json mpfs [/]> repl *** Exit REPL with Ctrl+] ***> MicroPython v1.9.1-1344-g5677ea1 on 2017-08-20; SHA2017-Badge with ESP32 Type "help()" for more information. >>> f.close() >>> mpfs [/]> cat config.json {} mpfs [/]> cat config.json Failed to read file: config.json mpfs [/]>
The apparent opened file descriptor seems to originate from this line below:
https://github.com/wendlers/mpfshell/blob/e2a2d2df14bd8411059e3644a05ead6c6327583b/mp/mpfexp.py#L349
Many thanks.
Fixed, thank you!
Hello.
Very sorry if I'm mistaken but it would appear that files are not closed on the actual MicroPython target device.
I'm using an ESP32-based device (the SHA2017 badge) and notice that I eventually run out of file descriptors and am unable to read more files.
The apparent opened file descriptor seems to originate from this line below:
https://github.com/wendlers/mpfshell/blob/e2a2d2df14bd8411059e3644a05ead6c6327583b/mp/mpfexp.py#L349
Many thanks.