[Pywikipedia-l] [ pywikipediabot-Bugs-1966402 ] wrong mediawiki_message when not using the default site lang

SourceForge.net noreply at sourceforge.net
Sun May 18 12:06:45 UTC 2008


Bugs item #1966402, was opened at 2008-05-18 12:18
Message generated for change (Comment added) made by nicdumz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1966402&group_id=93107

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: General
Group: None
>Status: Open
>Resolution: None
>Priority: 8
Private: No
Submitted By: Nightshadow28 (nightshadow28)
Assigned to: NicDumZ — Nicolas Dumazet (nicdumz)
>Summary: wrong mediawiki_message when not using the default site lang

Initial Comment:
Category.py aborts at full-protection page.

[[w:ja:中田譲治]] is under full-protection, but if category.py tries to edit the article, bot will abort with following massage:

Changing page [[ja:中田譲治]]
ERROR: Unexpected response from wiki server.
       200 (OK)
(HTML)

Dumping to category.dump.bz2, please wait...
Traceback (most recent call last):
  File "category.py", line 945, in ?
    bot.run()
  File "category.py", line 432, in run
    inPlace=self.inPlace)
  File "/home/tatsujin/pywikipedia/catlib.py", line 473, in change_category
    article.put(text, comment)
  File "/home/tatsujin/pywikipedia/wikipedia.py", line 1262, in put
    newPage, self.site().getToken(sysop = sysop), sysop = sysop)
  File "/home/tatsujin/pywikipedia/wikipedia.py", line 1417, in _putPage
    return self._putPage(text, comment, watchArticle, minorEdit, newPage, token=self.site().getToken(sysop = sysop, getagain = True), newToken = True, sysop = sysop)
  File "/home/tatsujin/pywikipedia/wikipedia.py", line 1487, in _putPage
    raise PageNotSaved
wikipedia.PageNotSaved
-----

r5393 and bot account does not have adminship.

----------------------------------------------------------------------

>Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2008-05-18 14:06

Message:
Logged In: YES 
user_id=1963242
Originator: NO

I just took a deeper look at result.txt, and now I understand things
better :

var wgUserLanguage = "en";

You have set up your interface to use English messages, instead of the
default Japanese messages, have you ?

Site.mediawiki_message('viewsource') is used to get the localized message
of "view source" to match it against the page content, to know if the page
is fully protected. However, it is simply checking for
http://ja.wikipedia.org/wiki/MediaWiki:Viewsource , and this page is not
wgUserLanguage dependant. It will always print the locale default message.
In our case, it should return "view source", and it returns "wrongly"
"ソースを表示"

This bug is serious. It means that our messages detection is not working
whenever a bot is not using the default site language.

----------------------------------------------------------------------

Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2008-05-18 13:53

Message:
Logged In: YES 
user_id=1963242
Originator: NO

Thanks for your report :)

I believe the fact that the page was fully protected was a coincidence
here: I tried, in a python console, putting that same ja: Page, (with the
intern _putPage method) and I got a LockedPage Error, instead of a
PageNotSaved, which seems to indicate that the lock detection mechanism
*is* properly working here.

However, catlib.py::change_category was not catching all the PageNotSaved
exceptions and I fixed that in r5396, meaning that such errors are not
supposed to be reported to the end user anymore.

If you still diagnose that some "Saving page ... failed" messages are
always prompted for a particular type of full edit-protected pages, please,
let us know.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1966402&group_id=93107



More information about the Pywikipedia-l mailing list