changeset 4989:f4d61ac84b76 dami

If we bother to check if the file is readable we might also bother to check if it's a file at all. Thanks to teichmann for noticing
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 14 Feb 2013 10:54:02 +0100
parents b5ac7588cf4d
children b79eb203032d
files flys-backend/contrib/shpimporter/shpimporter.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/contrib/shpimporter/shpimporter.py	Wed Feb 13 19:11:34 2013 +0100
+++ b/flys-backend/contrib/shpimporter/shpimporter.py	Thu Feb 14 10:54:02 2013 +0100
@@ -231,7 +231,8 @@
         if not config.skip_dgm:
             dgmfilename = os.path.join(
                     config.directory, "..", "DGMs.csv")
-            if not os.access(dgmfilename, os.R_OK):
+            if not os.access(dgmfilename, os.R_OK) or not \
+                    os.path.isfile(dgmfilename):
                 INFO("Could not find or access DGM file: %s \n"
                      "Skipping DGM import." % dgmfilename)
             else:

http://dive4elements.wald.intevation.org