Page MenuHomePhabricator

Pywikibot gives script termination on page delete
Closed, ResolvedPublic


I am helping out a friend who has an SEO/legal issue on his wiki requiring mass deletion of content and pages. He were ordered to delete the pages or run the risk of being shut down.

Therefore, I am trying to use pywikibot to accomplish this.

I am able to connect to the wikisite as my bot account "UnaBot"

I am attempting to delete page "Test_page_3"

When I try to run a delete page, it throws an exception. I spoke with some users on the IRC channel and they recommended submitting a bug.

The following is the command i executed and the results:

c:\core> -page:"Test_page_3" -always
Enter a reason for the deletion: Testing pywikibot

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

ERROR: ValueError: too many values to unpack (expected 2)
Traceback (most recent call last):

File "C:\core\", line 168, in <module>
File "C:\core\", line 160, in main
File "C:\core\pywikibot\", line 1599, in run
  super(MultipleSitesBot, self).run()
File "C:\core\pywikibot\", line 1413, in run
File "C:\core\pywikibot\", line 1626, in treat
  self.current_page = page
File "C:\core\pywikibot\", line 1213, in current_page
File "C:\core\pywikibot\tools\", line 170, in color_format
  return _ColorFormatter().format(text, *args, **kwargs)
File "C:\Users\Unatratnag\AppData\Local\Programs\Python\Python35-32\lib\", line 187, in format
  return self.vformat(format_string, args, kwargs)
File "C:\core\pywikibot\tools\", line 152, in vformat
File "C:\Users\Unatratnag\AppData\Local\Programs\Python\Python35-32\lib\", line 191, in vformat
  result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
File "C:\core\pywikibot\tools\", line 125, in _vformat
  result = super(_ColorFormatter, self)._vformat(*args, **kwargs)
File "C:\Users\Unatratnag\AppData\Local\Programs\Python\Python35-32\lib\", line 241, in _vformat

ValueError: too many values to unpack (expected 2)
<class 'ValueError'>
CRITICAL: Closing network session.


Related Gerrit Patches:

Event Timeline

Unatratnag raised the priority of this task from to Needs Triage.
Unatratnag updated the task description. (Show Details)
Unatratnag added a project: MediaWiki-General.
Unatratnag added a subscriber: Unatratnag.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 16 2015, 7:30 PM
valhallasw set Security to None.
Restricted Application added a subscriber: pywikibot-bugs-list. · View Herald TranscriptDec 16 2015, 7:56 PM
XZise claimed this task.Dec 16 2015, 8:04 PM
XZise added a subscriber: XZise.

It seems that at some point in Python 3.5, Formatter._vformat changed what it returned and we had to override it so this is broken. Now I have 3.5 installed locally and there _vformat returns only one value but the current version on CPython's repository returns two and unpacks them.

Change 259549 had a related patch set uploaded (by XZise):
[FIX] Support changed _vformat signature of 3.5.1

Change 259549 merged by jenkins-bot:
[FIX] Support changed _vformat signature of 3.5.1

Xqt closed this task as Resolved.Apr 6 2016, 11:48 AM