From 521a71199b7c2a517e4f495d38e3b2b55bf4ad41 Mon Sep 17 00:00:00 2001 From: Alasdair Colley Date: Thu, 5 Sep 2013 10:31:57 +0100 Subject: making it less clever :( --- wikiquery | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wikiquery b/wikiquery index 6ff1aae..edf47cc 100755 --- a/wikiquery +++ b/wikiquery @@ -10,10 +10,12 @@ version = "0.0.2" def display(o): if isinstance(o, list): - # partially apply the unicode.encode function with appropriate encoding and error handling - encode = partial(unicode.encode, encoding="utf-8", errors="replace") - print "'%s'" % "', '".join(map(encode, o)) + output = [] + for item in o: + output.append(item.encode("utf-8", "replace")) + + print "'%s'" % "', '".join(output) else: print o.encode("utf-8", "replace") -- cgit v1.2.3