When editing with the attached presets file loaded with a simple rule and list, beginning to edit then after seeing the diff, I chose e to edit. I had chosen env ($EDITOR) as my choice to see what would happen even though that environmental variable is not set on Ubuntu. It worked and a spare external editor window opened, but I couldn't tell what it was. I made no changes, then closed the editor and got the following error:
e
can't invoke "event" command: application has been destroyed
while executing
"event generate $w <<themechanged>>"
(procedure "ttk::ThemeChanged" line 6)
invoked from within
"ttk::ThemeChanged"
Traceback (most recent call last):
File "cli_pyawb.py", line 1154, in <module>
main(sys.argv)
File "cli_pyawb.py", line 1144, in main
my_text_menu.begin()
File "/home/bob/pyawb/textmenu.py", line 96, in begin
z = child()
File "/home/bob/pyawb/menu.py", line 153, in call
return self.function(self)
File "cli_pyawb.py", line 396, in begin_editing
wikipedia.output("\03{lightblue}%s changes were made. Please review difference before saving.\03{default}" % diff_render.diff4(ms.cur_page_content, ms.new_page_content))
File "/home/bob/pyawb/diff_render.py", line 266, in diff4
data = ''.join(list(difflib.ndiff(a, b)))
File "/usr/lib/python2.6/difflib.py", line 911, in compare
for tag, alo, ahi, blo, bhi in cruncher.get_opcodes():
File "/usr/lib/python2.6/difflib.py", line 565, in get_opcodes
for ai, bj, size in self.get_matching_blocks():
File "/usr/lib/python2.6/difflib.py", line 482, in get_matching_blocks
la, lb = len(self.a), len(self.b)
TypeError: object of type 'NoneType' has no len()</module></themechanged>
This appears to occur when difflib.ndiff is pass a normal text parameter, and a None object (in any order):
Passing two None objects causes a different error. Obviously, this appears to be a combination of errors: the fact that a Tkinter edit window was opened (when it shouldn't be), and that, for some reason, a None object was passed (presumably as the "new text") value. I'll look into it.
Solved in cli_pyawb (edit will never return a None value) as of revision 71. Solved in diff_render (diff4 will accept None parameters and deal with accordingly) as of revision 72.