Page MenuHomePhabricator

Sysop not authorized to (un)delete pages on wikipedia
Closed, ResolvedPublic

Description

I have sysop rights, in user-config.py line

sysopnames['wikipedia']['cs'] = u'JAn Dudík'

but when I want to mass delete using script, I am not able to login as sysop only as bot without sysop rights:

C:\pwb>pwb.py delete -file:aaa.txt
Enter a reason for the deletion: Nahrazeno šloblonou {{Části české obce}}


>>> Šablona:Město Kožlany <<<
WARNING: There are 1 pages who link to [[cs:Šablona:Město Kožlany]].
    Project:    [4]          1 page
Do you want to delete [[cs:Šablona:Město Kožlany]]? ([y]es, [N]o, [a]ll, [q]uit): y
Password for user JAn Dudík on wikipedia:cs (no characters will be shown):
Logging in to wikipedia:cs as JAn Dudík
WARNING: API warning (login): Main-account login via action=login is deprecated and may stop working without warning. To continue login with action=login, see [[Special:BotPasswords]]. To safely continue using main-account login, see action=clientlogin.
ERROR: Logged in as 'JAn Dudík' instead of 'JAnDbot'. Forcing re-login.
Logging in to wikipedia:cs as JAnDbot
WARNING: API warning (login): Main-account login via action=login is deprecated and may stop working without warning. To continue login with action=login, see [[Special:BotPasswords]]. To safely continue using main-account login, see action=clientlogin.
ERROR: Logged in as 'JAnDbot' instead of 'JAn Dudík'. Forcing re-login.
Logging in to wikipedia:cs as JAnDbot
WARNING: API warning (login): Main-account login via action=login is deprecated and may stop working without warning. To continue login with action=login, see [[Special:BotPasswords]]. To safely continue using main-account login, see action=clientlogin.
WARNING: API error permissiondenied: Permission denied

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

ERROR: Error: User JAnDbot not authorized to (un)delete pages on wikipedia:cs wiki.
Traceback (most recent call last):
  File "C:\pwb\pwb.py", line 255, in <module>
    if not main():
  File "C:\pwb\pwb.py", line 249, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "C:\pwb\pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File ".\scripts\delete.py", line 304, in <module>
    main()
  File ".\scripts\delete.py", line 296, in main
    bot.run()
  File "C:\pwb\pywikibot\bot.py", line 1621, in run
    super(MultipleSitesBot, self).run()
  File "C:\pwb\pywikibot\bot.py", line 1435, in run
    self.treat(page)
  File "C:\pwb\pywikibot\bot.py", line 1649, in treat
    self.treat_page()
  File ".\scripts\delete.py", line 214, in treat_page
    quit=True)
  File "C:\pwb\pywikibot\tools\__init__.py", line 1447, in wrapper
    return obj(*__args, **__kw)
  File "C:\pwb\pywikibot\page.py", line 1824, in delete
    return self.site.deletepage(self, reason)
  File "C:\pwb\pywikibot\site.py", line 1330, in callee
    return fn(self, *args, **kwargs)
  File "C:\pwb\pywikibot\tools\__init__.py", line 1447, in wrapper
    return obj(*__args, **__kw)
  File "C:\pwb\pywikibot\site.py", line 5383, in deletepage
    raise Error(self._dl_errors[err.code] % errdata)
pywikibot.exceptions.Error: User JAnDbot not authorized to (un)delete pages on wikipedia:cs wiki.
<class 'pywikibot.exceptions.Error'>
CRITICAL: Closing network session.

Event Timeline

Change 341699 had a related patch set uploaded (by Xqt; owner: Masti):
[pywikibot/core] fix relogin issue with admin account

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

Xqt triaged this task as Medium priority.Jun 27 2017, 5:32 PM
Xqt added a project: Pywikibot.

Unable to use delete.py on Commons due to this error

Unable to use delete.py on Commons due to this error

Is it really this issue described above (re-login issue) or is it rather T233608: cannot use delete.py despite being admin on a wiki (fetching admin rights issue)?

Change 341699 abandoned by Xqt:
fix relogin issue with admin account

Reason:
The behaviour has been changed from group related rights to direct user Rights. There is no dualism of user/sysop anymore

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

Xqt claimed this task.
Xqt removed a project: Patch-For-Review.
Xqt added subscribers: Huji, Xqt.

The behaviour has been changed from group related rights to direct user Rights. There is no dualism of user/sysop anymore

Xqt removed Xqt as the assignee of this task.Jan 12 2020, 1:42 PM