[Mapserver-users] TypeError-Problem with Python Mapscript

Sean Gillies sgillies at frii.com
Thu Nov 20 12:43:44 EST 2003


Bjoern,

I think you said you are using MapServer 3.6?  You should consider
upgrading to 4.0.1.  MapServer now will raise Python exceptions.

Here's an example of trying to create a mapObj from an improper map  
file:

Python 2.3 (#6, Sep 14 2003, 15:46:16)
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> from mapscript import *
 >>> mapobj = mapObj('or.map')
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File  
"/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- 
packages/mapscript.py", line 1819, in __init__
     _swig_setattr(self, mapObj, 'this',  
apply(_mapscript.new_mapObj,args))
_mapscript.MapServerError: loadLayer(): General error message. Layer  
type not set.
 >>>

It's explained it more detail here:

http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PythonMapScriptExceptions

cheers,
Sean

On Thursday, November 20, 2003, at 09:48  AM, Bjoern Platzen wrote:

> OK, I've got it...
>
> On the webserver a symbol image that was part of a symbol defined in my
> symbols.sym has gone lost...
> I found out by calling my mapfile with the mapserver-cgi wich generated
> an error message.
>
> Maybe it would be a good idea to throw an Exception in Mapscript as  
> well
> if something like this happens.
>
> Thanks to you, Sean and Michael!
>
> Bye,
>
> Bjoern
>
> Am Donnerstag, 20. November 2003 15:50 schrieb Bjoern Platzen:
>> Hi List,
>>
>> I just loaded my PyMapScript application onto the webserver.
>>
>> But now I get Errors, that I didn't get on my machine (They're both
>> SuSE Linux 8.0, Mapserver 3.6.5 & Mapscript compiled with the same
>> options).
>>
>> This is what I get on the shell:
>>>>> import mapscript
>>>>> mymap =
>>
>> mapscript.mapObj('/usr/local/httpd/htdocs/bauinfo/bauinfo.map')
>>
>>>>> mymap
>>
>> <C mapObj instance at None>
>>
>>>>> ip=mymap.web.imagepath
>>
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in ?
>> TypeError: Type error. Expected _p_mapObj
>>
>>>>> mymap.__dict__
>>
>> {'this': None, 'thisown': 1}
>>
>>>>> mymap.extent.minx
>>
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in ?
>> TypeError: Type error. Expected _p_mapObj
>>
>> It seems as if the mapObj() isn't built properly
>> -> <C mapObj instance at None>
>>                         ^^^^^^
>> I think there should be something like
>> -> <C mapObj instance at _08d0a240_p_mapObj>
>>                          ^^^^^^^^^^^^^^^^^^
>>
>> Has anyone an idea, of what could cause that the mapObj() isn't build
>> right?
>>
>> Any help would be great!
>>
>> Thanks,
>>
>> Bjoern.
>
> -- 
> small office solutions
> info at sosnetz.de  -  http://www.sosnetz.de
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>




More information about the mapserver-users mailing list