Ticket #5875: patch.diff

File patch.diff, 519 bytes (added by tt@…, 16 years ago)

patch for unicode exception

  • __init__.

    old new  
    329329    def next(self):
    330330        chunk = self._iterator.next()
    331331        if isinstance(chunk, unicode):
    332             chunk = chunk.encode(self._charset)
     332            try:
     333                chunk = chunk.encode(self._charset)
     334            except UnicodeEncodeError, e:
     335                chunk = chunk.encode(self._charset, "replace")
    333336        return chunk
    334337
    335338    def close(self):
Back to Top