http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9802
Revision: 9802 Author: xqt Date: 2011-12-15 08:45:18 +0000 (Thu, 15 Dec 2011) Log Message: ----------- re.escape() needed for matching Page.section() in page text
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2011-12-12 16:35:15 UTC (rev 9801) +++ trunk/pywikipedia/wikipedia.py 2011-12-15 08:45:18 UTC (rev 9802) @@ -696,7 +696,7 @@ self._expandcontents = contents else: self._contents = contents - hn = self.section() + hn = re.escape(self.section()) if hn: m = re.search("=+[ ']*%s[ ']*=+" % hn, self._contents) if verbose and not m: