From 200a2158bbb116e61d0e85b441cd67a7fb814584 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Mon, 19 May 2014 09:45:05 -0700 Subject: [PATCH] wikipedia: escape URLs properly --- plugins/util/http.py | 2 +- plugins/wikipedia.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/util/http.py b/plugins/util/http.py index 70d8e24..91759e4 100644 --- a/plugins/util/http.py +++ b/plugins/util/http.py @@ -11,7 +11,7 @@ import urllib2 import urlparse from hashlib import sha1 -from urllib import quote, quote_plus as _quote_plus +from urllib import quote, unquote, quote_plus as _quote_plus from urllib2 import HTTPError, URLError from lxml import etree, html diff --git a/plugins/wikipedia.py b/plugins/wikipedia.py index d99e08b..e4f92a1 100644 --- a/plugins/wikipedia.py +++ b/plugins/wikipedia.py @@ -48,4 +48,4 @@ def wiki(inp): if len(desc) > 300: desc = desc[:300] + '...' - return '%s -- %s' % (desc, http.quote(url, ':/')) + return '%s -- %s' % (desc, http.quote(http.unquote(url), ':/'))