code-google-com / editra-plugins

Automatically exported from code.google.com/p/editra-plugins
0 stars 0 forks source link

Projects addPath error #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Got this one in the error reporter today

*** Sat Jan 19 17:18:04 2008 ***
Traceback (most recent call last):
  File %22/Users/mpivov/.Editra/plugins/Projects-0.2-py2.5.egg/projects/ProjectPane.py%22, 
line 621, in OnItemExpanded
  File %22/Users/mpivov/.Editra/plugins/Projects-0.2-py2.5.egg/projects/ProjectPane.py%22, 
line 1154, in addPath
UnboundLocalError: local variable node referenced before assignment

I tried to reproduce it as the only way for 'node' to be unassigned is that if 
it is not a file or a 
directory. 

        if os.path.isfile(itempath):
            node = self.addFile(parent, name)
        elif os.path.isdir(itempath):
            node = self.addFolder(parent, name)

So I tried with a symlinked directory and a mounted drive but they both worked 
fine, so I am not 
sure how this error could have happened. Adding an 'else: return' branch might 
fix this issue?

Any ideas?

Cody

Original issue reported on code.google.com by CodyPrec...@gmail.com on 19 Jan 2008 at 11:39

GoogleCodeExporter commented 9 years ago
I changed the code so that it is either a directory, or not a directory.  
Directories are special in that they have 
"watcher" threads, so treating anything that isn't a directory as a file 
shouldn't hurt anything.

Original comment by Kevin.Da...@gmail.com on 21 Jan 2008 at 5:00

GoogleCodeExporter commented 9 years ago
Move old 'fixed' issues to verified

Original comment by CodyPrec...@gmail.com on 3 Feb 2009 at 8:18