Comment 1 for bug 557333

Revision history for this message
LKRaider (paul-eipper) wrote :

I have a similar issue, but no validation is required, just a simple form with one File field:

plugin_form = web.form.Form(
        web.form.File('plugin_file', web.form.notnull),
)

upon uploading a file from this form, this is the error:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/web/application.py", line 209, in process
    return p(lambda: process(processors))
  File "/usr/lib/pymodules/python2.6/web/application.py", line 537, in processor
    return handler()
  File "/usr/lib/pymodules/python2.6/web/application.py", line 209, in <lambda>
    return p(lambda: process(processors))
  File "/usr/lib/pymodules/python2.6/web/application.py", line 216, in process
    raise self.internalerror()
  File "/usr/lib/pymodules/python2.6/web/application.py", line 449, in internalerror
    return debugerror.debugerror()
  File "/usr/lib/pymodules/python2.6/web/debugerror.py", line 299, in debugerror
    return web._InternalError(djangoerror())
  File "/usr/lib/pymodules/python2.6/web/debugerror.py", line 289, in djangoerror
    return t(exception_type, exception_value, frames)
  File "/usr/lib/pymodules/python2.6/web/template.py", line 850, in __call__
    return BaseTemplate.__call__(self, *a, **kw)
  File "/usr/lib/pymodules/python2.6/web/template.py", line 768, in __call__
    return self._join_output(out)
  File "/usr/lib/pymodules/python2.6/web/template.py", line 774, in _join_output
    for name, value in out:
  File "/usr/lib/pymodules/python2.6/web/debugerror.pyc", line 183, in __template__
    $if ctx.output or ctx.headers:
  File "/usr/lib/pymodules/python2.6/web/webapi.py", line 222, in input
    return storify(out, *requireds, **defaults)
  File "/usr/lib/pymodules/python2.6/web/utils.py", line 141, in storify
    value = getvalue(value)
  File "/usr/lib/pymodules/python2.6/web/utils.py", line 128, in getvalue
    return unicodify(x.value)
  File "/usr/lib/pymodules/python2.6/web/utils.py", line 123, in unicodify
    if _unicode and isinstance(s, str): return safeunicode(s)
  File "/usr/lib/pymodules/python2.6/web/utils.py", line 231, in safeunicode
    return obj.decode(encoding)
  File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 12-13: invalid data

I don't know what it is trying to decode, the uploaded binary data maybe?