#95 Using a seperator when Source Browser is sorted causes crash

closed
nobody
None
5
2007-04-11
2005-06-05
Yuce Tekol
No

Setting Source Browser to be sorted (i.e.,
self.parent.prefs.sourcebrowserissorted=True) and using
a seperator line (i.e., #--- LABEL) causes the
application to crash. (If Source Browser is not sorted,
there is no problem)

Here is a sample code that reproduces the problem:

----------------------

def A():
pass

#--- ABC

----------------------

Python: 2.4.1
wxPython: 2.6.0.1 Unicode
DrPython: 3.10.13
OS: WinXP SP2

The crash is caused by the
self.classtree.SortChildren(...) lines in
drSourceBrowser.py. There may be a bug in the wxWidgets
or wxPython because no exception is thrown for these lines.

If the lines below in the mentioned file are commented
out (so disabling the appending of seperators to the
Source Browser) crashing doesn't happen:

if matchedtext[0] == '#':
pass
// comment out the following lines
// nextmatch = ...
// upto the outer else
else:
indent = ...

Discussion

  • Logged In: YES
    user_id=772872

    Hello, i could duplicate this also.

    Looking at the source code, I discovered some differences
    between
    the if and else branch:
    Inserting in line 270, after:
    currentitem = self.classtree.AppendItem(Roots[cI], a)

    =>Roots.append(currentitem)
    =>self.classtree.SetPyData(Roots[-1], None)
    should solve the problem.

    But nevertheless, there could be an exception.

     
  • Logged In: YES
    user_id=772872

    and also append then:
    =>currentRoot = currentRoot + 1
    =>RootArray.append(Roots[currentRoot])

     
  • Logged In: YES
    user_id=772872
    Originator: NO

    patch applied for DrPython 1.66.

     
    • status: open --> closed