gaierror: (8, 'hostname nor servname provided, or not known')
Laszlo Nagy
gandalf at designaproduct.biz
Mon Jul 31 14:56:49 EDT 2006
faulkner írta:
> my boss has a similar problem with his home internet connection in
> general. he traced it back to his router, which was in the first couple
> generations of routers. how old are the routers you tested this on?
> aside from upgrading them, if they are the problem, i can suggest a
> workaround.
> the first time this exception is raised, your script can automatically
> restart itself.
> os.system('python -c "import time, os; time.sleep(2);
> os.system(\'python yourscriptname.py &\')" &')
> sys.exit(1)
>
My router is a FreeBSD 6.0 system. I'm running a named server on it,
that is our name server on the LAN. The OS was upgraded some months ago.
I tried the same program from a windows system and from other networks
(located in two other countries). I believe this problem is with Python.
However, your idea is fine. I thought the same. Just there is one
problem that hardens me this way. The exception happens in a working
thread. My program has lots of threads and is not supposed to be
terminated from working threads. Calling sys.exit will not be enough.
Well looks like I must do something similar but I do not like the idea.
It is very dirty and non-pythonic.
Best,
Laszlo
More information about the Python-list
mailing list