fixed dns unicode problem
This commit is contained in:
parent
f4bc9d9722
commit
fa92bc866b
2 changed files with 3 additions and 2 deletions
|
@ -96,7 +96,7 @@ class ClientXMPP(basexmpp, XMLStream):
|
|||
else:
|
||||
logging.debug("Since no address is supplied, attempting SRV lookup.")
|
||||
try:
|
||||
answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.server, "SRV")
|
||||
answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.server, dns.rdatatype.SRV)
|
||||
except dns.resolver.NXDOMAIN:
|
||||
logging.debug("No appropriate SRV record found. Using JID server name.")
|
||||
else:
|
||||
|
|
|
@ -103,10 +103,11 @@ class testpubsubstanzas(unittest.TestCase):
|
|||
iq = self.ps.Iq()
|
||||
iq['pubsub_owner']['default']
|
||||
iq['pubsub_owner']['default']['node'] = 'mynode'
|
||||
iq['pubsub_owner']['default']['type'] = 'leaf'
|
||||
form = xep_0004.Form()
|
||||
form.addField('pubsub#title', ftype='text-single', value='This thing is awesome')
|
||||
iq['pubsub_owner']['default']['config'] = form
|
||||
xmlstring = """<iq id="0"><pubsub xmlns="http://jabber.org/protocol/pubsub#owner"><default node="mynode"><x xmlns="jabber:x:data" type="form"><field var="pubsub#title" type="text-single"><value>This thing is awesome</value></field></x></default></pubsub></iq>"""
|
||||
xmlstring = """<iq id="0"><pubsub xmlns="http://jabber.org/protocol/pubsub#owner"><default node="mynode" type="leaf"><x xmlns="jabber:x:data" type="form"><field var="pubsub#title" type="text-single"><value>This thing is awesome</value></field></x></default></pubsub></iq>"""
|
||||
iq2 = self.ps.Iq(None, self.ps.ET.fromstring(xmlstring))
|
||||
iq3 = self.ps.Iq()
|
||||
values = iq2.getValues()
|
||||
|
|
Loading…
Reference in a new issue