From edc233fc591c02d19401f8ab6fcec78291e3c03f Mon Sep 17 00:00:00 2001 From: Harry Bond Date: Thu, 13 Apr 2023 23:13:05 +0100 Subject: [PATCH] [Tools] prefer English in cat_stat, fix encoded outputs Signed-off-by: Harry Bond --- tools/python/stylesheet/cat_stat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/python/stylesheet/cat_stat.py b/tools/python/stylesheet/cat_stat.py index 47d406c8ae..e7c593f58d 100755 --- a/tools/python/stylesheet/cat_stat.py +++ b/tools/python/stylesheet/cat_stat.py @@ -187,7 +187,7 @@ if __name__ == '__main__': for row in find_popular_taginfo(cursor, seen): r = ['{}={}'.format(row[0], row[1])] + ['']*6 + [row[2]] if wcur is not None: - wcur.execute("select description from wikipages where key=? and value=? and lang in ('en', 'ru') order by lang desc", (row[0], row[1])) + wcur.execute("select description from wikipages where key=? and value=? and lang is 'en'", (row[0], row[1])) wrow = wcur.fetchone() - r.append('' if wrow is None or wrow[0] is None else wrow[0].encode('utf-8')) + r.append('' if wrow is None or wrow[0] is None else wrow[0]) w.writerow(r)