[Tutor] Strange IndexError

Willi Richert w.richert at gmx.net
Tue Jun 14 10:07:56 CEST 2005

Hi Danny,

I've posted the bug at the pyro ML. However the old IndexError annoys me more 
and more. Although I have encapsulated it with try/except blocks and that 
works ok for what I want, I really want to understand how an exception like

Traceback (most recent call last):
  File "NeedBrain.py", line 257, in update
    assert type(self.STAY_MIN_DIST)==type(1.0), str(self.STAY_MIN_DIST)+"is 
not float"
IndexError: tuple assignment index out of range

is thrown. I mean, this line of code must be some Python related stuff. The 
only alternativ would be that self has some __getattr__ methods that were 
invoked. But then, the exception would have bin in that method, wouldn't it?
The only place where STAY_MIN_DIST is set is as a class variable:

class ApproachMarkerAction(State):
    STAY_MIN_DIST = 2.0
    def __init__(self, markerType=None, status = 0, name = ''):

Thanks for any clarification,

Am Dienstag, 14. Juni 2005 01:03 schrieb Danny Yoo:
> On Mon, 13 Jun 2005, Willi Richert wrote:
> > I used the same Pyro code, but this time with the release versions of
> > player and stage. This time python crashed with a segfault:
> Hi Willi,
> If you see a segfault like this, it's almost definitely a bug in a
> third-party module.  It is possible that the bug is in Python itself, but
> since the Python core has been so well-tested, this is unlikely.
> Bring this up to the Pyro folks so they can trace what looks like an
> incorrect refcount problem somewhere in their C code or SWIG bindings.  I
> don't think there's much else that you can do at this point, unless you
> have written your code to use some substitute to Pyro.
> If I had time, I'd be willing to look at the Pyro code and see what's
> going on.  But the Pyro folks are probably the people to pester about
> this, since this looks like a problem in their extension code.
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list