Edgewall Software

Opened 18 years ago

Closed 18 years ago

#43 closed defect (fixed)

Passing unicode to Template constructor fails

Reported by: oliver.cope@… Owned by: cmlenz
Priority: major Milestone: 0.3
Component: Parsing Version: 0.2
Keywords: Cc:

Description

Passing a unicode string with non-ascii characters to the markup.template.Template or markup.XML raises an exception:

>>> import markup.template
>>> markup.template.Template(u'<div>\u2013</div>')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "markup/template.py", line 755, in __init__
  File "markup/template.py", line 774, in parse
  File "markup/core.py", line 202, in _ensure
  File "markup/input.py", line 316, in _coalesce
  File "markup/input.py", line 106, in _generate
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3: ordinal not in range(128)

The markup.HTML function appears unaffected.

Change History (1)

comment:1 Changed 18 years ago by cmlenz

  • Component changed from General to Parsing
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [257].

Note: See TracTickets for help on using tickets.