Ticket #1627 (closed defect: duplicate)

Opened 2 years ago

Last modified 2 years ago

encode_utf8 visit/api.py error - 'list' object has no attribute 'encode'

Reported by: mosi Assigned to: anonymous
Priority: high Milestone: 1.0.4
Component: TurboGears Version: 1.0.4b3
Severity: critical Keywords: api.py visit identity bug error list attribute encode encode_utf8
Cc:

Description

Error in visit identity, this is what you get in TG ver. 1.0.4b3 File "/usr/lib/python2.5/site-packages/TurboGears-1.0.4b3-py2.5.egg/turbogears/visit/api.py", line 187, in encode_utf8

res[k] = v.encode('utf-8')

AttributeError?: 'list' object has no attribute 'encode'

I have no time and knowledge to change it, but it`s here> tg/visit/api.py :: Line 187

        def encode_utf8(params):
            '''
            will recursively encode to utf-8 all values in a dictionnary
            '''
            res = dict()
            for k, v in params.items():
                if type(v) is dict:
                    res[k] = encode_utf8(v)

                else:
                    res[k] = v.encode('utf-8')

            return res

Maybe except? or checking for more types ?

Change History

12/10/07 10:12:36 changed by Chris Arndt

  • status changed from new to closed.
  • resolution set to duplicate.

Duplicate for #1622