Encoding in both pyAIMt and pyICQt is a mess, and fixing it has been top priority on my py-transports todo list... for about six months now :)
I think so far it's been fixed in this sort of piecemeal fashion, so that throughout the code there is an unorganized mix of encoded and decoded strings. Anyway, I plan to apply some of the user submitted patches to the codebase(s) this weekend, so I'll definitely apply this one too. Thanks, and seriously, if you feel like taking a stab at cleaning up the string handling let me know. I've dealt with python unicode in the past, so I should be able to give advice. In this case it's a little more complicated by the way the AOL packets work, though. ~Chris Julius Schwartzenberg wrote: > Hi, > > I had a problem where I suddenly couldn't add ICQ contacts anymore. > After quite a bit of research & a chat on #python I came up with the > following patch for oscar.py. > > Could this be looked at & maybe applied to SVN? > > Here is the comment from #python I got: > [02:10:56] <TFKyle> Z_God: struct.pack kind of requires bytestrings, so > you probably want to .encode your unicode strings so the results of > struct.pack don't get converted to unicode (failing of course 'cause > binary packed data tends to contain chars outside of ascii) > > This would cause a variable to become a unicode string instead of a > bytestring & if a real bytestring would be appended later, it would try > to decode it as unicode resulting in a UnicodeDecoderException. > > I can imagine there are even more occasions where this needs to be > fixed. I am currently running my PyICQt with only the fix on line 498 > which fixes the "can't add new contacts" problem. > > Thanks in advance, > Julius _______________________________________________ py-transports mailing list py-transports@blathersource.org http://lists.modevia.com/cgi-bin/mailman/listinfo/py-transports