Even,
my opinion is that if all info are attached to the python exception then it
should not matter if the error status is reset or not.
Anyway I can't figure out why an exception is raised if the called function
that doesn't generete any error.
best regards
--
Antonio VALENTINO
System Engineer
INNOVA Consorzio per l'Informatica e la Telematica s.r.l.
Z.I. La Martella - C.da Chiatamura - Lotto 188 - 75100 Matera (MT) Italy
Tel.: +39 0835 1852131, +39 0835 307760 (+39 0835 309180)
Fax: +39 0835 264705
Email: valent...@consorzio-innova.it
Home Page: www.consorzio-innova.com
*ATTENZIONE*: le informazioni contenute in questo messaggio sono da
considerarsi confidenziali ed il loro utilizzo e' riservato unicamente al
destinatario sopra indicato. Chi dovesse ricevere questo messaggio per
errore e' tenuto ad informare il mittente ed a rimuoverlo definitivamente da
ogni supporto elettronico o cartaceo.
*WARNING*: This message contains confidential and/or proprietary information
which may be subject to privilege or immunity and which is intended for use
of its addressee only. Should you receive this message in error, you are
kindly requested to inform the sender and to definitively remove it from any
paper or electronic format.
----- Original Message -----
From: "Even Rouault" <even.roua...@mines-paris.org>
To: <gdal-dev@lists.osgeo.org>
Cc: "Luca Fasano" <lucafas...@interfree.it>
Sent: Thursday, June 18, 2009 11:03 PM
Subject: Re: [gdal-dev] [gdal Python] Exceptions not reset correctly
ifgdal.UseExceptions() is used
Luca,
(This behaviour is identical in trunk too)
we could probably reset the error state after issuing the exception, but
that
would prevent code from getting the error message if they call
gdal.GetLastErrorMsg() afterwards. But I don't think this would be a
problem.
We should probably also call ErrorReset() in gdal.UseExceptions() so that
previous errors don't cause unexpected exceptions to be thrown.
Howard ?
Le Thursday 18 June 2009 10:09:27 Luca Fasano, vous avez écrit :
Hi all,
I suspect there is a bug in gdal.UseExceptions() in python binding.
I noticed that if a RuntimeError has been generated, following gdal
instructions *raise the same exception*.
It seems that a gdal.ErrorReset() is necessary to reset it.
An example with ipython:
In [2]: from osgeo import gdal
In [3]: gdal.UseExceptions()
In [4]: dataset = gdal.Open('./filename.wrongformat')
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
/home/fasano/Desktop/test/<ipython console> in <module>()
RuntimeError: `./filename.wrongformat' not recognised as a supported
file format.
In [5]: gdal.GetCacheMax()
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call
last)
/home/fasano/Desktop/test/<ipython console> in <module>()
RuntimeError: `./filename.wrongformat' not recognised as a supported
file format.
In [6]: gdal.ErrorReset()
In [7]: gdal.GetCacheMax()
Out[7]: 41943040
(My gdal version is 1.5.4)
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev