[Zope3-dev] Important IFile bug!

Roger Ineichen dev at projekt01.ch
Fri Jan 14 11:12:10 EST 2005


> -----Original Message-----
> Behalf Of Jim Fulton
> Sent: Friday, January 14, 2005 3:51 PM
> To: dev at projekt01.ch
> Cc: zope3-dev at zope.org
> Subject: Re: [Zope3-dev] Important IFile bug!
> 
> Roger Ineichen wrote:
> > Hi together
> > 
> > There is a bug in the implementation of IFile.
> > 
> > The interfaces of IFile's field data is declared 
> > as a "Bytes" field.
> > 
> > Bytes is of the type str.
> > 
> > If we have large datawe store FileChunk objects
> > on data fields.
> > 
> > This is working because we don't use the form
> > framework correct for handle files and the data 
> > field never get validated.
> > 
> > What should we change?
> > 
> > Should Bytes fields also allow to validate
> > FileChunk objects?
> 
> This is a can of worms.  This really shouldn't be a
> bytes field. IMO, it should be a mime-part (or some such)
> field, since additional data, which should be part of the
> field, like mime type and encoding (for text types) should
> be an integral part of the field.
> 
> Aside from the above, the exposed attribute could be bytes
> even if an internal implementation used chunks.
> 
> If someone is *really* interested in working on this, I'd
> be happy to provide advice.
> 
> Jim

Ok, what can I do?

Should I implement a IData field and enhance this field?

The validate method of this field should allowes to store 
String and FileChunk? Others?

Is there a python lib for reading files and find the 
content type like stefan was implementing for images?

Regards
Roger Ineichen

Projekt01 GmbH
www.projekt01.ch
_____________________________
END OF MESSAGE  



More information about the Zope3-dev mailing list