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

Lele Gaifax lele at metapensiero.it
Fri Jul 5 06:36:58 EDT 2013


Νίκος Gr33k <nikos at superhost.gr> writes:

> Στις 5/7/2013 12:25 μμ, ο/η Νίκος Gr33k έγραψε:
>>
>> try:
>>      remadd = os.environ('REMOTE_ADDR')
>>      tuple3 = socket.gethostbyaddr(remadd)
>>      host = tuple3[0]
>> except Exception as e:
>>      host = repr(e)
>
>> which yields: TypeError("'_Environ' object is not callable",)
>
> Any thoufgs as to why os.environ('REMOTE_ADDR') gives the above error?

Yes, I'd try to understand the error message, and eventually lookup the
documentation on os.environ to see what type of object it is bound
to. The solution should be easy.

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at metapensiero.it  |                 -- Fortunato Depero, 1929.




More information about the Python-list mailing list