[Zope] Inconsistant behavior (long)

David Mackay mackay_d@bellsouth.net
Thu, 11 Apr 2002 06:26:59 -0500


> I had this kind of error yesterday. The problem is, that
> the class Image stores the data in data chunks OR in a string.
> 
> Have a look at OFS/Image.py.
> 
> 
> I extract the information of a file like this:
>                 fd=open(tmp_file, "wb")
>                 #Stolen from DocumentLibrary.Document.py
>                 if type(file.data) is type(''):
>                     print "file.data is string"
>                     fd.write(file.data)
>                 else:
>                     print "file.data are linked pdata objects"
>                     data=file.data
>                     pos = 0
>                     while data is not None:
>                         fd.write(data.data)
>                         data = data.next
>                 fd.close()

Thank you.  That was indeed the problem.

Dave