[Tilecache] [(protected) tilecache/mod_python bug?]

Christopher Schmidt crschmidt at metacarta.com
Fri Apr 4 16:47:38 EDT 2008


To: tilecache-owner at openlayers.org
Date: Fri, 4 Apr 2008 13:15:44 -0700 (PDT)
Subject: tilecache/mod_python bug?

Hi,

I am running TileCache using mod_python:

Fedora Core 4
Apache 2.0.54
mod_python 3.1
python 2.4.3

mod_python config is:

AddHandler python-program .py
PythonPath "sys.path + ['/home/kw/www5/tilecache/TileCache']"
PythonOption TileCacheConfig /home/kw/www5/tilecache/tilecache.cfg
PythonHandler Service
PythonDebug On

I have gotten things working, but I had to hack the Service.py file to
get things to work.

Service.py: line 177 code reads:
        if isinstance(tile, Layer.Tile):
            if req_method == 'DELETE':
                self.expireTile(tile)
                return ('text/plain', 'OK')
            else:
                return self.renderTile(tile, params.has_key('FORCE'))
        else:
            return (tile.format, tile.data)

The "isinstance(tile, Layer.Tile)" was failing to return true, when
tile was in fact the right type.  My work around is to comment out
the "isinstance" test and everything works fine.

I believe this sounds like the problem with isinstance I found
referenced here:
http://mail.python.org/pipermail/python-bugs-list/2005-August/029861.html

And in fact if I add the following code...

at Layer.py, line 7:

from Service import TileCacheException
df = open ("/home/kw/www5/tilecache/layer.debug","a+")
df.write (__name__ + "\n")
df.close();

... I see that the Layer module is loaded twice, once __name__ is
'Layer' and once it is 'TileCache.Layer', thus the "isinstance" check
fails.

I should also note that using tilecache.cgi instead of the mod_python
interface, things worked just fine without this work around.

I don't know anything about python -- I learned just enough to put in
some debugging output, so I don't understand enough to do a real "fix".

And I suppose it is possible that I have simply not configured things
correctly?

Thanks,
Anne-Leslie Dean




      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

----- End forwarded message -----

-- 
Christopher Schmidt
MetaCarta



More information about the Tilecache mailing list