[OpenLayers-Users] Problems setting up TileCache

Christopher Schmidt crschmidt at metacarta.com
Wed Nov 22 14:05:28 EST 2006


On Wed, Nov 22, 2006 at 08:56:29AM -0800, Ben Brehmer wrote:
> Christopher Schmidt wrote:
> >We're using Python2.4 for our TileCache workings, but I know that people
> >have got it running under 2.3 -- this error is definitely something you
> >wouldn't see under Python2.4, but I don't know if that would fix your
> >problem. 
> >
> >I've just downloaded a clean TileCache 1.1, and edited tilecache.cgi to
> >use Python2.3, and I'm not getting this error, unfortunately. If you
> >could give any more information as to where in the code this error is
> >happening, I'd appreciate it, and will investigate as best I can.
> >
> >Regards,
> >  
> Hi Christopher,
> 
> This is the complete error log:
> 
> [Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1] Traceback (most 
> recent call last):
> [Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]   File 
> "/home/httpd/cf2/cgi-bin/tilecache-1.1/tilecache.cgi", line 6, in ?
> [Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]     svc = 
> Service.load(*cfgfiles)
> [Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]   File 
> "/home/httpd/cf2/cgi-bin/tilecache-1.1/TileCache/Service.py", line 249, 
> in _load
> [Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]     cache = 
> cls.loadFromSection(config, "cache", Cache)
> [Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]   File 
> "/home/httpd/cf2/cgi-bin/tilecache-1.1/TileCache/Service.py", line 232, 
> in _loadFromSection
> [Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1]     if opt not 
> in ("type"):
> [Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1] TypeError: 'in 
> <string>' requires character as left operand
> [Wed Nov 22 08:48:23 2006] [error] [client 192.168.50.1] Premature end 
> of script headers: tilecache.cgi
> 
> 
> I definitely agree with you that this is a problem in ConfigParser, 
> although this may be related to me using Python 2.2.3. I am going to 
> install Python 2.4 this morning. I"ll let you know if that was the cause 
> of my problems.

Ah, 2.2 is not supported -- I don't have it available on the machine I"m 
using, or on the server :) 

However, it does explain why you got this message: Python2.2 doesn't
support the construct:
'string' in ("type")

A single element tuple is converted immediately to a string. (Python2.3
and python 2.4 apparently don't do this.)

To test whether it works with 2.2, you can change ("type") to ['type']
on line 232 of TileCache/Service.py: in a quick test on my local copy of
TileCache, this works, but we have thus far not put any effort into
maintaining compatibility with 2.2, only 2.3 and up.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list