| Issue 128: | "exceptions.TypeError: decoding Unicode is not supported" when non-latin nickname | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1. Have a contact who has specified non-latin nickname on the ICQ server
2. request "User info" for this contact
3. you will be kicked off, with error trace in the log (specify "-d" option)
What is the expected output? What do you see instead?
-
What version of the product are you using? On what operating system?
Version: 0.8a-4
.deb package on Debian etch
Please provide any additional information below.
=====
File "/usr/share/jabber-pyicq/src/legacy/icqt.py", line 80, in
gotUserInfo
self.oscarcon.gotvCard(self.oscarcon.userinfoCollection[id])
File "/usr/share/jabber-pyicq/src/legacy/glue.py", line 497, in
gotvCard
self.legacyList.updateNickname(usercol.userinfo, usercol.nick)
File "/usr/share/jabber-pyicq/src/legacy/buddies.py", line 170,
in updateNickname
c.updateNickname(nick, push=True)
File "/usr/share/jabber-pyicq/src/contact.py", line 145, in
updateNickname
if unicode(self.nickname, errors='replace') != "nickname":
exceptions.TypeError: decoding Unicode is not supported
========
Apparently when Contact.updateNickname is called, the argument has been
already converted to UTF-8. When a unicode object is passed to "unicode"
function, Python raises exception *even* if you specify "errors='replace'".
This can be verified by trying to execute "unicode(u'',errors='replace')"
The following diff helps, though I don't know how "correct" it is"
--- src/contact.py.orig 2008-01-23 16:56:23.000000000 +0300
+++ src/contact.py 2008-01-23 17:03:02.000000000 +0300
@@ -142,7 +142,7 @@
self.contactList.legacyList.deauthContact(self.jid)
def updateNickname(self, nickname, push=True):
- if unicode(self.nickname, errors='replace') != "nickname":
+ if self.nickname != "nickname":
self.nickname = nickname
# will re-remove this if it's removed from JEP-0172.
#self.sendNickname()
Jan 28, 2008
#1
maxim.br...@gmail.com
Jan 29, 2008
Yes - this is fixed in 0.8b (SVN changeset 230).
Status:
Fixed
|