Closed GoogleCodeExporter closed 9 years ago
A fix would be to add the check:
self.editor = PyStudioUtils.GetEditorOrOpenFile(self.mainwindow, fileName)
if not self.editor:
return
self.editorlineno = lineNo - 1
self.editor.GotoLine(self.editorlineno)
self.editor.ShowStepMarker(self.editorlineno, show=True)
However, I am wondering why self.editor would ever be None.
As self.mainwindow is used in the call to PyStudioUtils.GetEditorOrOpenFile, if
it was None, that would have caused a failure earlier, so it's not that.
Is it that fileName is invalid? But then RpdbStackFrameManager passes the
fileName from rpdb2 so don't see that it would pass an invalid path. Perhaps
there is a problem opening the file?
Need to find out from user wbruhin more about what he or she was doing when
this happened.
Original comment by rans1...@gmail.com
on 10 Jun 2011 at 5:07
Are there still any remnant calls to normpath in the plugin?
That will fail on Linux since the file system is case sensitive and the name
will no longer match.
Either need to use the real unaltered path name or need to do a case
insensitive search when trying to locate a buffer.
Original comment by CodyPrec...@gmail.com
on 10 Jun 2011 at 5:47
There are no normpaths. There are normcases, but these should be fine as API
says:
os.path.normcase(path)
Normalize the case of a pathname. On Unix and Mac OS X, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase. On Windows, it also converts forward slashes to backward slashes.
Original comment by rans1...@gmail.com
on 15 Jun 2011 at 3:01
Yea that should be fine, also especially since the lookup for existing file
uses the same call when doing the string matching.
The only thing I see is that the GetEditorForFile method is looping through the
controls and then doing the following:
return nb.GetPage(page.GetTabIndex())
Its possible that the tab index could be out of sync and returning None. This
call is unnecessary since the page instance is what you want to return.
Committed change to simplify this and remove the chance of the wrong object
being returned.
return page
Also added 'if self.editor' check with log message for when get editor fails to
help with debugging issue.
Closing as Fixed, please feel free to re-open if issue persists.
Original comment by CodyPrec...@gmail.com
on 15 Jun 2011 at 3:25
Original issue reported on code.google.com by
CodyPrec...@gmail.com
on 9 Jun 2011 at 3:34