Re: print u'\u2013' error on console/terminal

2009-06-25 Thread Martin v. Löwis
> 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 -- http://mail.python.org

print u'\u2013' error on console/terminal

2009-06-25 Thread robert
>>> sys.stdout.encoding 'cp850' >>> print u'\u2013' Traceback (most recent call last): File "", line 1, in File "C:\Python25\Lib\encodings\cp850.py", line 12, in encode return codecs.charmap_encode(input,errors,encoding_map) UnicodeEncodeError: 'charmap' codec can't encode character u'\u