Bugs item #2795879, was opened at 2009-05-24 01:38 Message generated for change (Settings changed) made by ronga You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2795879...
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: Closed
Resolution: Invalid Priority: 5 Private: No Submitted By: Ronga (ronga) Assigned to: Nobody/Anonymous (nobody) Summary: AttributeError at replace.py
Initial Comment: Command: replace.py -start:"Template:!" "File:Cross.svg" "File:Cross red.svg"
Error message: AttributeError: 'NoneType' object has no attribute 'query' 'NoneType' object has no attribute 'query'
Details: C:\pywikipedia>replace.py -start:"Template:!" "File:Cross.svg" "File:Cross red.svg" Traceback (most recent call last): File "C:\pywikipedia\pagegenerators.py", line 787, in __iter__ for page in self.wrapped_gen: File "C:\pywikipedia\pagegenerators.py", line 719, in DuplicateFilterPageGener ator for page in generator: File "C:\pywikipedia\pagegenerators.py", line 250, in AllpagesPageGenerator for page in site.allpages(start = start, namespace = namespace, includeredir ects = includeredirects): File "C:\pywikipedia\wikipedia.py", line 5508, in allpages for p in soup.api.query.allpages: AttributeError: 'NoneType' object has no attribute 'query' 'NoneType' object has no attribute 'query'
File version: Pywikipedia nightly:pywikipedia (r6854, May 07 2009, 13:07:14) Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)]
----------------------------------------------------------------------
Comment By: Ronga (ronga) Date: 2009-05-26 20:53
Message: It seems the problem is solved now. Thanks for your help.
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz) Date: 2009-05-25 18:50
Message: okay thanks. closing then.
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto) Date: 2009-05-25 18:40
Message: There is the bug #2577598 - «AttributeError: 'NoneType' object has no attribute 'query'».
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz) Date: 2009-05-25 18:35
Message: Reopening.
It happens to me, on wikimedia projects, with the latest versions.
Ronga's problem was probably because of a wrong family file, but we still need to find out why it can happen on WM sites (at least use more useful error messages)
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto) Date: 2009-05-25 18:13
Message: Attached a fixed family file. Problem resolved, bug closed.
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz) Date: 2009-05-25 12:59
Message: Hello!
Your family file is wrong. Have you read http://meta.wikimedia.org/wiki/Pywikipedia_bot_on_non-Wikimedia_projects ? It might help +)
The addresses of index and api are http://bestbrute.wikia.com/index.php and http://bestbrute.wikia.com/api.php which means that the scriptpath should be '' : def scriptpath(self, code): return ''
With this script path set, you don't need to override path(), or apipath() and things will work for you.
----------------------------------------------------------------------
Comment By: Ronga (ronga) Date: 2009-05-25 11:59
Message: This is where I run your robot scripts: http://bestbrute.wikia.com/ BestBrute - MyBrute Wiki - custom family file
File has been attached. Please check.
It seems this problem always happen on me. It's not an occasional error. This bug also affect quite a few commands, not just replace.py -start: I remember I tried -titleregex in another py file. I saw the same error message.
So does anyone know how to workaround it? (Perhaps using other commands). I want to tell the robot to check all templates, but the -start command doesn't work for me. What else could I use?
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz) Date: 2009-05-24 12:20
Message: It also happens to me from time to time, on wikimedia project.
I'm not sure of what happens here, I'm not familiar enough with the api. Checking for soup.api is not None , and retry if it's None could do the trick, but once again, we're inserting magic tricks to use the api, when it would be better to focus on porting our code base to the rewrite branch... :/
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto) Date: 2009-05-24 07:35
Message: You should attach your custom family file (families/bestbrute_family.py) so I can reproduce this bug.
----------------------------------------------------------------------
Comment By: Ronga (ronga) Date: 2009-05-24 04:39
Message: =================================================== Update:
I got the latest version from http://toolserver.org/~valhallasw/pywiki/. Extracted to the same folder. Selected "replace all" Still the same error persists.
Reply @ Date: 2009-05-24 02:10 Sender: cosoleto
please include, as well as the traceback, family, language
What traceback? Isn't the message included it already?
family = 'bestbrute' mylang = 'en'
last 10 lines before that error is raised
The following has shown all message.
The whole message: C:\pywikipedia>replace.py -start:"Template:!" "File:Cross.svg" "File:Cross red.s vg" Traceback (most recent call last): File "C:\pywikipedia\pagegenerators.py", line 787, in __iter__ for page in self.wrapped_gen: File "C:\pywikipedia\pagegenerators.py", line 719, in DuplicateFilterPageGener ator for page in generator: File "C:\pywikipedia\pagegenerators.py", line 250, in AllpagesPageGenerator for page in site.allpages(start = start, namespace = namespace, includeredir ects = includeredirects): File "C:\pywikipedia\wikipedia.py", line 5512, in allpages for p in soup.api.query.allpages: AttributeError: 'NoneType' object has no attribute 'query' 'NoneType' object has no attribute 'query'
C:\pywikipedia>version.py Pywikipedia nightly:pywikipedia (r6915, May 22 2009, 23:45:12) Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)]
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto) Date: 2009-05-24 02:10
Message: Looks as a problem already reported but I don't remember whether it is fixed or not. You should update your PyWikipediaBot version as it isn't up to date (15 days old) and report again the problem here if persists. In case, please include, as well as the traceback, family, language and last 10 lines before that error is raised.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2795879...
pywikipedia-bugs@lists.wikimedia.org