Tim Hicks(e)k dio:
> Mikel Larreategi wrote:
>> Tim Hicks(e)k dio:
>>> Tim Knapp wrote:
>>>
>>>> I'll take your word for it on the getTopics change but in principle it
>>>> sounds fine.
>>> It might be worth double checking that.  Presumably the normalize
>>> method/function expects something string-ish.  ITopic objects have a
>>> __str__ method, but I don't know if that's (necessarily always) enough...
>>>
>>>
>> I also can reproduce this error. But I don't think that the proposed 
>> getTopics method is the solution.
>>
>> getTopics returns, in that context, all topics of the blog, so I just 
>> propose to add a to-unicode conversion there, as follows:
>>
>> [EMAIL PROTECTED]:/var/zope/instances/codesyntax/src/quills.app/quills/app$ 
>> svn diff topic.py
>> Index: topic.py
>> ===================================================================
>> --- topic.py (revision 74088)
>> +++ topic.py (working copy)
>> @@ -90,7 +90,7 @@
>>           if topic_images is None:
>>               return None
>>           normalizer = getUtility(IIDNormalizer)
>> -        keyword_id = normalizer.normalize(self.keywords[0])
>> +        keyword_id = normalizer.normalize(self.keywords[0].decode('utf-8'))
>>           # To check for the presence of the image, we want to limit 
>> ourselves to
>>           # unacquired objects, so we use aq_base.
>>           image = getattr(aq_base(topic_images), keyword_id, None)
> 
> That patch makes me more comfortable than the getTopics one.  Assuming 
> the .decode(...) call won't sometimes fail, then it looks good.  (I'm 
> always wary of string encoding stuff because I've seen it throw 
> incomprehensible-to-me errors before.)

I have added a test to fixedBugs with the non-ascii keyword, and can 
reproduce the error, after that I tried with the patch above, and the 
test passes fine.

I've commited the fix:

http://dev.plone.org/collective/changeset/74930

http://dev.plone.org/collective/changeset/74931


Mikel



-- 
Mikel Larreategi
[EMAIL PROTECTED]

CodeSyntax
Azitaingo Industrialdea 3 K
E-20600 Eibar
Tel: (+34) 943 82 17 80

_______________________________________________
quills-dev mailing list
[email protected]
http://lists.etria.com/cgi-bin/mailman/listinfo/quills-dev

Reply via email to