Adam Kalsey wrote:
>>             status = status.encode("utf-8", "replace")
>>         exceptions.UnicodeDecodeError: 'utf8' codec can't decode byte 
>> 0x88 in position 9: unexpected code byte
>>     
>
> I found the problem buddy, but I don't see what the problem is with 
> their status message exactly. I think I've got the startup crash solved 
> by changing the line to...
>
>       status = status.encode("utf-8", "ignore"

Unicode in python can be frustrating.

When encoding into utf-8 python first needs the string to be in unicode. 
It will implicitly convert into unicode if it's not there already, and 
this is where the first error message came from: python ran across a 
character that it didn't know how to interpret during the conversion to 
unicode.

The solution to this is to fix the decoding step, making it explicit and 
telling python to ignore or replace bad encoding while also telling 
python what encoding to use if we know.

But... what startup crash?

~Chris
_______________________________________________
py-transports mailing list
py-transports@blathersource.org
http://lists.modevia.com/cgi-bin/mailman/listinfo/py-transports

Reply via email to