print u'\u2013' error on console/terminal

"Martin v. Löwis" martin at v.loewis.de
Thu Jun 25 16:16:11 EDT 2009


> is there a switch to suppress those encoding errors for standard print's
> on the console

No, there is no such switch.

> or a new filter file class necessary?

You can wrap sys.stdout with a codecs.StreamWriter, passing "replace"
as the error handler.

Regards,
Martin



More information about the Python-list mailing list