2 ms·
Most developers are not aware of that and write code, that just bombs out for the user. The user would prefer at least garbled text instead of exception, becaus
by vetinari 11y ago
Most developers are not aware of that and write code, that just bombs out for the user. The user would prefer at least garbled text instead of exception, because he is used to that anyway in other apps. He has at least some result, instead of stack trace.
Well, and that's before the user tries to redirect stdout to file, in which case it will end up with error too, because that is going to be 7-bit ascii.
Anyway, Python3 does the right thing with defining the encoding at the edges and everything works right for the user out of the box.