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

Michael Torrie torriem at gmail.com
Thu Jul 4 16:53:34 EDT 2013


On 07/04/2013 02:25 PM, Ferrous Cranus wrote:
> try:
> 	host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
> except:
> 	host = "Reverse DNS Failed"
> 
> Is there a way to write the above so i cna print the error return when 
> it fails?
> 

Do you know what IP address causes the failure?  If so write a little
python program that does the socket.gethostbyaddr and run it on the
command line!  Debugging through the CGI interface sucks.

Have you been writing python tests that you can run on the command line
during your development these last weeks?



More information about the Python-list mailing list