2008/4/17, Guido van Rossum <[EMAIL PROTECTED]>: > For those of us with less capable IO devices, setting the error flag > for stdout and stderr to backslashreplace is probably the best > solution (and it solves more problems than just repr()). >
Some thought on Points I found while investigating further. - A lot of people uses utf-8 for their encoding, such as de_DE.utf8. In such case, backslashescape trick doesn't work. I need to find a way to select an appropriate codec to render unwanted characters as \uXXXX. - io.TextIOWrapper doesn't provide interface to change encoding and error-handler after it was created. This feature is supported in PEP-3116, but isn't impletented at this time. Will it be implemented? It would be nice if we have optional encoding and errors args for print() and TextIOWrapper.write(), so people can write print(repr(obj), 'koi8-r', 'backslashescape'). _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com