[ckan-dev] FYI: avoiding one unicode issue

Toby Dacre toby.okfn at gmail.com
Tue Aug 21 09:20:41 UTC 2012


I've just greped the code and we have several places in the code stuff like

log.debug('Updated object %s' % str(pkg.name))

These break if unicode is used.  as %s converts to string format str() is
unneeded

log.debug('Updated object %s' % pkg.name)  works without throwing an
exception if unicode is present

This was an issue for Océane the other day I fixed that one place but it
seems we have it elsewhere

grep -rI \%s..*str\(| wc -l  gives 78 instances - on the 2375 branch is
fixing these something we could give to someone new to the project as a
piece of work? or is that being mean?

also should we try to do all our strings a u'...'

Toby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120821/4272f6ec/attachment.html>


More information about the ckan-dev mailing list