[gdal-dev] some problem in python bindings

Vincent Schut schut at sarvision.nl
Thu May 20 08:48:53 EDT 2010


Hi,

since some time (I don't know exactly since when, but I regularly update 
gdal from svn and I don't remember this happening earlier), there is a 
problem with the python swig bindings when doing this:

data = gdal_array.BandReadAsArray(gdal.Open(filename).GetRasterBand(1))

instead of this:

ds = gdal.Open(filename)
data = gdal_array.BandReadAsArray(ds.GetRasterBand(1))

The first version gives me a segfault, the second works OK. Probably 
some refcounting issue?

I'm a bit in a hurry and have currently no time for further 
investigations. Could look at it in more detail later next week, if 
necessary.

this is on linux ('Arch') 64 bit, gdal fresh from svn, python 2.6.5, gcc 
4.4.3

Regards,
Vincent Schut.


More information about the gdal-dev mailing list