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.
esp8266: Error OSError: -40 https request
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
esp-8266
MicroPython version
MicroPython v1.22.2 on 2024-02-22; ESP module with ESP8266
Reproduction
import esp
import network
import urequests as requests
esp.osdebug(0)
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect('RT166', 'mypass')
while not wlan.isconnected():
pass
print('network config:', wlan.ifconfig()[0])
bot_token = 'mytoken'
res = requests.get(url=f'https://api.telegram.org/bot{bot_token}/sendMessage', data={
chat_id: '000000',
text: 'hello'
})
print(res.text)
Expected behaviour
No response
Observed behaviour
Traceback (most recent call last):
File "<stdin>", line 26, in <module>
File "requests/__init__.py", line 184, in post
File "requests/__init__.py", line 93, in request
OSError: -40
Additional Information
Hello!
I'm trying to make an http request to the telegram api and I get the OSError error: -40
I searched for information on the Internet, but I never found a solution!
Please tell me how to fix this problem!