Edgewall Software

Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#189 closed defect (invalid)

TextSerializer mistakenly calls unicode() on TEXT data

Reported by: Matt Chaput <matt@…> Owned by: cmlenz
Priority: major Milestone: 0.5
Component: Serialization Version: devel
Keywords: Cc:

Description

The TextSerializer.__call__() method yields the text data like this:

yield unicode(data)

I believe this is incorrect, since (a) the "data" of a TEXT event should already be Unicode, and (b) any data that IS Unicode (ie contains chars >127) will raise an error because unicode() runs its argument through the ASCII decoder.

I think it should be just yield data, or paranoid-ly:

assert isinstance(data, unicode)
yield data

Change History (1)

comment:1 Changed 16 years ago by Matt Chaput <matt@…>

  • Resolution set to invalid
  • Status changed from new to closed

Nevermind, I had accidentally "contaminated" the stream with str objects. (C'mon, Python 3000!)

Note: See TracTickets for help on using tickets.