Edgewall Software

Opened 10 years ago

Closed 10 years ago

Last modified 6 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:


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

Attachments (0)

Change History (1)

comment:1 Changed 10 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!)

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain cmlenz.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.