Django extauth 'utf-8' exception

I have configured my ejabberd to authenticate users with Django but sometimes I have weird messages from XMPP: 'utf-8' codec can't decode byte 0x83 in position 1: invalid start byte and I can not connect.

The part of code where the Exception occurs:

    length = sys.stdin.read(2)
    (size,) = struct.unpack('>h', length.encode('utf-8'))

Why ejabberd send messages which I can not read? How to fix it?

OK, I've changed the input

OK, I've changed the input encoding to 'latin-1' and it works now

Syndicate content