[bfss] Catch EnvironmentError instead of OSError when trying to read attributes bffstored stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 09 Jun 2011 12:20:57 +0200
branchstable
changeset 7477 3d64867f1019
parent 7475 a70456bbb4bd
child 7480 97a1768bbbaa
[bfss] Catch EnvironmentError instead of OSError when trying to read attributes bffstored This will also catch IOError (as file not found) that might be encountered expectable too.
server/sources/storages.py
--- a/server/sources/storages.py	Thu Jun 09 10:36:28 2011 +0200
+++ b/server/sources/storages.py	Thu Jun 09 12:20:57 2011 +0200
@@ -122,7 +122,7 @@
         fpath = source.binary_to_str(value)
         try:
             return Binary(file(fpath, 'rb').read())
-        except OSError, ex:
+        except EnvironmentError, ex:
             source.critical("can't open %s: %s", value, ex)
             return None