I receive a very different error.
root@Omega-09E9:/proc# oupgrade -version
Device Firmware Version: 0.0.6 b26
root@Omega-09E9:~/test# python3 --version
Python 3.4.3
root@Omega-09E9:~/test# cat test.py
import socket
import encodings.idna
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = socket.gethostname()
port = 9999
s.bind((host, port))
root@Omega-09E9:~/test# python3 test.py
Traceback (most recent call last):
File "prova.py", line 6, in <module>
s.bind((host, port))
socket.gaierror: [Errno -2] Name or service not known
In my case the error is caused by the fact that the hostname cannot be resolved by any DNS.
A simple solution is adding it to /etc/hosts.
root@Omega-09E9:~/test# cat /etc/hosts
127.0.0.1 localhost
127.0.0.1 Omega-09E9