I\'m working on a series of parsers where I get a bunch of tracebacks from my unit tests like:
File \"c:\\Python31\\lib\\encodings\\cp1252.py\", line 23, i
You can relax the error handling.
For instance:
f = open(filename, encoding="...", errors="replace")
Or:
f = open(filename, encoding="...", errors="ignore")
See the docs.
EDIT:
But are you certain that the problem is in reading the file? Could it be that the exception happens when something is written to the console? Check http://wiki.python.org/moin/PrintFails