Patches 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=603140&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: Pending
Resolution: None 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: 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=603140&aid=2776167...
pywikipedia-bugs@lists.wikimedia.org