IndexError on startup after external changes to @shadow files

0 views
Skip to first unread message

akaihola

unread,
Apr 20, 2010, 2:32:37 AM4/20/10
to leo-editor
I created and edited a number of @shadow entries in my .leo files.
After closing Leo, I committed some changes into my Git repository and
rolled back some whitespace-only changes.

The next time I tried to open Leo with the .leo file I got this:

$ leo --ipython testproject.leo
*** isPython3: False
Leo 4.8 devel, build 3005, February 26, 2010
Python 2.6.5, qt version 4.6.2
linux2
reading settings in /home/ak/leobzr/leo/config/leoSettings.leo
using menus from: leoSettings.leo
reading settings in /home/ak/.leo/myLeoSettings.leo
reading settings in /home/ak/testproject/testproject.leo
reading /home/ak/.leo/.leoRecentFiles.txt
@enabled-plugins found in myLeoSettings.leo
No word lists can be found for the language "fi_FI".
aspell checker not enabled
Traceback (most recent call last):
File "/usr/local/bin/leo", line 7, in <module>
execfile(__file__)
File "/home/ak/leobzr/leo/scripts/leo", line 8, in <module>
leo.core.runLeo.run()
File "/home/ak/leobzr/leo/core/runLeo.py", line 96, in run
ok = doPostPluginsInit(args,fn,relFn,script,versionFlag)
File "/home/ak/leobzr/leo/core/runLeo.py", line 357, in
doPostPluginsInit
c,frame = createFrame(fileName,relativeFileName,script)
File "/home/ak/leobzr/leo/core/runLeo.py", line 386, in createFrame
ok, frame = g.openWithFileName(relativeFileName or fileName,None)
File "/home/ak/leobzr/leo/core/leoGlobals.py", line 2420, in
openWithFileName
ok = g.handleOpenHooks(c,old_c,gui,fn,f,readAtFileNodesFlag)
File "/home/ak/leobzr/leo/core/leoGlobals.py", line 2483, in
handleOpenHooks
readAtFileNodesFlag=readAtFileNodesFlag) # closes file.
File "/home/ak/leobzr/leo/core/leoFileCommands.py", line 939, in
open
silent=silent)
File "/home/ak/leobzr/leo/core/leoFileCommands.py", line 802, in
getLeoFile
c.atFileCommands.readAll(c.rootVnode(),partialFlag=False)
File "/home/ak/leobzr/leo/core/leoAtFile.py", line 655, in readAll
at.readOneAtShadowNode (fileName,p)
File "/home/ak/leobzr/leo/core/leoAtFile.py", line 846, in
readOneAtShadowNode
at.read(p,atShadow=True)
File "/home/ak/leobzr/leo/core/leoAtFile.py", line 482, in read
fileName = at.openFileForReading(fromString=fromString)
File "/home/ak/leobzr/leo/core/leoAtFile.py", line 446, in
openFileForReading
x.updatePublicAndPrivateFiles(fn,shadow_fn)
File "/home/ak/leobzr/leo/core/leoShadow.py", line 588, in
updatePublicAndPrivateFiles
written = x.propagate_changes(fn,shadow_fn)
File "/home/ak/leobzr/leo/core/leoShadow.py", line 525, in
propagate_changes
old_public_lines,old_private_lines,marker)
File "/home/ak/leobzr/leo/core/leoShadow.py", line 456, in
propagate_changed_lines
new_line = new_public_lines_rdr.get()
File "/home/ak/leobzr/leo/core/leoShadow.py", line 1021, in get
result = self.lines[self.i]
IndexError: list index out of range

I'm using Leo rev 3064 installed with setuptools' "develop" command,
Python 2.6.5 on Ubuntu 10.04 (pre-release).

I'd be grateful for any advice on how to proceed to be able to
continue work on my test project.

Antti Kaihola
Espoo, Finland

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To post to this group, send email to leo-e...@googlegroups.com.
To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.

akaihola

unread,
Apr 20, 2010, 7:34:59 AM4/20/10
to leo-editor
I solved this problem by running leo with IPython and using %debug to
identify the file causing the problem. I then appended an empty line
to the file and ran Leo again, and all works well again.

While debugging I noticed that in the sourcereader object:
len(self.lines) == 116
self.length == 116
self.i == 116

So for some reason self.i overflowed.

Edward K. Ream

unread,
Apr 20, 2010, 2:16:30 PM4/20/10
to leo-e...@googlegroups.com
On Tue, Apr 20, 2010 at 6:34 AM, akaihola <akai...@gmail.com> wrote:
> I solved this problem by running leo with IPython and using %debug to
> identify the file causing the problem. I then appended an empty line
> to the file and ran Leo again, and all works well again.
>
> While debugging I noticed that in the sourcereader object:
> len(self.lines) == 116
> self.length == 116
> self.i == 116
>
> So for some reason self.i overflowed.

Thanks for these hints. I'll attempt to eliminate the fragile code.

Edward
Reply all
Reply to author
Forward
0 new messages