Skip to content

Commit cae7df0

Browse files
committed
Merge pull request xmpppy#10 from ivucica/FixCommandsForUnicodeJids
Crashfix: 'From' jid with a non-ASCII char sending a command
2 parents 8e128ce + c2df1e0 commit cae7df0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xmpp/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def _CommandHandler(self,conn,request):
7272
# We must:
7373
# Pass on command execution to command handler
7474
# (Do we need to keep session details here, or can that be done in the command?)
75-
jid = str(request.getTo())
75+
jid = unicode(request.getTo())
7676
try:
7777
node = request.getTagAttr('command','node')
7878
except:
@@ -103,7 +103,7 @@ def _DiscoHandler(self,conn,request,typ):
103103
# To make this code easy to write we add an 'list' disco type, it returns a tuple or 'none' if not advertised
104104
list = []
105105
items = []
106-
jid = str(request.getTo())
106+
jid = unicode(request.getTo())
107107
# Get specific jid based results
108108
if self._handlers.has_key(jid):
109109
for each in self._handlers[jid].keys():

0 commit comments

Comments
 (0)