JetBrains/intellij-micropython

REPL blocks port 80

animalmutch opened this issue · 0 comments

When attempting to run a web server (e.g. this tutorial https://www.petecodes.co.uk/creating-a-basic-raspberry-pi-pico-web-server-using-micropython/), you get OSError: [Errno 98] EADDRINUSE when attempting to bind to port 80 when running the script through REPL (just importing the script).

Envirnoment:

Raspberry Pi Pico W
PyCharm 2022.1.4 (Professional Edition). Build #PY-221.6008.17, built on July 20, 2022.
Latest UF2 from raspberrypi.com (https://micropython.org/download/rp2-pico-w/rp2-pico-w-latest.uf2)

Minimal code example to run on REPL to reproduce:

>>> import socket
>>> s = socket.socket()
>>> s.bind(socket.getaddrinfo('0.0.0.0', 80)[0][-1])

It's possible to bind to other ports, just not port 80.

If you just name the script main.py and let it run, it works fine. It's just through the REPL on the PyCharm Micropython plugin. The same script works fine running in Thonny