Page MenuHomePhabricator

compat selflink.py freezes trying saving an edit
Closed, DeclinedPublic

Description

I have to use compat selflink.py because core's one doesn't support -xml option. Anyway (even using -page) it freezes trying saving any edit. Here's the traceback after a keyboard interrupt:

  File "selflink.py", line 306, in <module>
    main()
  File "selflink.py", line 301, in main
    bot.run()
  File "selflink.py", line 240, in run
    self.treat(page)
  File "selflink.py", line 222, in treat
    pywikibot.showDiff(oldText, text)
  File "/home/.../compat/pywikibot/support.py", line 161, in showDiff
    diff += lastline + '\n'
KeyboardInterrupt

Event Timeline

Vituzzu raised the priority of this task from to Needs Triage.
Vituzzu updated the task description. (Show Details)
Vituzzu subscribed.
jayvdb set Security to None.
jayvdb updated the task description. (Show Details)
jayvdb subscribed.

Could you provide more context to how you encounter this? What is the command line you are using; which db dump are you using? etc.

I've tested it against last four pages-meta-current it.wiki's dumps. I eventually came to a simple workaround: commenting out "pywikibot.showDiff(oldText, text)".

Anyway I've made a deeper investigation and I found more compact's script don't work.
Here's portale.py:

It seems to be a problem with showDiff method in pywikibot/support.py relying upond std difflib.

Traceback (most recent call last):

File "compat/portale.py", line 199, in <module>
  main()
File "compat/portale.py", line 188, in main
  wikipedia.showDiff(oldtext, newtext)
File "/home/.../compat/pywikibot/support.py", line 147, in showDiff
  for line in difflib.ndiff(oldtext.splitlines(),newtext):
File "/usr/lib/python2.7/difflib.py", line 907, in compare
  cruncher = SequenceMatcher(self.linejunk, a, b)
File "/usr/lib/python2.7/difflib.py", line 219, in __init__
  self.set_seqs(a, b)
File "/usr/lib/python2.7/difflib.py", line 231, in set_seqs
  self.set_seq2(b)
File "/usr/lib/python2.7/difflib.py", line 285, in set_seq2
  self.__chain_b()
File "/usr/lib/python2.7/difflib.py", line 318, in __chain_b
  for i, elt in enumerate(b):

TypeError: 'bool' object is not iterable

XXN renamed this task from compact selflink.py freezes trying saving an edit to compat selflink.py freezes trying saving an edit.Nov 18 2016, 9:49 PM
XXN updated the task description. (Show Details)
Xqt subscribed.

compat is closed. T124253 should be the next step.