This is the code I'm trying to run:

In [1]: from osgeo import ogr

In [2]: datasource = ogr.Open('testdata.shp')

In [3]: datasource.GetLayerCount()
Out[3]: 1

In [4]: layer = datasource.GetLayerByIndex(0)

In [5]: layer.GetName()
Segmentation fault: 11

It doesn't matter what datasource I use. I've tried with several (even different formats) but I keep getting the same result.

Anyone faced this issue before? I've tried reinstalling gdal (in my computer) and GDAL (Python bindings) but still no luck. The weirdest thing is that it was working fine 2 days ago, and suddently started failing.

  • OS X v10.8.5
  • GDAL==1.10.0
  • 1
    Can you upload your shapefile somewhere? I'd be happy to check it with working software to makes sure it's not corrupted data. – sgillies Mar 7 '14 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.