Edgewall Software

Opened 17 years ago

Last modified 17 years ago

#124 closed defect

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

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

Description (last modified by cmlenz)

I am using Genshi 0.4.1 with TurboGears 1.0.2.2 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
    self.main()
  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
    fragment=fragment)
  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 (1)

comment:1 Changed 17 years ago by cmlenz

  • Description modified (diff)
Note: See TracTickets for help on using tickets.