[ckan-dev] FYI: avoiding one unicode issue
Toby Dacre
toby.okfn at gmail.com
Tue Aug 21 09:58:46 UTC 2012
On 21 August 2012 10:29, David Raznick <david.raznick at okfn.org> wrote:
> Hello
>
> Added to that if you are using
> 'hello, {name}'.format(name='wođðßæd')
> this may not work.
>
> You need to be adding the u, i.e
> u'hello, {name}'.format(name='wođðßæd')
>
> There have been some errors caused by this.
>
> there only seemed to be a few so I fixed them here please merge
https://github.com/okfn/ckan/pull/112
> Thanks
>
> David
>
> On Tue, Aug 21, 2012 at 10:20 AM, Toby Dacre <toby.okfn at gmail.com> wrote:
> > 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
> >
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > http://lists.okfn.org/mailman/listinfo/ckan-dev
> >
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120821/9053eb28/attachment-0001.html>
More information about the ckan-dev
mailing list