Last modified: 2014-11-16 21:43:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T75494, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 73494 - replace.py: AttributeError: 'ReplaceRobot' object has no attribute '_sites'
replace.py: AttributeError: 'ReplaceRobot' object has no attribute '_sites'
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
Other scripts (Other open bugs)
core-(2.0)
All All
: Normal critical
: ---
Assigned To: John Mark Vandenberg
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-16 20:12 UTC by Jesús Martínez Novo (Ciencia Al Poder)
Modified: 2014-11-16 21:43 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jesús Martínez Novo (Ciencia Al Poder) 2014-11-16 20:12:49 UTC
This morning I've updated my local copy of the repository. Was about to do some maintenance replacements and got greeted with this error:

$> python pwb.py replace.py -family:AAAAAAA -filelinks:"AAAAAAA.png" "BBBBB" "CCCCC"
Traceback (most recent call last):
  File "pwb.py", line 181, in <module>
    run_python_file(fn, argv, argvu)
  File "pwb.py", line 75, in run_python_file
    exec(compile(source, filename, "exec"), main_mod.__dict__)
  File "scripts/replace.py", line 730, in <module>
    main()
  File "scripts/replace.py", line 719, in main
    allowoverlap, recursive, add_cat, sleep, edit_summary)
  File "scripts/replace.py", line 289, in __init__
    self.site = site
  File ".../pywikibot/core/pywikibot/bot.py", line 1073, in site
    if site not in self._sites:
AttributeError: 'ReplaceRobot' object has no attribute '_sites'
<type 'exceptions.AttributeError'>

Since I had other tasks to do, this one wasn't urgent, I left the problem. Now I've updated the repo again to see if it has been somehow fixed, but it isn't :(

There seems to be no way to run replace.py now without this error :(

Current version is f8ad9fcd1ca2a5bba830be55cf05f475f9dbdfeb
Comment 1 Fabian 2014-11-16 20:17:26 UTC
This bug was probably introduced in https://gerrit.wikimedia.org/r/166583/ and is due to the fact that ReplaceRobot.__init__ is not calling Bot.__init__.
Comment 2 Gerrit Notification Bot 2014-11-16 20:40:59 UTC
Change 173674 had a related patch set uploaded by John Vandenberg:
Add superclass initialisation for three Bot scripts

https://gerrit.wikimedia.org/r/173674
Comment 3 Gerrit Notification Bot 2014-11-16 20:47:02 UTC
Change 173674 merged by jenkins-bot:
Add superclass initialisation for three Bot scripts

https://gerrit.wikimedia.org/r/173674
Comment 4 Jesús Martínez Novo (Ciencia Al Poder) 2014-11-16 20:53:37 UTC
Now the error is a bit further:

Traceback (most recent call last):
  File "pwb.py", line 181, in <module>
    run_python_file(fn, argv, argvu)
  File "pwb.py", line 75, in run_python_file
    exec(compile(source, filename, "exec"), main_mod.__dict__)
  File "scripts/replace.py", line 731, in <module>
    main()
  File "scripts/replace.py", line 720, in main
    allowoverlap, recursive, add_cat, sleep, edit_summary)
  File "scripts/replace.py", line 290, in __init__
    self.site = site
  File ".../pywikibot/core/pywikibot/bot.py", line 1075, in site
    % (site, unicode(site.version())))
AttributeError: 'NoneType' object has no attribute 'version'
<type 'exceptions.AttributeError'>
Comment 5 Gerrit Notification Bot 2014-11-16 21:10:11 UTC
Change 173675 had a related patch set uploaded by John Vandenberg:
Bot.site property fails when set to None

https://gerrit.wikimedia.org/r/173675
Comment 6 Gerrit Notification Bot 2014-11-16 21:21:54 UTC
Change 173675 merged by jenkins-bot:
Bot.site property fails when set to None

https://gerrit.wikimedia.org/r/173675
Comment 7 Jesús Martínez Novo (Ciencia Al Poder) 2014-11-16 21:43:59 UTC
Fixed

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links