[Zope] Problem working around string.split issue

complaw@hal-pc.org complaw@hal-pc.org
Mon, 31 Dec 2001 18:06:56 GMT


I have a python script that works just fine in Zope for SMALL input files
(between 1-100 cases).  However, Zope returns an error when the input file gets
large (100+ cases, depending on the situation).  In the error message, Zope
points to a line where I take the input file and split it to create a list of
lines.  Note, the same script (with split) works just fine when I run the script
in regular python (i.e., outside of Zope).

To get around this, I would normally just read the file one line at a time,
however, we don't have access to the sys module in Zope.  I have loaded the
input file into a File Object in Zope, and can access it via...

theData = context.myFile.data

The problem that I have is that when you do a split on theData, Zope returns the
split error (IF myFile is large enough).

The question I have is, how can I read small chunks of content from the File
Object?  This is akin to reading a text file one line at a time.  

Any hints?

Ron