I am trying to use the Python csv module to import a csv file into zope and then write the result to a RDBMS. The csv module requires an iterable file but the fileupload instance returned by: file=REQUEST.form("filename") Does not seem to be iterable. Is there a way to make it so? regards garry
* garry saddington <garry@joydiv.fsnet.co.uk> [2004-08-08 15:42]:
I am trying to use the Python csv module to import a csv file into zope and then write the result to a RDBMS. The csv module requires an iterable file but the fileupload instance returned by:
file=REQUEST.form("filename")
Does not seem to be iterable. Is there a way to make it so?
Mmm, I think you should log an issue in the collector that FileUpload instances should be iterable. In the mean time type you can convert it to StringIO instance: file=REQUEST.form("filename") from cStringIO import StringIO iterable = StringIO(file.read()) -- Roché Compaan Upfront Systems http://www.upfrontsystems.co.za
participants (2)
-
garry saddington -
Roché Compaan