pfalcon / pycopy-lib

Standard library of the Pycopy project, minimalist and light-weight Python language implementation
https://github.com/pfalcon/pycopy
Other
246 stars 70 forks source link

OSError: -40 #71

Open taimojoots opened 2 years ago

taimojoots commented 2 years ago

I am trying to read json data by url on ESP8266.

from urllib.urequest import urlopen
import json
url ="https://dashboard.elering.ee/api/nps/price?start=2021-12-01T21%3A00%3A00.000Z&end=2021-12-02T20%3A00%3A00.000Z"
response = urlopen(url)
data = json.loads(response.read())
print(data) 

I get error message:

Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
  File "/lib/urllib/urequest.py", line 30, in urlopen
OSError: -40

However the code works fine with different URL

url="http://jsonplaceholder.typicode.com/albums/1"