I was this guy who made this trouble 4 weeks ago in r10769 together with implementing
reading the last edit comment (which I found doesn't work in some circumstances,
I do not prefer to in inform about changes via pywikipedia-l(a)lists.wikimedia.org as
pywikipedia-svn(a)lists.wikimedia.org does it and I cannot find any reason to do it twice.
Perhaps this change was so great that I had the better discussed previously; but there are
others that are much more changing the behaviour or structure. And we have a vcs to revert
Anyway the intention of that edit was to enable bots to respect reverts and prevent edit
wars with human users like . This was a very old request (from 2009) on ms en talk page
 and it could be easily implemented by the Page.comment() method. It was also proposed
by an other bot owner who had some problems with reverting bot edits until his bot was
able to respect reverts. Ok this does not prevent edit wars with different bots and also
can stop its work as false positive. In most cases it works wrong for log pages and the
edits must forced like in r10789 and r10790.
I cannot implement such behavior with the last user because the last user reverts the
previous bot edit which is noticed in the edit comment. But we can use a closer MediaWiki
message for "Undid revision $rev by $user" if that behavior is usefull and in
addition use a global option like -forceedit to override this restriction. (I prefer to
use the config variable and make it optionable like some variables in the rewrite branch
The exception of this edit block isn't quiet except you use try/exception with
Page.put(). Otherwise that error raising displays what the given hint. Anyway we could
have an other error exception class for different upper level exception handling.
Finally, Binariz, I am really sorry If I waste your time with that stuff. Please do not
hesitate to contact me if something is strange with the bot. Maybe in 36% it's caused
by me  ;)
And last but not least
Greetings an Happy New Year to all of you
----- Original Nachricht ----
Von: Bináris <wikiposta(a)gmail.com>
An: Pywikipedia discussion list <pywikipedia-l(a)lists.wikimedia.org>
Datum: 30.12.2012 23:31
Betreff: [Pywikipedia-l] Thank you for the bad joke :-(
I worked a lot on a script that created a page under my bot's user page,
finally after tests I renamed
project namespace. At the next run the bot worked 8 minutes (hard to
wait if you want to work with the result), and finally stopped at the last
moment instead of saving the page.
Sorry, I forgot to copy the screen, the essence is that it claimed my page
to be *locked* (what I thought to be protected). I didn't understand, and I
spent a lot of time with investigating and understanding what happened. The
page was not protected, of course.
The result of my investigation is that when the bot finds its own name in
the last edit comment (that was the fact because of renaming), it supposes
that the last edit was a revert of its previous edit (why?), and denies
saving with a fake and misleading "page locked" exception.
The code in wikipedia.py is:
elif self.comment() and username in self.comment():
u'Not allowed to edit %s because last edit maybe
Of course, these type of messages in the argument of *raise* won't appear
on user's screen, it is hidden into the source code. For some reason,
Python does not show the message in user exceptions.
This was my first experience with this kind of error so I was first
frightened and confused and finally found out that I should use a
force=True parameter, and so after waiting another 8 minutes I could save
the page. I solved the case and lost 15-20 minutes.
Is there really a serious reason to suppose that having found the name of
the bot in the last edit comment marks a revert and to prevent the bot of
saving the result of its work?
Pywikipedia-l mailing list