On Nov 18, 10:58 am, Thomas Wittek <[EMAIL PROTECTED]> wrote:
> On Nov 16, 10:38 am, Adi <[EMAIL PROTECTED]> wrote:
>
> > Here's where I have put the 2 extra lines: at the end of the method:
>
> Oh, great. Seems to work for me!
> Thank you very much.
>
> I added your patch to the ticket system.
> Maybe someone can investigate and integrate it.

Doesn't work with nested request params (i.e. foo.bar.baz) as they get
converted into nested dicts, so the value `v` may be a `dict` that
doesn't have a method named `encode`: AttributeError: 'dict' object
has no attribute 'encode'.

To fix your fix, you have to do do a recursive conversion:

        def encode_utf8(params):
            for k, v in params.items():
                if type(v) is dict:
                    encode_utf8(v)
                else:
                    params[k] = v.encode('utf-8')

        encode_utf8(cherrypy.request.params)

Funnily, you'll then get an error from CP:

  File "c:\programme\python25\lib\site-packages\cherrypy-2.2.1-
py2.5.egg\cherrypy\filters\decodingfilter.py", line 50, in decode
    decodedParams[key] = value.decode(enc)
AttributeError: 'dict' object has no attribute 'decode'

But I've got a feeling that the real problems are located in another
place, deeper in the system. But unfortunately I don't know much about
TG's/CP's internals.
Maybe this is ultimately a bug in CP. But I really don't know.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to