[Tilecache] make dir error

Stefan Zweig stefanzweig1881 at web.de
Thu Apr 10 11:52:16 EDT 2008


Hi,

i just tried the path from svn. (17:45 / 11:45 your time).

but then i got this error.

An error occurred: [Errno 2] No such file or directory: '/var/gisapp/_apps/tilecache/tiles/56559/00/000/000/002/-01/999/999.png.11555.tmp' 
File "/var/www/tilecache/TileCache/Service.py", 
line 264, in cgiHandler File "/var/www/tilecache/TileCache/Service.py", 
line 182, in dispatchRequest File "/var/www/tilecache/TileCache/Service.py", 
line 120, in renderTile File "/var/gisapp/_apps/tilecache/TileCache/Caches/Disk.py", line 78, in set output = file(tmpfile, "wb") 

any advices?

stefan

> -----Ursprüngliche Nachricht-----
> Von: "Christopher Schmidt" <crschmidt at metacarta.com>
> Gesendet: 10.04.08 17:48:10
> An: Fredrik Lundh <fredrik at pythonware.com>
> CC: tilecache at openlayers.org
> Betreff: Re: [Tilecache] make dir error


> 
> On Thu, Apr 10, 2008 at 05:32:33PM +0200, Fredrik Lundh wrote:
> > >  Agreed. I keep thinking I've already done this, but never get around to
> > >  it. I'll take a patch...
> > 
> > The patch below should work, I think (only briefly tested).
> > 
> > </F>
> 
> My concern with this path is that TileCache makes pretty deep
> directories: imagining that you have:
>  os.makedirs(
>    /0/0/0/0/0/0/
>  )
> 
> and:
>  
>  os.makedirs(
>    /0/0/0/0/0/1/
>  )
> 
> And they both get called at the same time, you could get a condition
> where:
> 
>   1: /0 is created
>   2: tries to make /0, bails
>   1. Successfully makes /0/0/0/0/0/0 whatever
>   2. Has no /1 directory, writing file fails
> 
> Am I wrong here, or is this a possibility? If it is a possibility, is it
> worth trying to fix? Should the exception handler catch the exception,
> and try again?
> 
> -- Chris
> 
> > --- Disk.py.bak Thu Apr 10 17:27:09 2008
> > +++ Disk.py     Thu Apr 10 17:20:35 2008
> > @@ -1,7 +1,7 @@
> >  # BSD Licensed, Copyright (c) 2006-2007 MetaCarta, Inc.
> > 
> >  from TileCache.Cache import Cache
> > -import sys, os, time
> > +import sys, os, time, errno
> > 
> >  class Disk (Cache):
> >     def __init__ (self, base = None, umask = '002', **kwargs):
> > @@ -21,7 +21,11 @@
> > 
> >     def makedirs(self, path):
> >         old_umask = os.umask(self.umask)
> > -        os.makedirs(path)
> > +        try:
> > +            os.makedirs(path)
> > +        except OSError, e:
> > +            if e.errno != errno.EEXIST:
> > +                raise
> >         os.umask(old_umask)
> > 
> >     def access(self, path, type='read'):
> > _______________________________________________
> > Tilecache mailing list
> > Tilecache at openlayers.org
> > http://openlayers.org/mailman/listinfo/tilecache
> 
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Tilecache mailing list
> Tilecache at openlayers.org
> http://openlayers.org/mailman/listinfo/tilecache
> 


__________________________________________________
GRATIS: Movie-FLAT. Jetzt freischalten!
http://freemail.web.de/club/maxdome.htm/?mc=025557




More information about the Tilecache mailing list