Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I was having tile generation problems with TileCache 2.11 and decided to update to the trunk. I repeated the instructions necessary to get TileCache working in IIS but now I'm seeing this error:

An error occurred: No section: 'cache'
  File "C:\inetpub\wwwroot\tilecache\TileCache\Configs\File.py", line 147, in read
    self.cache = self._loadFromSection(config, "cache", TileCache.Cache)
  File "C:\inetpub\wwwroot\tilecache\TileCache\Config.py", line 74, in _loadFromSection
    type  = config.get(section, "type")
  File "C:\Python25\lib\ConfigParser.py", line 511, in get
    raise NoSectionError(section)

I've made the necessary change to tilecache.py:

from TileCache import Service, cgiHandler, cfgfiles

if __name__ == '__main__':
    svc = Service.load("c:\\inetpub\\wwwroot\\tilecache\\tilecache.cfg")
    cgiHandler(svc)

And I've confirmed my configuration file exists and does contain a [cache] section:

[cache]
type=Disk
#base=c:\inetpub\wwwroot\tilecache\Cache
base=g:\tilecache\Cache

Using SysInternals ProcessMonitor I've determined that python.exe never attempts to access tilecache.cfg.

Renaming tilecache.cfg results in the same error. Why isn't it loading the file? Is the path incorrectly formed?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

It seems the solution is to put [brackets] around the path to the tilecache.cfg file:

So modify tilecache.py to look like this:

from TileCache import Service, cgiHandler, cfgfiles

if __name__ == '__main__':
    svc = Service.load(["d:\\code\\tilecache\\tilecache.cfg"])
    cgiHandler(svc)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.