[Zope] lis index out of range on an PythonEM call ????

Dieter Maurer dieter@handshake.de
Tue, 6 Nov 2001 23:22:58 +0100


Doyon, Jean-Francois writes:
 > I have an external method that I call using:
 > 
 > <dtml-with expr="getmap('177')" mapping>
 > 
 > And all works fine ...
 > 
 > But if I change that value 177 to 30516 I get :
 > 
 > Error Type: IndexError
 > Error Value: list index out of range
 > 
 > I faily to understand why ... The value is actually passed as a string,
 > which is what i want ... in the PythonEM, all that's done is a string
 > concatenation:
 > 
 > def getmap(id):
 > 	mapserver =
 > urlopen("http://www-gad2.ccrs.nrcan.gc.ca/cgi-bin/mapserv?map=/home/mapdata/
 > nac/"+id+".map&template=to_zope.html")
 > 	<more code>
 > 
 > Anybody  know why this is happening and how to get around it?
You should get a traceback. It should tell you in which line
the exception is raised.

Maybe "urlopen" has a bug and can only work with "short" URLs?
Look at the trackback to find out.


Dieter