Use urllib.quote on str, not unicode, for image titles

pull/469/head
Pokechu22 11 months ago
parent 54d9d8051e
commit 98626d2310

@ -1521,7 +1521,8 @@ def generateImageDump(config={}, other={}, images=[], start='', session=None):
title = u'Image:%s' % (filename)
try:
if config['xmlrevisions'] and config['api'] and config['api'].endswith("api.php"):
r = session.get(config['api'] + u"?action=query&export&exportnowrap&titles=%s" % urllib.quote(title))
quoted_title = urllib.quote(title.encode('utf-8'))
r = session.get(config['api'] + "?action=query&export&exportnowrap&titles=%s" % quoted_title)
xmlfiledesc = r.text
else:
xmlfiledesc = getXMLFileDesc(

Loading…
Cancel
Save