web/formwidgets.py
changeset 4550 d74098d1b69f
parent 4508 b329af3315b6
child 4583 356f08325072
--- a/web/formwidgets.py	Wed Feb 10 14:31:22 2010 +0100
+++ b/web/formwidgets.py	Wed Feb 10 16:32:32 2010 +0100
@@ -722,11 +722,14 @@
                 value = req.form[field.name]
             else:
                 value = self.typed_value(form, field)
-            try:
-                path, qs = value.split('?', 1)
-            except ValueError:
-                path = value
-                qs = ''
+            if value:
+                try:
+                    path, qs = value.split('?', 1)
+                except ValueError:
+                    path = value
+                    qs = ''
+            else:
+                path = qs = ''
             fqs = u'\n'.join(u'%s=%s' % (k, v) for k, v in req.url_parse_qsl(qs))
         attrs = dict(self.attrs)
         if self.setdomid: