@@ -982,7 +982,7 @@ def __init__(self, *args, **kwargs):
982
982
# Inspect zipfile contents to find the full shapefile path
983
983
shapefiles = [name
984
984
for name in archive .namelist ()
985
- if name .endswith ('.shp' )]
985
+ if ( name .endswith ('.SHP' ) or name . endswith ( '. shp') )]
986
986
# The zipfile must contain exactly one shapefile
987
987
if len (shapefiles ) == 0 :
988
988
raise ShapefileException ('Zipfile does not contain any shapefiles' )
@@ -993,14 +993,14 @@ def __init__(self, *args, **kwargs):
993
993
path to the shapefile you would like to open.' % shapefiles )
994
994
# Try to extract file-like objects from zipfile
995
995
shapefile = os .path .splitext (shapefile )[0 ] # root shapefile name
996
- for ext in ['shp' ,'shx' ,'dbf' ]:
996
+ for ext in ['SHP' , 'SHX' , 'DBF' , ' shp' ,'shx' ,'dbf' ]:
997
997
try :
998
998
member = archive .open (shapefile + '.' + ext )
999
999
# write zipfile member data to a read+write tempfile and use as source, gets deleted on close()
1000
1000
fileobj = tempfile .NamedTemporaryFile (mode = 'w+b' , delete = True )
1001
1001
fileobj .write (member .read ())
1002
1002
fileobj .seek (0 )
1003
- setattr (self , ext , fileobj )
1003
+ setattr (self , ext . lower () , fileobj )
1004
1004
self ._files_to_close .append (fileobj )
1005
1005
except :
1006
1006
pass
0 commit comments