web/formfields.py
branchstable
changeset 5497 96fd339f7917
parent 5426 0d4853a6e5ee
child 5557 1a534c596bff
child 5661 84ef08bbda3c
--- a/web/formfields.py	Thu May 06 14:48:44 2010 +0200
+++ b/web/formfields.py	Thu May 06 16:23:39 2010 +0000
@@ -724,7 +724,10 @@
             # will try to remove already attached file if any
             raise UnmodifiedField()
         # value is a 2-uple (filename, stream)
-        filename, stream = value
+        try:
+            filename, stream = value
+        except ValueError:
+            raise UnmodifiedField()
         # XXX avoid in memory loading of posted files. Requires Binary handling changes...
         value = Binary(stream.read())
         if not value.getvalue(): # usually an unexistant file