Lokal Profil has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392660 )

Change subject: [BUGFIX]Fix unsafe operation on str that should use unicode
......................................................................

[BUGFIX]Fix unsafe operation on str that should use unicode

The fixes were picked from: I2cebd0dfae63ce0022013ee9b010ccc4e4a540d9

Bug: T180692
Change-Id: I0242e1ffd3cb158e09c62260a6ab21688168807e
---
M erfgoedbot/categorize_images.py
M erfgoedbot/monument_tables.py
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/60/392660/1

diff --git a/erfgoedbot/categorize_images.py b/erfgoedbot/categorize_images.py
index f7c61e0..0310850 100644
--- a/erfgoedbot/categorize_images.py
+++ b/erfgoedbot/categorize_images.py
@@ -531,7 +531,7 @@
             total_images = '---'
 
         if row.get('cat'):
-            cat_link = '[[:Category:{0}]]'.format(row['cat'])
+            cat_link = u'[[:Category:{0}]]'.format(row['cat'])
             pages_in_cat = '{{PAGESINCATEGORY:%s|files}}' % row['cat']
 
         if row.get('template'):
@@ -586,7 +586,7 @@
 def skip(country_code, lang, country_config):
     """Return a outputStatistics compatible summary for a skipped country."""
     site = pywikibot.Site(u'commons', u'commons')
-    commons_category_base = pywikibot.Category(site, "{ns}:{cat}".format(
+    commons_category_base = pywikibot.Category(site, u'{ns}:{cat}'.format(
         ns=site.namespace(14), cat=country_config.get('commonsCategoryBase')))
     commons_template = country_config.get('commonsTemplate')
     return {
diff --git a/erfgoedbot/monument_tables.py b/erfgoedbot/monument_tables.py
index a6fd148..940bdca 100755
--- a/erfgoedbot/monument_tables.py
+++ b/erfgoedbot/monument_tables.py
@@ -28,11 +28,11 @@
             sql = process_classic_config(country_config)
     except Exception as e:
         raise Exception(
-            '{exception} for countrycode: {country}, lang: {lang}'.format(
+            u'{exception} for countrycode: {country}, lang: {lang}'.format(
                 exception=e, country=country_code, lang=lang))
 
     f = open(os.path.join(
-        get_sql_dir(), 'create_table_{}.sql'.format(table)), 'w')
+        get_sql_dir(), u'create_table_{}.sql'.format(table)), 'w')
     f.write(sql)
     f.close()
 
@@ -70,7 +70,7 @@
                     typ += ' NOT NULL DEFAULT 0'
             elif typ.startswith("varchar("):
                 if field.get('default'):
-                    typ += " NOT NULL DEFAULT '{}'".format(
+                    typ += u" NOT NULL DEFAULT '{}'".format(
                         field.get('default'))
                 else:
                     typ += " NOT NULL DEFAULT ''"

-- 
To view, visit https://gerrit.wikimedia.org/r/392660
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0242e1ffd3cb158e09c62260a6ab21688168807e
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to