changeset 2641:ecf5a2e34ec7

fix #438: traceback in subscriptions.py trying to save item with non-acsii name
author RogerHaase <haaserd@gmail.com>
date Sun, 29 Jun 2014 09:08:23 -0700
parents 1a3f0d0c362a
children bb5a8da5d9e6
files MoinMoin/util/subscriptions.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/subscriptions.py	Tue Jun 17 21:18:46 2014 +0200
+++ b/MoinMoin/util/subscriptions.py	Sun Jun 29 09:08:23 2014 -0700
@@ -37,13 +37,13 @@
     tags = meta.get(TAGS)
     terms = []
     if itemid is not None:
-        terms.extend([Term(SUBSCRIPTION_IDS, "{0}:{1}".format(ITEMID, itemid))])
+        terms.extend([Term(SUBSCRIPTION_IDS, u"{0}:{1}".format(ITEMID, itemid))])
     if namespace is not None:
         if name is not None:
-            terms.extend(Term(SUBSCRIPTION_IDS, "{0}:{1}:{2}".format(NAME, namespace, name_))
+            terms.extend(Term(SUBSCRIPTION_IDS, u"{0}:{1}:{2}".format(NAME, namespace, name_))
                          for name_ in name)
         if tags is not None:
-            terms.extend(Term(SUBSCRIPTION_IDS, "{0}:{1}:{2}".format(TAGS, namespace, tag))
+            terms.extend(Term(SUBSCRIPTION_IDS, u"{0}:{1}:{2}".format(TAGS, namespace, tag))
                          for tag in tags)
     query = Or(terms)
     with flaskg.storage.indexer.ix[LATEST_REVS].searcher() as searcher:
@@ -86,7 +86,7 @@
                     try:
                         pattern = re.compile(pattern, re.U)
                     except re.error:
-                        logging.error("Subscription pattern '{0}' has failed compilation.".format(pattern))
+                        logging.error(u"Subscription pattern '{0}' has failed compilation.".format(pattern))
                         continue
                     if any(pattern.search(name) for name in item_names):
                         matched_subscriptions.append(subscription)