[Zope3-dev] Important IFile bug!

Jim Fulton jim at zope.com
Fri Jan 14 09:51:14 EST 2005


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

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list