massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions

This commit is contained in:
souliane 2015-04-16 14:57:57 +02:00
commit 67ff77e5de

View file

@ -140,28 +140,28 @@ class XEP_0115_handler(XMPPHandler):
c_hash = c_elem['hash']
c_node = c_elem['node']
except KeyError:
log.warning(_('Received invalid capabilities tag: %s') % c_elem.toXml())
log.warning(_(u'Received invalid capabilities tag: %s') % c_elem.toXml())
return
if c_ver in self.host.memory.disco.hashes:
# we already know the hash, we update the jid entity
log.debug ("hash [%(hash)s] already in cache, updating entity [%(jid)s]" % {'hash': c_ver, 'jid': from_jid.full()})
log.debug(u"hash [%(hash)s] already in cache, updating entity [%(jid)s]" % {'hash': c_ver, 'jid': from_jid.full()})
self.host.memory.updateEntityData(from_jid, C.ENTITY_CAP_HASH, c_ver, profile_key=self.profile)
return
if c_hash != 'sha-1': # unknown hash method
log.warning(_('Unknown hash method for entity capabilities: [%(hash_method)s] (entity: %(jid)s, node: %(node)s)') % {'hash_method':c_hash, 'jid': from_jid, 'node': c_node})
log.warning(_(u'Unknown hash method for entity capabilities: [%(hash_method)s] (entity: %(jid)s, node: %(node)s)') % {'hash_method':c_hash, 'jid': from_jid, 'node': c_node})
def cb(dummy):
computed_hash = self.host.memory.getEntityDatum(from_jid, C.ENTITY_CAP_HASH, self.profile)
if computed_hash != c_ver:
log.warning(_('Computed hash differ from given hash:\ngiven: [%(given_hash)s]\ncomputed: [%(computed_hash)s]\n(entity: %(jid)s, node: %(node)s)') % {'given_hash':c_ver, 'computed_hash': computed_hash, 'jid': from_jid, 'node': c_node})
log.warning(_(u'Computed hash differ from given hash:\ngiven: [%(given_hash)s]\ncomputed: [%(computed_hash)s]\n(entity: %(jid)s, node: %(node)s)') % {'given_hash':c_ver, 'computed_hash': computed_hash, 'jid': from_jid, 'node': c_node})
def eb(failure):
if isinstance(failure.value, error.ConnectionDone):
return
msg = failure.value.condition if hasattr(failure.value, 'condition') else failure.getErrorMessage()
log.error(_("Couldn't retrieve disco info for {jid}: {error}").format(jid=from_jid.full(), error=msg))
log.error(_(u"Couldn't retrieve disco info for {jid}: {error}").format(jid=from_jid.full(), error=msg))
d = self.host.getDiscoInfos(from_jid, self.profile)
d.addCallbacks(cb, eb)