classification
Title: IndexError: Add bad index to msg
Type: enhancement Stage: test needed
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Add index attribute to IndexError
View: 18162
Assigned To: Nosy List: BreamoreBoy, Reflejo, mkleehammer
Priority: normal Keywords:

Created on 2006-08-04 14:40 by mkleehammer, last changed 2013-11-07 18:22 by brett.cannon. This issue is now closed.

Messages (3)
msg61250 - (view) Author: Michael Kleehammer (mkleehammer) * Date: 2006-08-04 14:40
It would be very helpful to add more information to the
IndexErrors raised by the built-in classes.

Today, these errors look like:

  IndexError: list index out of range

When these occur, I usually have to add print
statements before the error and reproduce the problem
to determine what has gone wrong.  

If the list and tuple classes add the requested index
and the length of the structure, it would help a lot. 
Below is a suggestion:

  IndexError: list index 30 out of range; len=27

msg68521 - (view) Author: Martín Conte Mac Donell (Reflejo) Date: 2008-06-21 17:33
I don't think this is bearly needed. This error messages (IndexError:
list index out of range) comes from so long ago that those kind of
changes makes me feel worried.
msg114811 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-24 19:58
Is this ever likely to happen, it's already been closed and reopened once?
History
Date User Action Args
2013-11-07 18:22:56brett.cannonsetstatus: open -> closed
resolution: duplicate
2013-11-07 18:22:48brett.cannonsetsuperseder: Add index attribute to IndexError
2010-08-24 19:58:54BreamoreBoysetnosy: + BreamoreBoy

messages: + msg114811
versions: - Python 2.7
2009-05-13 22:33:41ajaksu2setstage: test needed
versions: + Python 2.7, Python 3.2, - Python 2.6
2008-06-23 00:43:19benjamin.petersonsetstatus: closed -> open
resolution: not a bug -> (no value)
2008-06-23 00:43:00benjamin.petersonsetstatus: open -> closed
resolution: not a bug
2008-06-21 17:33:46Reflejosetnosy: + Reflejo
messages: + msg68521
2006-08-04 14:40:26mkleehammercreate