[Zope3-Users] testbrowser and file upload

Darryl Cousins darryl at darrylcousins.net.nz
Mon Jul 3 18:45:38 EDT 2006


Hi,

I have found a strange behaviour with testbrowser and file objects. What
appears to happen is that the cStringIO.StringIO that I pass to the file
control in a form is converted to unicode before reaching the view
handler. This then raises AttibuteError: Unicode has no read attribute.

I have attached created a test that demonstrates this behaviour and the
catches that I needed to add to my view handler (which is code from
schoolbell csv import). I've yet to see what needs to be done if it is
an image I am trying to upload.

The README from the test package is here:
http://tfws.org/tfws.tfwstests.README.html

The package code can be viewed here:
http://projects.treefernwebservices.co.nz/tfws.org.nz/browser/trunk/src/tfws/tfwstests/

Or the full test package can be obtained here:
http://www.tfws.org.nz/tfwstests.tgz

Best regards,
Darryl Cousins




More information about the Zope3-users mailing list