Page MenuHomePhabricator

selflink.py - AttributeError: 'SelflinkBot' object has no attribute 'pageToUnlink'
Closed, DeclinedPublic

Description

selflink.py halts while calling unlink.py with the following error:

$ python pwb.py selflink.py -start:A
Retrieving 50 pages from wikipedia:pl.

A <<<

0 pages read
0 pages written
Execution time: 0 seconds
Script terminated by exception:

ERROR: AttributeError: 'SelflinkBot' object has no attribute 'pageToUnlink'
Traceback (most recent call last):

File "pwb.py", line 255, in <module>
  if not main():
File "pwb.py", line 249, in main
  run_python_file(filename, [filename] + args, argvu, file_package)
File "pwb.py", line 121, in run_python_file
  main_mod.__dict__)
File "./scripts/selflink.py", line 110, in <module>
  main()
File "./scripts/selflink.py", line 106, in main
  bot.run()
File "/usr/home/masti/pw/core/pywikibot/bot.py", line 1621, in run
  super(MultipleSitesBot, self).run()
File "/usr/home/masti/pw/core/pywikibot/bot.py", line 1435, in run
  self.treat(page)
File "/usr/home/masti/pw/core/pywikibot/bot.py", line 1722, in treat
  super(ExistingPageBot, self).treat(page)
File "/usr/home/masti/pw/core/pywikibot/bot.py", line 1786, in treat
  super(NoRedirectPageBot, self).treat(page)
File "/usr/home/masti/pw/core/pywikibot/bot.py", line 1649, in treat
  self.treat_page()
File "./scripts/selflink.py", line 74, in treat_page
  self.unlink(self.current_page)
File "/usr/home/masti/pw/core/scripts/unlink.py", line 97, in unlink
  unlink_callback = self._create_callback()
File "./scripts/selflink.py", line 60, in _create_callback
  callback = super(SelflinkBot, self)._create_callback()
File "/usr/home/masti/pw/core/scripts/unlink.py", line 91, in _create_callback
  return InteractiveUnlink(self)
File "/usr/home/masti/pw/core/scripts/unlink.py", line 59, in __init__
  old_link=bot.pageToUnlink, new_link=False, default='u')

AttributeError: 'SelflinkBot' object has no attribute 'pageToUnlink'
<type 'exceptions.AttributeError'>
CRITICAL: Closing network session.

run on a clean new core installation
$ python pwb.py version.py
Pywikibot: [https] r-pywikibot-core.git (1b3d330, g7586, 2016/11/14, 14:21:21, n/a)
Release version: 3.0-dev
requests version: 2.3.0

cacerts: /etc/ssl/certs/ca-certificates.crt
  certificate test: ok

Python: 2.7.7 (default, Dec 9 2014, 00:19:44)
[GCC 4.3.4]
PYWIKIBOT2_DIR: Not set
PYWIKIBOT2_DIR_PWB:
PYWIKIBOT2_NO_USER_CONFIG: Not set

Event Timeline

Change 321576 had a related patch set uploaded (by Magul):
pageToUnlink set to current_page in SelflinkBot

https://gerrit.wikimedia.org/r/321576

@Xqt could You please re-review this change? You have few questions there and I alread answered them. Thanks in advance.

Xqt triaged this task as Medium priority.Apr 7 2018, 2:43 PM
Xqt raised the priority of this task from Medium to High.Apr 9 2018, 12:42 PM
Aklapper added a subscriber: Magul.

@Magul: I am resetting the assignee of this task because there has not been progress lately (please correct me if I am wrong!). Resetting the assignee avoids the impression that somebody is already working on this task. It also allows others to potentially work towards fixing this task. Please claim this task again when you plan to work on it (via Add Action...Assign / Claim in the dropdown menu) - it would be welcome. Thanks for your understanding!

This script is no longer maintained. Please reopen if you still use it.

Change 321576 abandoned by Xqt:
[pywikibot/core@master] pageToUnlink set to current_page in SelflinkBot

Reason:
no longer maintained

https://gerrit.wikimedia.org/r/321576