UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

Νίκος Gr33k nikos at superhost.gr
Fri Jul 5 03:13:59 EDT 2013


Στις 5/7/2013 10:06 πμ, ο/η Lele Gaifax έγραψε:
>      try:
>      	host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
>      except:
>      	host = "Reverse DNS Failed"


Yes i uses to had it like that, until i was looking for ways to make it 
hold the error

except Exception as e:
	print( e )
	host = e

but print( e ) in the way i used to had it doesn't print out the error, 
it instead gives an internal server error on browser.

I must somehow take a look at the error to understand why every visitor 
i have gets UnResolved, but how since prints fails?

-- 
What is now proved was at first only imagined!



More information about the Python-list mailing list