[Zope-dev] 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).

Florent Guillaume fg at nuxeo.com
Wed Jun 28 08:55:41 EDT 2006


Rocky Burt wrote:
> On Wed, 2006-28-06 at 14:01 +0200, Andreas Jung 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?

Excellent, thanks.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope-Dev mailing list