Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #112342

Capturing the bad codes that raise UnicodeError exceptions during decoding

From Malcolm Greene <python@bdurham.com>
Newsgroups comp.lang.python
Subject Capturing the bad codes that raise UnicodeError exceptions during decoding
Date 2016-08-04 14:47 -0400
Message-ID <mailman.170.1470336428.6033.python-list@python.org> (permalink)
References <1470336426.893449.686225577.24458777@webmail.messagingengine.com>

Show all headers | View raw


I'm processing a lot of dirty CSV files and would like to track the bad
codes that are raising UnicodeErrors. I'm struggling how to figure out
what the exact codes are so I can track them, them remove them, and then
repeat the decoding process for the current line until the line has been
fully decoded so I can pass this line on to the CSV reader. At a high
level it seems that I need to wrap the decoding of a line until it
passes with out any errors. Any suggestions appreciated.

Thank you,
Malcolm

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Capturing the bad codes that raise UnicodeError exceptions during decoding Malcolm Greene <python@bdurham.com> - 2016-08-04 14:47 -0400

csiph-web