web/formfields.py
branchstable
changeset 5497 96fd339f7917
parent 5426 0d4853a6e5ee
child 5557 1a534c596bff
child 5661 84ef08bbda3c
equal deleted inserted replaced
5496:d1b6db4d7b3f 5497:96fd339f7917
   722         except KeyError:
   722         except KeyError:
   723             # raise UnmodifiedField instead of returning None, since the later
   723             # raise UnmodifiedField instead of returning None, since the later
   724             # will try to remove already attached file if any
   724             # will try to remove already attached file if any
   725             raise UnmodifiedField()
   725             raise UnmodifiedField()
   726         # value is a 2-uple (filename, stream)
   726         # value is a 2-uple (filename, stream)
   727         filename, stream = value
   727         try:
       
   728             filename, stream = value
       
   729         except ValueError:
       
   730             raise UnmodifiedField()
   728         # XXX avoid in memory loading of posted files. Requires Binary handling changes...
   731         # XXX avoid in memory loading of posted files. Requires Binary handling changes...
   729         value = Binary(stream.read())
   732         value = Binary(stream.read())
   730         if not value.getvalue(): # usually an unexistant file
   733         if not value.getvalue(): # usually an unexistant file
   731             value = None
   734             value = None
   732         else:
   735         else: