[Eric] Bugs in latest eric4 snapshot

Andreas Pakulat apaku at gmx.de
Mon Apr 9 19:09:05 BST 2007


On 09.04.07 17:31:44, Detlev Offenbach wrote:
> On Donnerstag, 5. April 2007, Andreas Pakulat wrote:
> > On 04.04.07 14:09:16, Andreas Pakulat wrote:
> > > On 04.04.07 02:14:05, Andreas Pakulat wrote:
> > > > Hi,
> > > >
> > > > just updated to python2.5 and latest snapshots of pyqt4/sip/eric4
> > > > (20070402) and trying to start it I get:
> > > >
> > > > An unhandled exception occurred. Please report the problem using the
> > > > error reporting dialog or via email to <eric4-bugs at die-offenbachs.de>.
> > > > A log has been written to "/home/andreas/.eric4/eric4_error.log".
> > >
> > > This seems to be a serious bug in BrowserModel.py, it created indices
> > > using createIndex( row, column, item ) and later on it uses indices that
> > > are given to it (for example in the item() function) to retrieve the
> > > item from a dict. This can't work, using createIndex() will set the
> > > internalPointer() of that index, but internalId() will return some
> > > "arbitrary" value (i.e. -1.....). So BrowserModel.py needs to be fixed
> > > to be consistent, either always use createIndex(row,col,id(item)) or
> > > always use internalPointer() instead of internalId().
> >
> > Ok, I talked to Phil on the pyqt list and it seems internalId() is not
> > reliable in Python due to the fact that in Python id() uses a long,
> > while in C++ createIndex uses a quint32 and internalId in C++ uses a
> > quint64 (which is probably a bug anyway). So I created a patch which
> > fixes BrowserModel and unless I'm mistaken also ProjectBrowserModel, by
> > using internalPointer and the object-overload of createIndex together
> > with a list of objects instead of a dict.
> 
> the problem you observed could explain some non reproducable crashes I have 
> over here. Andreas, is your patch complete and working on your side? If so, 
> I'd include it in the next snapshot.

The one I posted seems to work fine (I didn't test everything though),
the one I currently have implemented (without the self.dict_items list,
as references to the objects are already kept in the children list -
afaik) doesn't work when I try to open a file (i.e. show its classes).
I'm also not 100% sure I tested this with the posted patch... So I guess
you should first try it out a bit, before adding it permanently.

Andreas

-- 
You will be run over by a beer truck.


More information about the Eric mailing list