The idea is to create a user page and a talk page for a blocked user with a template, and immediately after creating to protect them.<br><br>The bot creates the pages and gives an error:<br><div style="margin-left: 40px;">
<span style="font-family: courier new,monospace;">Creating page [[Szerkesztö:SZDSZ]] via API</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Sleeping for 6.7 seconds, 2010-08-19 23:04:37</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Creating page [[Szerkesztövita:SZDSZ]] via API</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Note: Your sysop account on wikipedia:hu does not have a bot flag. Its edits wil</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">l be visible in the recent changes.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Sleeping for 4.8 seconds, 2010-08-19 23:04:49</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Do you want to change the protection level of [[hu:Szerkesztö:SZDSZ]]? ([Y]es, [</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">N]o, [A]ll) a</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{u'error': {u'info': u"<b style="background-color: rgb(255, 255, 51);">Existing titles can't be protected with 'create'</b>", u'code</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">': u'create-titleexists'}}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Sleeping for 6.9 seconds, 2010-08-19 23:04:57</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{u'error': {u'info': u"Existing titles can't be protected with 'create'", u'code</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">': u'create-titleexists'}}</span><br style="font-family: courier new,monospace;"></div>Now comes the funny thing: I run the script again. It saves the page with the same text (of course, this will not appear in page history), and now it protects the pages successfully!<br>
<div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">Updating page [[Szerkesztö:SZDSZ]] via API</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Sleeping for 7.9 seconds, 2010-08-19 23:14:28</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Updating page [[Szerkesztövita:SZDSZ]] via API</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Note: Your sysop account on wikipedia:hu does not have a bot flag. Its edits wil</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">l be visible in the recent changes.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Sleeping for 8.9 seconds, 2010-08-19 23:14:37</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Do you want to change the protection level of [[hu:Szerkesztö:SZDSZ]]? ([Y]es, [</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">N]o, [A]ll) a</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Changed protection level of page [[Szerkesztö:SZDSZ]].</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Sleeping for 7.1 seconds, 2010-08-19 23:14:49</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Changed protection level of page [[Szerkesztövita:SZDSZ]].</span><br></div>How is it possible that the second time the pages could be protected, although they were existing titles, too?<br>
I tried to change the order of script lines: first protection, and saving afterwards. This works! But this way the bot creates the pages under my sysop name, because they are already protected.<br><br>I just have used the lines:<br>
<span style="font-family: courier new,monospace;"> userlap.protect(reason=self.summary)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> vitalap.protect(reason=self.summary)</span><br style="font-family: courier new,monospace;">
In wikipedia.py protection stands as follows:<br><span style="font-family: courier new,monospace;">def protect(self, editcreate = 'sysop', move = 'sysop',</span> etc.<br clear="all">So it has only a common "editcreate" parameter.<br>
Please help, what is wrong in my solution, and how is it possible, that first time a page cannot be protected, and the second time it can?<br><br><br>-- <br>Bináris<br>