Hi all;
I think that there is an error in xmlreader.py. When parsing a full revision
XML (in this case[1]), using this code[2] (look at the try-catch, it writes
when fails) I get correctly username, timestamp and revisionid, but
sometimes, the page title and the page id are None or empty string.
The first error is:
['', None, 'QuartierLatin1968', '2004-10-10T04:24:14Z', '4267']
But if we do:
7za e -bd -so kwwiki-20100926-pages-meta-history.xml.7z 2>/dev/null | egrep
-i '2004-10-10T04::14Z' -C20
We get this[3], which is OK, the page title and the page id are available in
the XML, but not correctly parsed. And this is not the only page title and
page it that fails.
Perhaps I have missed something, because I'm learning to parsing XML. Sorry
in that case.
Regards,
emijrp
[1]
http://download.wikimedia.org/kwwiki/20100926/kwwiki-20100926-pages-meta-hi…
[2] http://pastebin.ca/1951930
[3] http://pastebin.ca/1951937
Hi All,
I had set up system such that every day the pymediawiki would insert a page
into my local wiki (csdms.colorado.edu). This worked fine for a year till I
updated to mediawiki 1.16.0 (from 1.15.4). Since than the pagefromfile.py
isn't working anymore for me.
I updated all the pywikipedia code, still no luck, the following error
message is created (See below).
I did a check to see if the family / user-config.py & password file is set
up correctly, with "python login.py" and that works fine, the bot is able to
log into the wiki.
Also, "$wgEnableWriteAPI" is added to the LocalSettings.php file.
Any idea what might go wrong?
Thanks Albert.
Error message after command:
python ~/web/pywikipedia/pagefromfile.py -v -file:<some wikicoded.txt>
-start:startpage -end:endpage -force
********ERROR***********
Requesting API query from csdms:en
error occured, code:writeapidenied
info:You're not allowed to edit this wiki through the API
status:200
response:OK
File "/home/faculty/kettner/web/pywikipedia/pagefromfile.py", line 348, in
?
main()
File "/home/faculty/kettner/web/pywikipedia/pagefromfile.py", line 344, in
main
bot.run()
File "/home/faculty/kettner/web/pywikipedia/pagefromfile.py", line 154, in
run
self.put(title, contents)
File "/home/faculty/kettner/web/pywikipedia/pagefromfile.py", line 211, in
put
page.put(contents, comment = comment, minorEdit = self.minor)
File "/data/home/faculty/kettner/web/pywikipedia/wikipedia.py", line 1710,
in put
newPage, self.site().getToken(sysop = sysop), sysop = sysop,
botflag=botflag, maxTries=maxTries)
File "/data/home/faculty/kettner/web/pywikipedia/wikipedia.py", line 1861,
in _putPage
output("OriginalData:%s" % faked)
File "/data/home/faculty/kettner/web/pywikipedia/wikipedia.py", line 7576,
in output
print traceback.print_stack()
OriginalData:{'maxlag': '5', 'title': u'Model download Page',
'starttimestamp': '0', 'format': u'json', 'basetimestamp':
u'20101103200220', 'summary': 'Automated import of articles *** existing
text overwritten ***', 'token': u'864496fb7619522ce8cb49451cd856af+\\',
'bot': u'1', 'notminor': u'1', 'action': 'edit', 'nocreate': u'1'}
Unknown Error. API Error code:writeapidenied
Information:You're not allowed to edit this wiki through the API
End of file.
**********************
--
*******************************************************
Albert J. Kettner
Research Scientist
CSDMS, INSTAAR, Univ. of Colorado
P.O.Box 545
Boulder, CO, 80309, USA
http://csdms.colorado.edu/~kettnerhttp://csdms.colorado.edu
*****************************************************