On Thu, 4 Jul 2013, Νίκος Γκρ33κ wrote:
Στις 4/7/2013 6:10 μμ, ο/η MRAB έγραψε:
What do you mean "I don't know how to catch the exception with
OSError"? You've tried "except socket.gaierror" and "except
socket.herror", well just write "except OSError" instead!
try:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
except OSError:
host = "UnResolved"
produces also an internal server error.
Are you sure is just except OSError ?
Have you ensured that 'REMOTE_ADDR' is actually a key in os.environ? I
highly recommend using the logging module to help diagnose what the actual
exception is.
HTH,
-W
--
http://mail.python.org/mailman/listinfo/python-list