Patches item #2776167, was opened at 2009-04-20 12:49
Message generated for change (Comment added) made by liangent
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=277616…
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: Open
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: liangent (liangent)
Date: 2009-04-20
13:32
Message:
i forgot to log in too...
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2009-04-20 13: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 13: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 13:04
Message:
Sorry, forgot to log in before last comment!
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2009-04-20 13: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=277616…