diff src/memory/disco.py @ 1409:3265a2639182

massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions
author souliane <souliane@mailoo.org>
date Thu, 16 Apr 2015 14:57:57 +0200
parents 069ad98b360d
children 159d16336f87
line wrap: on
line diff
--- a/src/memory/disco.py	Thu Apr 16 13:31:14 2015 +0200
+++ b/src/memory/disco.py	Thu Apr 16 14:57:57 2015 +0200
@@ -131,9 +131,9 @@
             # we cache items only for our own server
             try:
                 items = self.host.memory.getEntityData(jid_, ["DISCO_ITEMS"], client.profile)["DISCO_ITEMS"]
-                log.debug("[%s] disco items are in cache" % jid_.full())
+                log.debug(u"[%s] disco items are in cache" % jid_.full())
             except (KeyError, exceptions.UnknownEntityError):
-                log.debug("Caching [%s] disco items" % jid_.full())
+                log.debug(u"Caching [%s] disco items" % jid_.full())
                 items = yield client.disco.requestItems(jid_, nodeIdentifier)
                 self.host.memory.updateEntityData(jid_, "DISCO_ITEMS", items, profile_key=client.profile)
         else:
@@ -144,7 +144,7 @@
 
     def _infosEb(self, failure, entity_jid):
         failure.trap(StanzaError)
-        log.warning(_("Error while requesting [%(jid)s]: %(error)s") % {'jid': entity_jid.full(),
+        log.warning(_(u"Error while requesting [%(jid)s]: %(error)s") % {'jid': entity_jid.full(),
                                                                     'error': failure.getErrorMessage()})
 
     def findServiceEntities(self, category, type_, jid_=None, profile_key=C.PROF_KEY_NONE):
@@ -243,7 +243,7 @@
             s.append('<')
         #TODO: manage XEP-0128 data form here
         cap_hash = b64encode(sha1(''.join(s)).digest())
-        log.debug(_('Capability hash generated: [%s]') % cap_hash)
+        log.debug(_(u'Capability hash generated: [%s]') % cap_hash)
         return cap_hash
 
     @defer.inlineCallbacks