server/sources/storages.py
changeset 7481 23ae090fc6a4
parent 7454 1090724f28ed
parent 7477 3d64867f1019
child 7695 2f6e37661cf6
equal deleted inserted replaced
7479:b0603fc4ed6d 7481:23ae090fc6a4
   120         accessed
   120         accessed
   121         """
   121         """
   122         fpath = source.binary_to_str(value)
   122         fpath = source.binary_to_str(value)
   123         try:
   123         try:
   124             return Binary(file(fpath, 'rb').read())
   124             return Binary(file(fpath, 'rb').read())
   125         except OSError, ex:
   125         except EnvironmentError, ex:
   126             source.critical("can't open %s: %s", value, ex)
   126             source.critical("can't open %s: %s", value, ex)
   127             return None
   127             return None
   128 
   128 
   129     def entity_added(self, entity, attr):
   129     def entity_added(self, entity, attr):
   130         """an entity using this storage for attr has been added"""
   130         """an entity using this storage for attr has been added"""