[Mapserver-users] python mapscript

Michael Schulz mschulz at webgis.de
Thu Jul 3 03:39:24 EDT 2003


Hi Sean,

thanks for your help. I tried your new pymodule.i and i can catch the error
in the python shell, but if i try it in combination with zope-zmapserver it
is not working. The zope process still gets killed. I thought along the same
lines as you yesterday and changed pymodule.i according to your second
suggestion:

-- snip line 186

        // Sidestep the annoying MS_IOERR raised by msSearchDiskTree()
        // in maptree.c when a layer's shapetree index can't be found
        if ((ms_error->code != MS_NOERR) && (ms_error->code != -1)
        && !((ms_error->code == MS_IOERR) && (strcmp(ms_error->routine,
"msSearchDiskTree()") == 0))
        && !((ms_error->code == MS_NOTFOUND) && (strcmp(ms_error->routine,
"msQueryByPoint()") == 0)))

This works, the error is not raised when no records are found and thus zope
no longer gets killed. Although i don't understand why i can't catch this
error e.g. with a try except block?

Cheers, Michael



Sean Gillies schrieb:

> Michael,
>
> I think this is probably an issue with MapServer's C library.
> Am looking into it now to see what happens in msQueryByPoint.
> I agree that msQueryByPoint should not raise an error in the
> case of no records found by an otherwise proper query.
>
> Another thing we could do is to evade the error in MapScript's
> error handler like we are doing with the error that is raised
> when no shapefile tileindex is present.  Maybe this is the
> best way for now, and push to change msQuery* behavior for
> MapServer 4.1.
>
> cheers,
> Sean
>
> On Wednesday, July 2, 2003, at 09:14  AM, Michael Schulz wrote:
>
> > Hi,
> >
> > i have a question concerning the new error handling code in python
> > mapscript. While it is very good that mapscript now throws real
> > meaningful exceptions for a lot of errors, it is somewhat annyoing that
> > e.g. queryByPoint also gives an error when no records where found. What
> > would be the correct way to change this behaviour?
> > A bit more background information why this behaviour is annoying me
> > (for
> > those using python mapscript in the zmapserver environment): i am
> > working on implementing query mechanisms in zmapserver, and in the
> > combination zope-zmapserver-python/mapscript it seems, that i am not
> > able to catch this exception correctly. Even worse, the zope process
> > gets killed (although an error should be raised, the zope process
> > segfaults). Well, as you might assume this is not the intended
> > behaviour. Hmm, any ideas, where to start looking?
> >
> > TIA, Michael
> >
> --
> Sean Gillies
> sgillies at frii dot com
> http://www.frii.com/~sgillies
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

--
-----------------------------------------------------------
Michael Schulz                                in medias res
Dipl.-Geologe                              Gesellschaft für
                                Informationstechnologie mbH
                             Sautierstr. 38, 79104 Freiburg
                                     0761 55695-95 (Fax 96)
mschulz at webgis.de                             www.webgis.de





More information about the mapserver-users mailing list