diff --git a/shapefile.py b/shapefile.py index 5bdd50c..8a93898 100644 --- a/shapefile.py +++ b/shapefile.py @@ -240,17 +240,26 @@ def __init__(self, *args, **kwargs): if hasattr(kwargs["shp"], "read"): self.shp = kwargs["shp"] if hasattr(self.shp, "seek"): - self.shp.seek(0) + try: + self.shp.seek(0) + except UnsupportedOperationException: + pass if "shx" in kwargs.keys(): if hasattr(kwargs["shx"], "read"): self.shx = kwargs["shx"] if hasattr(self.shx, "seek"): - self.shx.seek(0) + try: + self.shx.seek(0) + except UnsupportedOperationException: + pass if "dbf" in kwargs.keys(): if hasattr(kwargs["dbf"], "read"): self.dbf = kwargs["dbf"] if hasattr(self.dbf, "seek"): - self.dbf.seek(0) + try: + self.dbf.seek(0) + except UnsupportedOperationException: + pass if self.shp or self.dbf: self.load() else: