Bugs item #3563812, was opened at 2012-08-31 12:08 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3563812...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: WGH () Assigned to: Nobody/Anonymous (nobody) Summary: Line ending inconsistency when using XmlReader
Initial Comment: 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=93...
% 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
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3563812...
pywikipedia-bugs@lists.wikimedia.org