lannymac / pyshp

Automatically exported from code.google.com/p/pyshp
MIT License
0 stars 0 forks source link

Check if shape file exists #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
s = shapefile.Reader('<none_existing_file>.shp')
shapes = s.shapes()

What is the expected output? What do you see instead?
Expect an exception stating the file does not exists
Get:
    225         def shapes(self):
    226                 """Returns all shapes in a shapefile."""
--> 227                 self.shp.seek(100)
    228                 shapes = []
    229                 while self.shp.tell() < self.shpLength:

AttributeError: 'NoneType' object has no attribute 'seek'

What version of the product are you using? On what operating system?
1.06
Python 2.6
Ubuntu Linux 10.04 64 bit

Please provide any additional information below.

Original issue reported on code.google.com by StorPipf...@gmail.com on 21 Sep 2011 at 8:09

GoogleCodeExporter commented 9 years ago
Better checks and error messages have been implemented.

Original comment by jlawh...@geospatialpython.com on 27 Sep 2011 at 2:17