os.rmdir() deletes files
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
rp2, esp32, esp8266
MicroPython version
Micropython 1.22.2
Reproduction
open("prova.tmp", 'w').write('1')
1
import os
os.rmdir("prova.tmp")
open("prova.tmp", 'r')
Expected behaviour
rmdir() should raise OSError
Regular Python raises NotADirectoryError
Observed behaviour
rmdir() succeeds and the file is deleted.
open("prova.tmp", 'r')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 2] ENOENT
Additional Information
No, I've provided everything above.
SAMD51 on Wio Terminal : No file transfer/write + _boot.py error for firmware v1.21 & v1.22 (working on v1.20) -> Was Wio Terminal hardware issue
Checks
-
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
-
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
SAMD51 : Wio Terminal (SeeedStudio)
MicroPython version
MicroPython v1.22.2 on 2024-02-22; Wio Terminal D51R with SAMD51P19A
Also MicroPython v1.21 for same plateform
Reproduction
Make Soft Reboot show the error
MicroPython v1.22.2 on 2024-02-22; Wio Terminal D51R with SAMD51P19A
MPY: soft reboot
Traceback (most recent call last):
File "_boot.py", line 14, in <module>
OSError: 28
Making a file copy with mpremote fs cp ... or with Thonny IDE fails with an error message
Expected behaviour
Being able to copy files to the MicroPython file system.
Observed behaviour
Error message related to file handling
$ mpremote fs cp readme.md :readme.md
cp readme.md :readme.md
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
Additional Information
Works on MicroPython v1.20 for Wio Terminal
Fails on MicroPython v1.21 for Wio Terminal
Fails on MicroPython v1.22 for Wio Terminal