cubicweb #12022688 Crash in pyramid_cubicweb after a validation error due to file in session data [open]

CubicWebPublisher.validation_error_handler puts the complete web form in the session data. In particular, in my case, a posted file. This makes pyramid_cubicweb crash when trying to serialize the session data, as follows:

2016-04-02 15:17:34 - (pyramid_cubicweb.session) ERROR: Error in _set_cookie
Traceback (most recent call last):
File "/home/florent/cw/pyramid-cubicweb/pyramid_cubicweb/session.py", line 17, in newfn
return fn(*args, **kw)
File "/home/florent/cw/pyramid-cubicweb/pyramid_cubicweb/session.py", line 116, in _set_cookie
data = Binary(pickle.dumps(dict(self)))
File "/usr/lib/python2.7/copy_reg.py", line 70, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle file objects
/home/florent/cw/cubes/nemo/views/controllers.py changed; reloading...

As a workaround, I remove the file from the web form, before the validation error is handled by the CubicWebPublisher.

prioritynormal
typebug
done in<not specified>
closed by<not specified>