Bugs item #1986165, was opened at 2008-06-06 10:46
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1986165&group_…
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: 5
Private: No
Submitted By: Melancholie (melancholie)
Assigned to: Nobody/Anonymous (nobody)
Summary: put_throttle inserted once more after server lag
Initial Comment:
A put_throttle pause is inserted once more after a not done edit, if bot got server lag error instead. This is not necessary, I think.
Example:
1. put_throttle pause
2. Trying to fetch edit page >> maxlag server output
3. Bot pauses for 5 sec. (or more)
4. put_throttle pause [!]
5. Page gets edited
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1986165&group_…
Bugs item #1985308, was opened at 2008-06-05 12:39
Message generated for change (Comment added) made by carsrac
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…
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: 6
Private: No
Submitted By: Melancholie (melancholie)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bot does not properly stay logged in (cookies)
Initial Comment:
My bot (r5514) does not stay properly logged in!
My first thought was this is because of the API_login, but it happens also for the normal login method. Is this maybe caused by SUL?
Or maybe by the following change?
http://svn.wikimedia.org/viewvc/pywikipedia?view=rev&revision=5514
See fa.wikipedia.org/wiki/بحث_کاربر:MelancholieBot#IP_contribution
----------------------------------------------------------------------
Comment By: Carsrac (carsrac)
Date: 2008-06-06 10:38
Message:
Logged In: YES
user_id=2066902
Originator: NO
I have also problems. I need constantly enter in my password for several
wiki's and if I do it the bot makes tha edit under my ip adres instead of
username of the bot. The wiki that are effected are fr, ro, be, nds-nl, af,
hif, sah, srn. My ip adress is 213.132.164.186 and my bot user name is
CarsracBot. As you all know may IW bots do not any edits under its ip
adress. So I think this bug will effect very likely a lot of bots running
with pywikipedia script.
----------------------------------------------------------------------
Comment By: Szymon Świerkosz (sswierkosz)
Date: 2008-06-05 13:25
Message:
Logged In: YES
user_id=2022153
Originator: NO
I don't know if this is correct behavior, but it is certainly annoying.
----------------------------------------------------------------------
Comment By: Melancholie (melancholie)
Date: 2008-06-05 13:20
Message:
Logged In: YES
user_id=2089773
Originator: YES
@sswierkosz: Yes, maybe that could be the reason. MediaWiki bug?
----------------------------------------------------------------------
Comment By: Szymon Świerkosz (sswierkosz)
Date: 2008-06-05 13:07
Message:
Logged In: YES
user_id=2022153
Originator: NO
I noticed that if you log out all sessions are destroyed, not only
current. Maybe you logged in and then logged out using your bot account, so
its cookies are not valid anymore.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…
Bugs item #1827590, was opened at 2007-11-07 16:09
Message generated for change (Comment added) made by melancholie
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1827590&group_…
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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Warddr (warddr)
Assigned to: Leonardo Gregianin (leogregianin)
Summary: featured.py add empty lines
Initial Comment:
The bot always add empty lines in between two linkFA templates.
example:
http://nl.wikipedia.org/w/index.php?title=Schaken&diff=10073293&oldid=10070…
Thanks
----------------------------------------------------------------------
Comment By: Melancholie (melancholie)
Date: 2008-06-06 10:34
Message:
Logged In: YES
user_id=2089773
Originator: NO
Does this still happen?
("-top")
----------------------------------------------------------------------
Comment By: Leonardo Gregianin (leogregianin)
Date: 2007-11-27 00:33
Message:
Logged In: YES
user_id=1136737
Originator: NO
This is a problem of wikipedia.replaceCategoryLinks
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1827590&group_…
Bugs item #1985308, was opened at 2008-06-05 12:39
Message generated for change (Settings changed) made by melancholie
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…
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: 6
Private: No
Submitted By: Melancholie (melancholie)
Assigned to: Nobody/Anonymous (nobody)
>Summary: Bot does not properly stay logged in (cookies)
Initial Comment:
My bot (r5514) does not stay properly logged in!
My first thought was this is because of the API_login, but it happens also for the normal login method. Is this maybe caused by SUL?
Or maybe by the following change?
http://svn.wikimedia.org/viewvc/pywikipedia?view=rev&revision=5514
See fa.wikipedia.org/wiki/بحث_کاربر:MelancholieBot#IP_contribution
----------------------------------------------------------------------
Comment By: Szymon Świerkosz (sswierkosz)
Date: 2008-06-05 13:25
Message:
Logged In: YES
user_id=2022153
Originator: NO
I don't know if this is correct behavior, but it is certainly annoying.
----------------------------------------------------------------------
Comment By: Melancholie (melancholie)
Date: 2008-06-05 13:20
Message:
Logged In: YES
user_id=2089773
Originator: YES
@sswierkosz: Yes, maybe that could be the reason. MediaWiki bug?
----------------------------------------------------------------------
Comment By: Szymon Świerkosz (sswierkosz)
Date: 2008-06-05 13:07
Message:
Logged In: YES
user_id=2022153
Originator: NO
I noticed that if you log out all sessions are destroyed, not only
current. Maybe you logged in and then logged out using your bot account, so
its cookies are not valid anymore.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…
Revision: 5516
Author: russblau
Date: 2008-06-05 18:12:56 +0000 (Thu, 05 Jun 2008)
Log Message:
-----------
partial implementation of action=edit (only available for testing on test.wikipedia.org so far)
Modified Paths:
--------------
branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py
===================================================================
--- branches/rewrite/pywikibot/site.py 2008-06-05 16:47:43 UTC (rev 5515)
+++ branches/rewrite/pywikibot/site.py 2008-06-05 18:12:56 UTC (rev 5516)
@@ -16,11 +16,16 @@
from pywikibot.exceptions import *
import config
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import md5
import logging
import os
+import re
import sys
import threading
-import re
+import urllib
class PageInUse(pywikibot.Error):
@@ -369,11 +374,9 @@
@param sysop: if True, require sysop privileges.
"""
- if not hasattr(self, '_userinfo'):
+ if self.getuserinfo()['name'] != self._username:
return False
- if self._userinfo['name'] != self._username:
- return False
- return (not sysop) or 'sysop' in self._userinfo['groups']
+ return (not sysop) or 'sysop' in self.getuserinfo()['groups']
def loggedInAs(self, sysop = False):
"""Return the current username if logged in, otherwise return None.
@@ -487,7 +490,7 @@
@property
def siteinfo(self):
"""Site information dict."""
- if not hasattr("_siteinfo"):
+ if not hasattr(self, "_siteinfo"):
self._getsiteinfo()
return self._siteinfo
@@ -656,6 +659,26 @@
page._revid = revision.revid
yield page
+ def token(self, page, tokentype):
+ """Return token retrieved from wiki to allow changing page content.
+
+ @param page: the Page for which a token should be retrieved
+ @param tokentype: the type of token (e.g., "edit", "move", "delete");
+ see API documentation for full list of types
+
+ """
+ query = api.PropertyGenerator("info|revisions", site=self,
+ titles=page.title(withSection=False),
+ intoken=tokentype)
+ for item in query:
+ if item['title'] != page.title(withSection=False):
+ raise Error(
+ u"token: Query on page %s returned data on page [[%s]]"
+ % (page.title(withSection=False, asLink=True),
+ item['title']))
+ api.update_page(page, item)
+ return item[tokentype + "token"]
+
# following group of methods map more-or-less directly to API queries
def pagebacklinks(self, page, followRedirects=False, filterRedirects=None,
@@ -1617,7 +1640,175 @@
for ns in namespaces)
return rngen
+ # catalog of editpage error codes, for use in generating messages
+ _ep_errors = {
+"noapiwrite": "API editing not enabled on %(site)s wiki",
+"writeapidenied":
+ "User %(user)s is not authorized to edit on %(site)s wiki",
+"protectedtitle":
+ "Title %(title)s is protected against creation on %(site)s",
+"cantcreate":
+ "User %(user)s not authorized to create new pages on %(site)s wiki",
+"cantcreate-anon":
+ """\
+Bot is not logged in, and anon users are not authorized to create new pages
+on %(site)s wiki""",
+"articleexists":
+ "Page %(title)s already exists on %(site)s wiki",
+"noimageredirect-anon":
+ """\
+Bot is not logged in, and anon users are not authorized to create image
+redirects on %(site)s wiki""",
+"noimageredirect":
+ "User %(user)s not authorized to create image redirects on %(site)s wiki",
+"spamdetected":
+ "Edit to page %(title)s rejected by spam filter due to content:\n",
+"filtered":
+ "%(info)s",
+"contenttoobig":
+ "%(info)s",
+"noedit-anon":
+ """\
+Bot is not logged in, and anon users are not authorized to edit on
+%(site)s wiki""",
+"noedit":
+ "User %(user)s not authorized to edit pages on %(site)s wiki",
+"pagedeleted":
+ "Page %(title)s has been deleted since last retrieved from %(site)s wiki",
+"editconflict":
+ "Page %(title)s not saved due to edit conflict.",
+ }
+
+ def editpage(self, page, summary, minor=True, notminor=False,
+ recreate=True, createonly=False, watch=False, unwatch=False):
+ """Submit an edited Page object to be saved to the wiki.
+ @param page: The Page to be saved; its .text property will be used
+ as the new text to be saved to the wiki
+ @param token: the edit token retrieved using Site.token()
+ @param summary: the edit summary (required!)
+ @param minor: if True (default), mark edit as minor
+ @param notminor: if True, override account preferences to mark edit
+ as non-minor
+ @param recreate: if True (default), create new page even if this
+ title has previously been deleted
+ @param createonly: if True, raise an error if this title already
+ exists on the wiki
+ @param watch: if True, add this Page to bot's watchlist
+ @param unwatch: if True, remove this Page from bot's watchlist if
+ possible
+
+ """
+ text = page.text
+ if not text:
+ raise Error("editpage: no text to be saved")
+ try:
+ lastrev = page.latestRevision()
+ except NoPage:
+ lastrev = None
+ if not recreate:
+ raise Error("Page %s does not exist on %s wiki."
+ % (page.title(withSection=False), self))
+ self.lock_page(page)
+ token = self.token(page, "edit")
+ if lastrev is not None and page.latestRevision() != lastrev:
+ raise Error("editpage: Edit conflict detected; saving aborted.")
+ req = api.Request(site=self, action="edit",
+ title=page.title(withSection=False),
+ text=text, token=token, summary=summary)
+## if lastrev is not None:
+## req["basetimestamp"] = page._revisions[lastrev].timestamp
+ if minor:
+ req['minor'] = ""
+ elif notminor:
+ req['notminor'] = ""
+ if 'bot' in self.getuserinfo()['groups']:
+ req['bot'] = ""
+ if recreate:
+ req['recreate'] = ""
+ if createonly:
+ req['createonly'] = ""
+ if watch:
+ req['watch'] = ""
+ elif unwatch:
+ req['unwatch'] = ""
+## FIXME: API gives 'badmd5' error
+## md5hash = md5()
+## md5hash.update(urllib.quote_plus(text.encode(self.encoding())))
+## req['md5'] = md5hash.digest()
+ while True:
+ try:
+ result = req.submit()
+ logging.debug("editpage response: %s" % result)
+ except api.APIError, err:
+ self.unlock_page(page)
+ if err.code.endswith("anon") and self.logged_in():
+ logging.debug(
+"editpage: received '%s' even though bot is logged in" % err.code)
+ errdata = {
+ 'site': self,
+ 'title': page.title(withSection=False),
+ 'user': self.user(),
+ 'info': err.info
+ }
+ if err.code == "spamdetected":
+ raise SpamfilterError(self._ep_errors[err.code] % errdata
+ + err.info[ err.info.index("fragment: ") + 9: ])
+
+ if err.code == "editconflict":
+ raise EditConflict(self._ep_errors[err.code] % errdata)
+ if err.code in self._ep_errors:
+ raise Error(self._ep_errors[err.code] % errdata)
+ logging.debug("editpage: Unexpected error code '%s' received."
+ % err.code)
+ raise
+ assert ("edit" in result and "result" in result["edit"]), result
+ if result["edit"]["result"] == "Success":
+ self.unlock_page(page)
+ if "nochange" in result["edit"]:
+ # null edit, page not changed
+ # TODO: do we want to notify the user of this?
+ return True
+ page._revid = result["edit"]["newrevid"]
+ page._revisions[int(page._revid)] = pywikibot.page.Revision(
+ revid=int(page._revid), timestamp='',
+ user=self.user(), anon=not self.logged_in(),
+ comment=summary, minor=minor or not notminor,
+ text=text
+ )
+ return True
+ elif result["edit"]["result"] == "Failure":
+ if "captcha" in result["edit"]:
+ captcha = result["edit"]["captcha"]
+ req['captchaid'] = captcha['id']
+ if captcha["type"] == "math":
+ req['captchaword'] = input(captcha["question"])
+ continue
+ elif "url" in captcha:
+ webbrowser.open(url)
+ req['captchaword'] = cap_answerwikipedia.input(
+"Please view CAPTCHA in your browser, then type answer here:")
+ continue
+ else:
+ self.unlock_page(page)
+ logging.error(
+"editpage: unknown CAPTCHA response %s, page not saved"
+ % captcha)
+ return False
+ else:
+ self.unlock_page(page)
+ logging.error("editpage: unknown failure reason %s"
+ % str(result))
+ return False
+ else:
+ self.unlock_page(page)
+ logging.error(
+"editpage: Unknown result code '%s' received; page not saved"
+ % result["edit"]["result"])
+ logging.error(str(result))
+ return False
+
+
#### METHODS NOT IMPLEMENTED YET (but may be delegated to Family object) ####
class NotImplementedYet:
Revision: 5515
Author: nicdumz
Date: 2008-06-05 16:47:43 +0000 (Thu, 05 Jun 2008)
Log Message:
-----------
Those hardcoded \u200E should never appear in our code.
\u200E is an unicode control character used in left to right languages. This means that the regexes using them weren't working on right to left languages, such as ar:
Modified Paths:
--------------
trunk/pywikipedia/welcome.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/welcome.py
===================================================================
--- trunk/pywikipedia/welcome.py 2008-06-04 20:56:45 UTC (rev 5514)
+++ trunk/pywikipedia/welcome.py 2008-06-05 16:47:43 UTC (rev 5515)
@@ -400,7 +400,7 @@
reg = u'\(<a href=\"' + re.escape(wsite.path())
reg += u'\?title=%s(?P<user>.*?)&(?:amp;|)action=(?:edit|editredlink|edit&redlink=1)\"' % talk
- reg += u'.*?\) (?P<reason>.*?) \u200E </li>'
+ reg += u'.*?\) (?P<reason>.*?) . </li>'
p = re.compile(reg, re.UNICODE)
for x in p.finditer(raw):
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-06-04 20:56:45 UTC (rev 5514)
+++ trunk/pywikipedia/wikipedia.py 2008-06-05 16:47:43 UTC (rev 5515)
@@ -4659,7 +4659,7 @@
path = self.longpages_address(n=number)
get_throttle()
html = self.getUrl(path)
- entryR = re.compile(ur'<li>\(<a href=".+?" title=".+?">hist</a>\) <a href=".+?" title="(?P<title>.+?)">.+?</a> \[(?P<length>\d+)(.+?)\]</li>')
+ entryR = re.compile(ur'<li>\(<a href=".+?" title=".+?">hist</a>\) .<a href=".+?" title="(?P<title>.+?)">.+?</a> .\[(?P<length>\d+)(.+?)\]</li>', re.UNICODE)
for m in entryR.finditer(html):
title = m.group('title')
length = int(m.group('length'))
@@ -4678,7 +4678,7 @@
path = self.shortpages_address(n = number)
get_throttle()
html = self.getUrl(path)
- entryR = re.compile(ur'<li>\(<a href=".+?" title=".+?">hist</a>\) <a href=".+?" title="(?P<title>.+?)">.+?</a> \[(?P<length>\d+)(.+?)\]</li>')
+ entryR = re.compile(ur'<li>\(<a href=".+?" title=".+?">hist</a>\) .<a href=".+?" title="(?P<title>.+?)">.+?</a> .\[(?P<length>\d+)(.+?)\]</li>', re.UNICODE)
for m in entryR.finditer(html):
title = m.group('title')
length = int(m.group('length'))
Bugs item #1984572, was opened at 2008-06-04 16:51
Message generated for change (Comment added) made by melancholie
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1984572&group_…
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: 7
Private: No
Submitted By: Woo-Jin Kim (kwj2772)
Assigned to: Nobody/Anonymous (nobody)
Summary: Unexpected response from wiki server
Initial Comment:
When I'm running interwikibot with SUL account, my bot has been disabled and show this message
ERROR: Unexpected response from wiki server
200 (OK)
and local MediaWiki message shown.
----------------------------------------------------------------------
Comment By: Melancholie (melancholie)
Date: 2008-06-05 16:13
Message:
Logged In: YES
user_id=2089773
Originator: NO
OK, also happens to me (occasional).
----------------------------------------------------------------------
Comment By: Melancholie (melancholie)
Date: 2008-06-05 11:29
Message:
Logged In: YES
user_id=2089773
Originator: NO
Is your code up-to-date (SVN)?
This should have been fixed, already.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1984572&group_…
Bugs item #1985308, was opened at 2008-06-05 12:39
Message generated for change (Comment added) made by sswierkosz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…
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: 6
Private: No
Submitted By: Melancholie (melancholie)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bot does not stay logged in properly
Initial Comment:
My bot (r5514) does not stay properly logged in!
My first thought was this is because of the API_login, but it happens also for the normal login method. Is this maybe caused by SUL?
Or maybe by the following change?
http://svn.wikimedia.org/viewvc/pywikipedia?view=rev&revision=5514
See fa.wikipedia.org/wiki/بحث_کاربر:MelancholieBot#IP_contribution
----------------------------------------------------------------------
Comment By: Szymon Świerkosz (sswierkosz)
Date: 2008-06-05 13:25
Message:
Logged In: YES
user_id=2022153
Originator: NO
I don't know if this is correct behavior, but it is certainly annoying.
----------------------------------------------------------------------
Comment By: Melancholie (melancholie)
Date: 2008-06-05 13:20
Message:
Logged In: YES
user_id=2089773
Originator: YES
@sswierkosz: Yes, maybe that could be the reason. MediaWiki bug?
----------------------------------------------------------------------
Comment By: Szymon Świerkosz (sswierkosz)
Date: 2008-06-05 13:07
Message:
Logged In: YES
user_id=2022153
Originator: NO
I noticed that if you log out all sessions are destroyed, not only
current. Maybe you logged in and then logged out using your bot account, so
its cookies are not valid anymore.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…
Bugs item #1985308, was opened at 2008-06-05 12:39
Message generated for change (Comment added) made by melancholie
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…
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: 6
Private: No
Submitted By: Melancholie (melancholie)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bot does not stay logged in properly
Initial Comment:
My bot (r5514) does not stay properly logged in!
My first thought was this is because of the API_login, but it happens also for the normal login method. Is this maybe caused by SUL?
Or maybe by the following change?
http://svn.wikimedia.org/viewvc/pywikipedia?view=rev&revision=5514
See fa.wikipedia.org/wiki/بحث_کاربر:MelancholieBot#IP_contribution
----------------------------------------------------------------------
>Comment By: Melancholie (melancholie)
Date: 2008-06-05 13:20
Message:
Logged In: YES
user_id=2089773
Originator: YES
@sswierkosz: Yes, maybe that could be the reason. MediaWiki bug?
----------------------------------------------------------------------
Comment By: Szymon Świerkosz (sswierkosz)
Date: 2008-06-05 13:07
Message:
Logged In: YES
user_id=2022153
Originator: NO
I noticed that if you log out all sessions are destroyed, not only
current. Maybe you logged in and then logged out using your bot account, so
its cookies are not valid anymore.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…
Bugs item #1985308, was opened at 2008-06-05 12:39
Message generated for change (Comment added) made by sswierkosz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…
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: 6
Private: No
Submitted By: Melancholie (melancholie)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bot does not stay logged in properly
Initial Comment:
My bot (r5514) does not stay properly logged in!
My first thought was this is because of the API_login, but it happens also for the normal login method. Is this maybe caused by SUL?
Or maybe by the following change?
http://svn.wikimedia.org/viewvc/pywikipedia?view=rev&revision=5514
See fa.wikipedia.org/wiki/بحث_کاربر:MelancholieBot#IP_contribution
----------------------------------------------------------------------
Comment By: Szymon Świerkosz (sswierkosz)
Date: 2008-06-05 13:07
Message:
Logged In: YES
user_id=2022153
Originator: NO
I noticed that if you log out all sessions are destroyed, not only
current. Maybe you logged in and then logged out using your bot account, so
its cookies are not valid anymore.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1985308&group_…