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áš.
--
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).
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', errors='replace').decode