Last modified: 2014-07-25 07:21:28 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1508/ Reported by: Anonymous user Created on: 2012-08-31 19:08:06 Subject: Line ending inconsistency when using XmlReader Original description: The following example explains it all: import wikipedia p = wikipedia.Page\(wikipedia.getSite\(\), "User:WGH"\) wikipedia.getall\(wikipedia.getSite\(\), \[p\]\) print "\r\n" in p.get\(\) \# True \(using Special:Export and, in turn, xmlreader\) print "\r\n" in p.get\(force=True\) \# False \(direct api\) It's caused by xmlreader replacing \n with \r\n for some reason. I suggest removing it altogether, because in Pyhon universal newlines are ususally used. Also \r\n line endings confuse mwlib parser. Patch: https://sourceforge.net/tracker/?func=detail&aid=3563805&group\_id=93107&atid=603140 % python version.py Pywikipedia trunk/pywikipedia/ \(r10511, 2012/08/30, 20:40:38\) Python 2.7.3 \(default, Aug 31 2012, 16:05:44\) \[GCC 4.2.1 20070831 patched \[FreeBSD\]\] config-settings: use\_api = True use\_api\_login = True unicode test: ok
see also patch at http://sourceforge.net/p/pywikipediabot/patches/565/
*** Bug 54558 has been marked as a duplicate of this bug. ***