Hi Vasili,

I had the same issue until I upgraded to pyicq-t-0.8a and applied the
following patch which i found on the webpage written by somebody else a
few days ago.

I hope it works for you too.

Best regards,
Mark


Vasili Sviridov wrote:
> I get following error
> 
> Undefined condition.
> The error condition is not one of those defined by the other conditions in 
> this list.
> ------
> ICQ connection lost! Reason:
> [Failure instance: Traceback: exceptions.UnicodeDecodeError, 'utf8' codec 
> can't decode byte 0xb5 in position 20: unexpected code byte]
> 
> I get to see some online contacts for a split second, and then the 
> connection drops with above error message. Did they change the protocol 
> again?
> 
> V.
> 
> 
> _______________________________________________
> py-transports mailing list
> [email protected]
> http://lists.modevia.com/cgi-bin/mailman/listinfo/py-transports
--- pyicq-t-0.8a/src/legacy/icqt.py.old 2007-06-04 03:10:36.000000000 +0200
+++ pyicq-t-0.8a/src/legacy/icqt.py     2007-08-04 22:27:58.210474250 +0200
@@ -176,12 +176,29 @@

                if user.caps:
                        self.oscarcon.legacyList.setCapabilities(user.name, 
user.caps)
-               status = status.encode("utf-8", "replace")
-               if user.flags.count("away"):
-                       
self.getAway(user.name).addCallback(self.sendAwayPresence, user)
-               else:
-                       c.updatePresence(show=show, status=status, ptype=ptype, 
url=url)
-                       self.oscarcon.legacyList.updateSSIContact(user.name, 
presence=ptype, show=show, status=status, ipaddr=user.icqIPaddy, 
lanipaddr=user.icqLANIPaddy, lanipport=user.icqLANIPport, 
icqprotocol=user.icqProtocolVersion, url=url)
+               try:
+                       try:
+                               status = status.encode("utf-8", "replace")
+                       except UnicodeError:
+                               raise
+                       if user.flags.count("away"):
+                               
self.getAway(user.name).addCallback(self.sendAwayPresence, user)
+                       else:
+                               c.updatePresence(show=show, 
status=status,ptype=ptype, url=url)
+
+                               
self.oscarcon.legacyList.updateSSIContact(user.name, presence=ptype, show=show,
+                                       status=status, ipaddr=user.icqIPaddy, 
lanipaddr=user.icqLANIPaddy,
+                                       lanipport=user.icqLANIPport, 
icqprotocol=user.icqProtocolVersion, url=url)
+               except UnicodeError:
+                       status = "Error while encoding status."
+                       status = status.encode("utf-8","replace")
+                       c.updatePresence(show='away', 
status=status,ptype=ptype, url=url)
+                       self.oscarcon.legacyList.updateSSIContact(user.name,
+                               presence=ptype, show='away', status=status, 
ipaddr=user.icqIPaddy,
+                               lanipaddr=user.icqLANIPaddy, 
lanipport=user.icqLANIPport,
+                               icqprotocol=user.icqProtocolVersion, url=url)
+               except:
+                       pass

        def gotBuddyIconFromServer(self, (contact, icontype, iconhash, iconlen, 
icondata)):
                if config.disableAvatars: return

_______________________________________________
py-transports mailing list
[email protected]
http://lists.modevia.com/cgi-bin/mailman/listinfo/py-transports

Reply via email to