On Fri, Apr 18, 2008 at 7:35 PM, atsuo ishimoto <[EMAIL PROTECTED]> wrote: > - 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 should be implemented. It may be a little tricky if there's codec state, but I'm okay with raising an exception in that case or doing something else that's sensible. > 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'). This should be done with a new function, not added to print. Once you specify an encoding, you have to write to sys.stdout.buffer, which is the underlying binary stream; but you'd have to flush the TextIOWrapper and deal with incomplete codec state, and in general I don't think it's a good idea. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ 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