Browse code

error handling when opening a file; opening fails when the file is a broken symlink

Bernd Wurst authored on23/09/2012 18:01:20
Showing1 changed files
... ...
@@ -143,7 +143,10 @@ for fdir in args:
143 143
             for item in vdb:
144 144
                 if filename == item['file']:
145 145
                     mfile = os.path.join(root, filename)
146
-                    file = open(mfile)
146
+                    try:
147
+                      file = open(mfile)
148
+                    except:
149
+                      continue
147 150
                     filestr = file.read()
148 151
                     file.close()
149 152