[foaf] we should encode email addr: even if we know it should be ascii, nothing prevent from putting something else in (tests at least do it)
--- a/web/views/cwuser.py Fri Sep 24 18:20:45 2010 +0200
+++ b/web/views/cwuser.py Fri Sep 24 18:20:57 2010 +0200
@@ -85,7 +85,8 @@
% xml_escape(entity.firstname))
emailaddr = entity.cw_adapt_to('IEmailable').get_email()
if emailaddr:
- self.w(u'<foaf:mbox_sha1sum>%s</foaf:mbox_sha1sum>\n' % hashlib.sha1(emailaddr).hexdigest())
+ self.w(u'<foaf:mbox_sha1sum>%s</foaf:mbox_sha1sum>\n'
+ % hashlib.sha1(emailaddr.encode('utf-8')).hexdigest())
self.w(u'</foaf:Person>\n')