From c5af8540c2418c9945a5663fbee978b0c4ca0ecd Mon Sep 17 00:00:00 2001 From: emijrp Date: Sun, 10 Apr 2011 09:17:05 +0000 Subject: [PATCH] ampersand in titles git-svn-id: https://wikiteam.googlecode.com/svn/trunk@55 31edc4fc-5e31-b4c4-d58b-c8bc928bcb95 --- dumpgenerator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dumpgenerator.py b/dumpgenerator.py index 65ab1db..8b4cf43 100644 --- a/dumpgenerator.py +++ b/dumpgenerator.py @@ -209,7 +209,9 @@ def getXMLPage(config={}, title=''): #http://www.mediawiki.org/wiki/Manual_talk:Parameters_to_Special:Export#Parameters_no_longer_in_use.3F limit = 1000 truncated = False - title_ = re.sub(' ', '_', title) + title_ = title + title_ = re.sub(' ', '_', title_) + title_ = re.sub('&', '%26', title_) # titles with & need to be converted into %26 headers = {'User-Agent': getUserAgent()} params = {'title': 'Special:Export', 'pages': title_, 'action': 'submit', } if config['curonly']: @@ -267,6 +269,7 @@ def getXMLPage(config={}, title=''): return xml def cleanXML(xml=''): + #do not touch xml codification, as is xml = xml.split('\n')[1] xml = xml.split('')[0] return xml