Commit 4eb521e5 authored by Georg Brandl's avatar Georg Brandl

bug #1462706: guard against host not having FQDN hostname

parent 31fe35bd
......@@ -1130,8 +1130,11 @@ class FileHandler(BaseHandler):
names = None
def get_names(self):
if FileHandler.names is None:
FileHandler.names = (socket.gethostbyname('localhost'),
socket.gethostbyname(socket.gethostname()))
try:
FileHandler.names = (socket.gethostbyname('localhost'),
socket.gethostbyname(socket.gethostname()))
except socket.gaierror:
FileHandler.names = (socket.gethostbyname('localhost'),)
return FileHandler.names
# not entirely sure what the rules are here
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment