[Zope-dev] Re: Re: [Checkins] SVN: Zope/branches/2.10/ OFS Image: Image and File now both support simple unicode objects for data (they function the same as strings for data).

Rocky Burt rocky at serverzen.com
Wed Jun 28 08:06:56 EDT 2006


On Wed, 2006-28-06 at 14:01 +0200, Andreas Jung wrote:
> 
> --On 28. Juni 2006 13:56:58 +0200 Florent Guillaume <fg at nuxeo.com> wrote:
> 
> > Has this change been discussed?
> > I don't agree with it. Unicode strings aren't byte strings. File and
> > Image should only work with byte strings.
> > Code dealing with them should always know and assume that they use  str.
> > Anything using unicode with them is broken or has done  insufficient
> > input validation.
> 
> I agree. This checkin must be reverted. In fact one raise a ValueError in 
> case the data is a unicode string.

Alrighty, reverting change.  Sorry about the confusion.  The more I
think about this the more I agree.

I'll still change the logic to do isinstance(data, str) rather than
type('') == type(data) and I'll also add the explicit check for unicode
and raise a ValueError if found, does this all sound ok?

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20060628/750bb0c1/attachment.bin


More information about the Zope-Dev mailing list