Last modified: 2014-07-25 07:21:28 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57173, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55173 - Line ending inconsistency when using XmlReader
Line ending inconsistency when using XmlReader
Status: NEW
Product: Pywikibot
Classification: Unclassified
xmlreader.py (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
: 54558 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-05 04:37 UTC by Kunal Mehta (Legoktm)
Modified: 2014-07-25 07:21 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:37:36 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
Comment 1 xqt 2013-10-12 10:42:52 UTC
see also patch at http://sourceforge.net/p/pywikipediabot/patches/565/
Comment 2 xqt 2013-10-12 10:43:27 UTC
*** Bug 54558 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links