[issue24967] add errors='ignore' to print kwargs

2015-08-31 Thread Brett Cannon
Brett Cannon added the comment: I agree with Serhiy that this isn't print's job to worry about. It's better to be explicit than implicit and trying to cram worrying about decoding errors conflates what print does. I'm closing as "rejected". Thanks for the suggestion, though, Lukáš.

[issue24967] add errors='ignore' to print kwargs

2015-08-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: print() doesn't encode characters. It just writes string representation of arguments to output text file (sys.stdout by default). It is the output file is responsible for encoding (or is not, if it saves or passes further a text directly, as StringIO).

[issue24967] add errors='ignore' to print kwargs

2015-08-31 Thread Lukáš Němec
New submission from Lukáš Němec: Please add errors='...' to print's kwargs and pass it to codecs that are called from print. Sometimes you have undecodable/unencodable characters that you want to remove from the printed text. Now you need to call 'mytext'.encode('enc',