urequests.get() error related to getaddrinfo
Hello:
I just compiled MicroPython for RPI Pico with WIZNET5k support as described here: https://github.com/Wiznet/RP2040-HAT-MicroPython
Ethernet connects and works.
However urequests gives this error:
request = urequests.get('http://bipes.net.br/test.txt')
Traceback (most recent call last):
File "<stdin>", line 14, in <module>
File "urequests.py", line 116, in get
File "urequests.py", line 55, in request
TypeError: function takes 2 positional arguments but 4 were given
I checked urequests.py and the implementation is:
ai = usocket.getaddrinfo(host, port, 0, usocket.SOCK_STREAM)
If I change this line to
ai = usocket.getaddrinfo(host, port)
The problem is solved and urequests.get() works!
However, I am uncertain if this would cause other boards/implementations problems.
Can this fix be applied to urequests.py, or it could break other network implementations?
thanks
Unsatable usocket module
implementation of usocket brings errors when using it.
k=urequests.get("http://google.com")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/urequests.py", line 112, in get
File "/lib/urequests.py", line 53, in request
AttributeError: 'module' object has no attribute 'getaddrinfo'