Edgewall Software

Opened 13 years ago

Last modified 13 years ago

#124 closed defect

Problem with replace() on unicode string — at Initial Version

Reported by: anonymous Owned by: cmlenz
Priority: major Milestone:
Component: Template processing Version: 0.4
Keywords: needinfo Cc:


I am using Genshi 0.4.1 with TurboGears and I'm getting problem with replace() on an unicode string :

Traceback (most recent call last):

File "/var/lib/python-support/python2.4/cherrypy/_cphttptools.py", line 105, in _run


File "/var/lib/python-support/python2.4/cherrypy/_cphttptools.py", line 254, in main

body = page_handler(*virtual_path, self.params)

File "<string>", line 3, in default File "/var/lib/python-support/python2.4/turbogears/controllers.py", line 334, in expose

output = database.run_with_transaction(

File "<string>", line 5, in run_with_transaction File "/var/lib/python-support/python2.4/turbogears/database.py", line 260, in so_rwt

retval = func(*args, kw)

File "<string>", line 5, in _expose File "/var/lib/python-support/python2.4/turbogears/controllers.py", line 351, in <lambda>

mapping, fragment, args, kw)))

File "/var/lib/python-support/python2.4/turbogears/controllers.py", line 391, in _execute_func

return _process_output(output, template, format, content_type, mapping, fragment)

File "/var/lib/python-support/python2.4/turbogears/controllers.py", line 82, in _process_output


File "/var/lib/python-support/python2.4/turbogears/view/base.py", line 131, in render

return engine.render(kw)

File "/var/lib/python-support/python2.4/genshi/plugin.py", line 78, in render

return self.transform(info, template).render(method=format)

File "/var/lib/python-support/python2.4/genshi/core.py", line 141, in render

output = u.join(list(generator))

File "/var/lib/python-support/python2.4/genshi/output.py", line 332, in call

for kind, data, pos in stream:

File "/var/lib/python-support/python2.4/genshi/output.py", line 499, in call

text = escape(pop_text(), quotes=False)

File "/var/lib/python-support/python2.4/genshi/core.py", line 420, in escape

text = unicode(text).replace('&', '&amp;') \

UnicodeDecodeError?: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128)

Change History (0)

Note: See TracTickets for help on using tickets.