web/formfields.py
changeset 5508 6718ba5db0eb
parent 5497 96fd339f7917
child 5557 1a534c596bff
child 5661 84ef08bbda3c
equal deleted inserted replaced
5493:c323ff08ad35 5508:6718ba5db0eb
   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: