wikipedia: escape URLs properly

This commit is contained in:
Ryan Hitchman 2014-05-19 09:45:05 -07:00
parent 46d733bd5f
commit 200a2158bb
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ import urllib2
import urlparse import urlparse
from hashlib import sha1 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 urllib2 import HTTPError, URLError
from lxml import etree, html from lxml import etree, html

View File

@ -48,4 +48,4 @@ def wiki(inp):
if len(desc) > 300: if len(desc) > 300:
desc = desc[:300] + '...' desc = desc[:300] + '...'
return '%s -- %s' % (desc, http.quote(url, ':/')) return '%s -- %s' % (desc, http.quote(http.unquote(url), ':/'))