[Pywikipedia-l] [ pywikipediabot-Bugs-2577598 ] AttributeError: 'NoneType' object has no attribute 'query'

SourceForge.net noreply at sourceforge.net
Sat Feb 7 16:37:26 UTC 2009


Bugs item #2577598, was opened at 2009-02-07 16:49
Message generated for change (Comment added) made by multichill
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2577598&group_id=93107

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: Mikko Silvonen (silvonen)
Assigned to: Nobody/Anonymous (nobody)
Summary: AttributeError: 'NoneType' object has no attribute 'query'

Initial Comment:
My autonomous interwiki run on all fiwiki categories crashed today with the following error.

...
======Post-processing [[fi:Luokka:Cradle of Filth]]======
Updating links on page [[es:Categoría:Cradle of Filth]].
No changes needed
Updating links on page [[ja:Category:kureidoru obu fuirusu]].
No changes needed
Updating links on page [[sk:Kategória:Cradle of Filth]].
No changes needed
Updating links on page [[en:Category:Cradle of Filth]].
No changes needed
Updating links on page [[fi:Luokka:Cradle of Filth]].
No changes needed
NOTE: The first unfinished subject is [[fi:Luokka:Cradle of Filthin albumit]]
NOTE: Number of pages queued is 99, trying to add 60 more.
Dump fi (wikipedia) saved
Traceback (most recent call last):
  File "interwiki.py", line 1818, in <module>
    bot.run()
  File "interwiki.py", line 1538, in run
    self.queryStep()
  File "interwiki.py", line 1512, in queryStep
    self.oneQuery()
  File "interwiki.py", line 1480, in oneQuery
    site = self.selectQuerySite()
  File "interwiki.py", line 1454, in selectQuerySite
    self.generateMore(globalvar.maxquerysize - mycount)
  File "interwiki.py", line 1388, in generateMore
    page = self.pageGenerator.next()
  File "c:\svn\pywikipedia\pagegenerators.py", line 670, in NamespaceFilterPageGenerator
    for page in generator:
  File "c:\svn\pywikipedia\pagegenerators.py", line 688, in DuplicateFilterPageGenerator
    for page in generator:
  File "c:\svn\pywikipedia\pagegenerators.py", line 239, in AllpagesPageGenerator
    for page in site.allpages(start = start, namespace = namespace, includeredirects = includeredirects):
  File "c:\svn\pywikipedia\wikipedia.py", line 5424, in allpages
    for p in soup.api.query.allpages:
AttributeError: 'NoneType' object has no attribute 'query'

>python version.py
Pywikipedia [http] trunk/pywikipedia (r6334, Feb 06 2009, 16:42:40)
Python 2.5.1 (r251:54863, May  1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)]


----------------------------------------------------------------------

>Comment By: Multichill (multichill)
Date: 2009-02-07 17:37

Message:
I had the same error yesterday. There seems to be something wrong with the
allpages generator.
The api was changed recently, maybe that has something to do with it.

soup = BeautifulSoup(text, convertEntities=BeautifulSoup.HTML_ENTITIES)
(line 5421 in wikipedia.py) should return an object.
Looks like soup exists, but api doesn't exist. That's strange. When i look
at http://commons.wikimedia.org/w/api.php api is the root element.

We should probably build in some checks to see if we got everything
instead of assuming we get it right straight away.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2577598&group_id=93107



More information about the Pywikipedia-l mailing list