[Eric] Bugs in latest eric4 snapshot

Andreas Pakulat apaku at gmx.de
Wed Apr 4 13:09:16 BST 2007


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(). 

However a simple replace in all createIndex() calls still doesn't
completely fix the model, it seems that something tries to call item()
with non-source-model indices. I added a print for the pointer and id to
the item() function adn this is the result:

<refcnt -1257449590 at 0xb50cd770> -1257449616
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".

Error information:
--------------------------------------------------------------------------------
2007-04-04, 14:04:43
--------------------------------------------------------------------------------
<type 'exceptions.KeyError'>:
-1257449616L
--------------------------------------------------------------------------------
  File "/home/andreas/python2.5/lib/python2.5/site-packages/eric4/UI/BrowserSortFilterProxyModel.py", line 99, in filterAcceptsRow
    return self.sourceModel().item(sindex).isPublic()
  File "/home/andreas/python2.5/lib/python2.5/site-packages/eric4/UI/BrowserModel.py", line 215, in item
    return self.item_dict[index.internalId()]

<refcnt -1257449542 at 0xb50cd7a0> -1257449568
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".

Error information:
--------------------------------------------------------------------------------
2007-04-04, 14:04:43
--------------------------------------------------------------------------------
<type 'exceptions.KeyError'>:
-1257449568L
--------------------------------------------------------------------------------
  File "/home/andreas/python2.5/lib/python2.5/site-packages/eric4/UI/BrowserSortFilterProxyModel.py", line 99, in filterAcceptsRow
    return self.sourceModel().item(sindex).isPublic()
  File "/home/andreas/python2.5/lib/python2.5/site-packages/eric4/UI/BrowserModel.py", line 215, in item
    return self.item_dict[index.internalId()]

<refcnt -1257449614 at 0xb50cd7e8> -1257449496
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".

Error information:
--------------------------------------------------------------------------------
2007-04-04, 14:04:43
--------------------------------------------------------------------------------
<type 'exceptions.KeyError'>:
-1257449496L
--------------------------------------------------------------------------------
  File "/home/andreas/python2.5/lib/python2.5/site-packages/eric4/UI/BrowserSortFilterProxyModel.py", line 99, in filterAcceptsRow
    return self.sourceModel().item(sindex).isPublic()
  File "/home/andreas/python2.5/lib/python2.5/site-packages/eric4/UI/BrowserModel.py", line 215, in item
    return self.item_dict[index.internalId()]

See that there's some refcnt object in the internalPointer and not an
item? I have no idea why sindex would be not valid, but it seems it
is...

On a side not: There's a model testing class available from a TT guy
here: http://labs.trolltech.com/page/Projects/Itemview/Modeltest 
I'll see if I can port this to PyQt4 later today and suggest it as an
addition to PyQt4.

Andreas

-- 
You will gain money by a speculation or lottery.


More information about the Eric mailing list