changeset 76:1892ac35e9c8

???
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 15 Apr 2013 23:30:39 -0700
parents 7db9d9b82a06
children ebf3d3c39cb7
files decoupage/web.py
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/decoupage/web.py	Sun Dec 30 19:59:27 2012 -0800
+++ b/decoupage/web.py	Mon Apr 15 23:30:39 2013 -0700
@@ -243,7 +243,21 @@
             filetype = 'file'
             if os.path.isdir(filepath):
                 filetype = 'directory'
-            modified = os.path.getmtime(filepath)
+            try:
+                modified = os.path.getmtime(filepath)
+            except OSError:
+                # the file (mysteriously) may not exist by this time(!)
+                #  File "/home/jhammel/web/src/decoupage/decoupage/web.py", line 114, in __call__
+                #    res = self.get(request)
+                #  File "/home/jhammel/web/src/decoupage/decoupage/web.py", line 162, in get
+                #    files = self.filedata(path, directory, conf)
+                #  File "/home/jhammel/web/src/decoupage/decoupage/web.py", line 246, in filedata
+                #    modified = os.path.getmtime(filepath)
+                #  File "/home/jhammel/web/lib/python2.6/genericpath.py", line 54, in getmtime
+                #    return os.stat(filename).st_mtime
+                # OSError: [Errno 2] No such file or directory: '/home/jhammel/web/site/portfolio/ideas/.#index.ini'
+                continue # wt{h,f}???
+
             modified = datetime.fromtimestamp(modified)
             data = {'path' : '%s/%s' % (path.rstrip('/'), i),
                     'name': i,