Page MenuHomePhabricator

category.py crashes after move if the bot does not have admin privileges
Closed, DeclinedPublic

Description

category.py now crashes after every move. I didn't check what it is actually trying to do, but this doesn't seem to affect the end result.

Test run on fiwiki:

>category.py move
Please enter the old name of the category: Parhaan elokuvan Oscar-palkinnon voittaneet elokuvat
Please enter the new name of the category: Parhaan elokuvan Oscar-palkinnon saaneet elokuvat
Page Luokka:Parhaan elokuvan Oscar-palkinnon voittaneet elokuvat moved to Luokka:Parhaan elokuvan Oscar-palkinnon saaneet elokuvat
Page Luokka:Parhaan elokuvan Oscar-palkinnon voittaneet elokuvat is moved and no longer exist.
Getting [[Luokka:Parhaan elokuvan Oscar-palkinnon voittaneet elokuvat]] list...
Getting 60 pages from wikipedia:fi...
...
Traceback (most recent call last):
  File "D:\git\pywikipedia\category.py", line 1079, in <module>
    main()
  File "D:\git\pywikipedia\category.py", line 1049, in main
    bot.run()
  File "D:\git\pywikipedia\category.py", line 512, in run
    self.oldCat.delete(reason, confirm, mark=True)
  File "D:\git\pywikipedia\wikipedia.py", line 3765, in delete
    self._getActionUser(action='delete', sysop=True)
  File "D:\git\pywikipedia\wikipedia.py", line 2018, in _getActionUser
    self.site().forceLogin(sysop=sysop)
  File "D:\git\pywikipedia\wikipedia.py", line 6719, in forceLogin
    if not self.loggedInAs(sysop=sysop):
  File "D:\git\pywikipedia\wikipedia.py", line 6713, in loggedInAs
    self._load(sysop=sysop)
  File "D:\git\pywikipedia\wikipedia.py", line 7772, in _load
    data = query.GetData(params, self, sysop=sysop)
  File "D:\git\pywikipedia\pywikibot\support.py", line 118, in wrapper
    return method(*__args, **__kw)
  File "D:\git\pywikipedia\query.py", line 150, in GetData
    data=data)
  File "D:\git\pywikipedia\wikipedia.py", line 7239, in getUrl
    back_response=True)
  File "D:\git\pywikipedia\pywikibot\comms\http.py", line 97, in request
    if not no_hostname and site.cookies(sysop = sysop):
  File "D:\git\pywikipedia\wikipedia.py", line 6797, in cookies
    self._loadCookies(sysop=sysop)
  File "D:\git\pywikipedia\wikipedia.py", line 6829, in _loadCookies
    % (self.family.name, self.lang))
pywikibot.exceptions.NoUsername: You tried to perform an action that requires admin privileges, but you haven't
entered your sysop name in your user-config.py. Please add
sysopnames['wikipedia']['fi']='name' to your user-config.py

>python version.py
Pywikibot: [https] r-pywikibot-compat.git (925d931, g11106, 2014/11/29, 15:08:51, ok)
Release version: 1.0b1
Python: 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok

Event Timeline

Silvonen raised the priority of this task from to Medium.
Silvonen updated the task description. (Show Details)
Silvonen changed Security from none to None.
Silvonen subscribed.
jayvdb subscribed.

Hi, I expect this bug does not exist in Pywikibot.

jayvdb lowered the priority of this task from Medium to Lowest.May 8 2015, 4:27 AM

Hi, I expect this bug does not exist in Pywikibot.

Confirmed. core marks the page for deletion if there is no sysop account.

Both compat and core have the command line argument -nodelete, which is good enough to avoid this bug.

Pywikibot has two versions: Compat and Core. This task was filed about the older version, called Pywikibot-compat, which is not under active development anymore. Hence I'm lowering the priority of this task to reflect the reality. Unfortunately, the Pywikibot team does not have the manpower to retest every single bug report / feature request against the (maintained) Pywikibot code base. Furthermore, the code base of Pywikibot-Compat has changed a lot compared to the code base of Pywikibot-Core so there is a chance that the problem described in this task might not exist anymore. Please help: Unfortunately manpower is limited and does not allow testing every single reported task again. If you have time and interest in Pywikibot, please upgrade to Pywikibot-Core and add a comment to this task if the problem in this task still happens in Pywikibot-Core (or directly edit the task by removing the Pywikibot-compat project and adding the Pywikibot project to this task). To learn more about Pywikibot and to get involved in its development, please check out https://www.mediawiki.org/wiki/Manual:Pywikibot/Development Thank you for your understanding.

Xqt subscribed.

Won't fix