[Gdal-dev] gdal.Open() crash my python script..

Sean Gillies sgillies at frii.com
Thu Jul 13 13:00:16 EDT 2006


On Jul 13, 2006, at 9:06 AM, Antonello Lobianco (Sylvaticus) wrote:

> Hello all.. I'm just switching a program to python form C++, so I am
> quite newbie about python..
>
> This code produce the script to exit, without any apparent error:
>
> mapFilename =  "../data/gis/colliEsini/c00_100m.tiff"
> poDataset = gdal.Open(mapFilename, gdal.GA_ReadOnly)
> if poDataset is None:
>     print "*** ERROR, opening of the map dataset didn't success"
>
> The problem is "_obj = _gdal.GDALOpen(file,access)" on gdal.py and the
> only message I can get is a
> "<terminated, exit value: 139>regmasNoGui.py" message..
>
> if the mapFilename is wrong I have correctly a message that the  
> file do
> not exist..
>
>
>
> /sylvaticus

Try using methods of the os module to test your input file before  
opening it with GDAL. These will raise clear exceptions in the case  
of inadequate permissions, etc.

cheers,
Sean

---
Sean Gillies
http://zcologia.com






More information about the Gdal-dev mailing list