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@nuxeo.com