GNOME Bugzilla – Bug 656292
list index out of range, when saving after an undo
Last modified: 2011-08-13 21:09:58 UTC
with current git head f8ec49175f4767 open attached files: meld left right copy dh_python2 from right to left save undo (ctrl z) save => crash: Traceback (most recent call last):
+ Trace 228064
self.current_doc().save()
self.save_file(pane)
self.undosequence.checkpoint(buf)
while end < len(self.actions) and self.actions[end + 1].buffer != buf:
debugger run: > /home/jtaylor/tmp/meld/meld/undo.py(182)checkpoint() 181 end = self.next_redo --> 182 while end < len(self.actions) and self.actions[end + 1].buffer != buf: 183 end += 1 ipdb> p self.actions [<meld.undo.GroupAction object at 0x319e9d0>] ipdb> p len(self.actions) 1 ipdb> p end 0 fixes seems simple: - while end < len(self.actions) and self.actions[end + 1].buffer != buf: + while end < (len(self.actions) - 1) and self.actions[end + 1].buffer != buf:
I was about to get really excited to have an easy repro for this... and then I noticed that you hadn't attached the files. Any chance that you'd be able to do so? Having said that, the fix looks reasonable. I'd just prefer to have a test case.
Nevermind. The important sequence is: modify; save; undo; save. Sorry for the noise.
Fixed in HEAD. Thanks for the patch.
*** Bug 651651 has been marked as a duplicate of this bug. ***