Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b59a05c

Browse files
Nilokarimbahgat
Nilo
authored andcommitted
Fixed 'ShapefileException: No file-like object available.' when writing to file-like objects
1 parent df1c51a commit b59a05c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shapefile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,9 @@ def __init__(self, target=None, shapeType=None, autoBalance=False, **kwargs):
887887
shp,shx,dbf = kwargs.get('shp'), kwargs.get('shx'), kwargs.get('dbf')
888888
if shp:
889889
self.shp = self.__getFileObj(shp)
890-
elif shx:
890+
if shx:
891891
self.shx = self.__getFileObj(shx)
892-
elif dbf:
892+
if dbf:
893893
self.dbf = self.__getFileObj(dbf)
894894
else:
895895
raise Exception('Either the target filepath, or any of shp, shx, or dbf must be set to create a shapefile.')

0 commit comments

Comments
 (0)