Bugs item #2776167, was opened at 2009-04-20 08:49 Message generated for change (Comment added) made by russblau You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2776167...
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: rewrite Group: None
Status: Closed Resolution: Works For Me
Priority: 5 Private: No Submitted By: liangent (liangent) Assigned to: Nobody/Anonymous (nobody) Summary: bug in site.py of rewrite branch
Initial Comment: Traceback (most recent call last): File "./archiver.py", line 7, in <module> now = Site().getcurrenttime() # or from link's site? File "/usr/lib/python2.5/site-packages/pywikibot/site.py", line 794, in getcurrenttime ts = self.getcurrenttimestamp() File "/usr/lib/python2.5/site-packages/pywikibot/site.py", line 789, in getcurrenttimestamp result = r.submit() File "/usr/lib/python2.5/site-packages/pywikibot/data/api.py", line 184, in submit self.site.throttle(write=write) File "/usr/lib/python2.5/site-packages/pywikibot/site.py", line 176, in __getattr__ return self.__class__.attr AttributeError: type object 'APISite' has no attribute 'attr'
----------------------------------------------------------------------
Comment By: Russell Blau (russblau)
Date: 2010-01-06 14:06
Message: Appears to have been fixed at some point.
----------------------------------------------------------------------
Comment By: liangent (liangent) Date: 2009-05-06 07:22
Message: does the problem occur only when getting server time?
----------------------------------------------------------------------
Comment By: Russell Blau (russblau) Date: 2009-05-05 13:26
Message: I have also seen this problem on rare occasions but I haven't been able to track down the cause.
----------------------------------------------------------------------
Comment By: liangent (liangent) Date: 2009-05-05 02:08
Message: i didn't find any problem on self.site.throttle(write=write) and this problem never occurred again. (actually i didn't use Site().getcurrenttime() anymore) but what was wrong?
----------------------------------------------------------------------
Comment By: liangent (liangent) Date: 2009-04-20 09:32
Message: i forgot to log in too...
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody) Date: 2009-04-20 09:30
Message: no no no ... i met another problem, and i don't know whether it has connection with my patch ... they seem to occur randomly ...
liangent@oiweb:~$ wiki/bot/archiver/archiver.py Found 1 wikipedia:zh processes running, including this one. Traceback (most recent call last): File "wiki/bot/archiver/archiver.py", line 7, in <module> now = Site().getcurrenttime() # or from link's site? File "/usr/lib/python2.5/site-packages/pywikibot/site.py", line 794, in getcurrenttime ts = self.getcurrenttimestamp() File "/usr/lib/python2.5/site-packages/pywikibot/site.py", line 789, in getcurrenttimestamp result = r.submit() File "/usr/lib/python2.5/site-packages/pywikibot/data/api.py", line 184, in submit self.site.throttle(write=write) TypeError: 'property' object is not callable liangent@oiweb:~$
----------------------------------------------------------------------
Comment By: liangent (liangent) Date: 2009-04-20 09:25
Message: it seems problem occurs only when throttling try to run a lot of instances to test
my code starts with
#!/usr/bin/env python # -*- coding: utf_8 -*- import re import pywikibot from pywikibot import Link, Site, Page import datetime now = Site().getcurrenttime()
----------------------------------------------------------------------
Comment By: Russell Blau (russblau) Date: 2009-04-20 09:04
Message: Sorry, forgot to log in before last comment!
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody) Date: 2009-04-20 09:03
Message: I'll apply this patch, but the original code works for me in Python 2.5.2:
import pywikibot s = pywikibot.Site() now = s.getcurrenttime()
Found 1 wikipedia:en processes running, including this one.
print now
2009-04-20T13:00:47Z
Question: in your 'archiver.py' script, did you import Site from pywikibot, or from some other module? If you import it directly from pywikibot.site, it won't work!
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2776167...
pywikipedia-bugs@lists.wikimedia.org