request encoding in five.formlib

Bug #751586 reported by samuel or tell me sam on 2011-04-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

hi all,

I use five.formlib with plone 4. i found that the request is transformed to unicode but never restored at the end of rendering a template. If some code depends on the request after rendering the formlib template it will break.

All in all this seems dangerous to me, is there another way to accomplish this?

Regards, sam
Raptus AG

the following hack works for me, but looks ugly:

--- src/five.formlib/src/five/formlib/ (revision 121284)
+++ src/five.formlib/src/five/formlib/ (working copy)
@@ -47,10 +47,15 @@
         # BBB: for CMFDefault < 2.3 (explicit charset required)
             'text/html; charset=%s' % HTTPRequest.default_encoding)
+ # only change a copy from form to unicode and restore it at the end.
+ old_request_form = self.request.form
+ self.request.form = self.request.form.copy()
         # BBB: for Zope < 2.14
         if not getattr(self.request, 'postProcessInputs', False):
             processInputs(self.request, [HTTPRequest.default_encoding])
         super(FiveFormlibMixin, self).update()
+ self.request.form = old_request_form

 class FormBase(FiveFormlibMixin, form.FormBase):

Colin Watson (cjwatson) wrote :

The five.formlib project on Launchpad has been archived at the request of the Zope developers (see and If this bug is still relevant, please refile it at

Changed in five.formlib:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers