Importing the gdal bindings in python seems to disable setting a non-zero exit code. Running the following batch file demonstrates the issue:
Running the following batch file demonstrates the issue: @echo off set pycmd=python -c "from osgeo import gdal;import sys;sys.exit(1)" echo %pycmd% %pycmd% echo ERRORLEVEL=%ERRORLEVEL% echo. set pycmd=python -c "import sys;sys.exit(1)" echo %pycmd% %pycmd% echo ERRORLEVEL=%ERRORLEVEL% echo. pause This prints out: python -c "from osgeo import gdal;import sys;sys.exit(1)" ERRORLEVEL=0 python -c "import sys;sys.exit(1)" ERRORLEVEL=1 Tested on Windows 7 Pro and Server 2008 R2 64bit with GDAL 1.9.1 MSVC2008 (Win32) with 32bit python 2.6.5 and GDAL 1.9.1 MSVC2008 (Win64) with 64bit python 2.6.6. I couldn't find a ticket reporting the issue in trac. Is this a known issue? Is it worthy of a ticket? Are there any known workarounds? Regards Luke
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev