What steps will reproduce the problem?
1. open (Reader) a shapefile (with N elements)
2. call the "shape" method with the value -N (which is valid !)
The expected value is the first (index 0) shape object but an exception is
raised in __restricted index after the test at line 194 (version 1.1.4).
The code below fix the bug
def __restrictIndex(self, i):
"""Provides list-like handling of a record index with a clearer
error message if the index is out of bounds."""
if self.numRecords:
if i < -self.numRecords or self.numRecords <= i:
raise IndexError("Shape or Record index out of range.")
if i < 0: i += self.numRecords
return i
Original issue reported on code.google.com by pa.ler...@gmail.com on 9 Apr 2012 at 10:27
Original issue reported on code.google.com by
pa.ler...@gmail.com
on 9 Apr 2012 at 10:27