cjson 1.0.5 keyword argument

Clodoaldo clodoaldo.pinto at gmail.com
Sun Sep 14 16:50:16 CEST 2008


On Sep 14, 11:45 am, "Guilherme Polo" <ggp... at gmail.com> wrote:
> On Sun, Sep 14, 2008 at 10:33 AM, Clodoaldo <clodoaldo.pi... at gmail.com> wrote:
> > I have installed cjson 1.05 in Fedora 8 (python 2.5.1).
>
> > The cjson home page shows a keyword argument "encoding".
> >http://python.cx.hu/python-cjson/
>
> The latest python-cjson on that page is 1.0.3, which accepts keywords
> for the encode function. python-cjson 1.0.5 no longer accepts.
>
> > When i use it i get an error:
>
> >>>> cjson.encode('é', encoding='utf8')
> > Traceback (most recent call last):
> >  File "<stdin>", line 1, in <module>
> > TypeError: encode() takes no keyword arguments
>
> > What am i missing? There is no mail list for cjson.
>
> Try doing cjson.encode('é'.decode('utf-8')) instead.

I had tried decoding first and it worked but my database is utf-8 so i
don't want that extra step.

BTW i have already found the problem as the other post shows.

Thanks, Clodoaldo




More information about the Python-list mailing list