OK, I think you've convinced me. Now, how about also making the default mode be text instead of binary? I've got a hunch that text files are used more than binary files, even where temporary files are concerned.
--Guido On 8/27/07, Adam Hupp <[EMAIL PROTECTED]> wrote: > On 8/26/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > > Hm, why not just create the temporary file in binary mode and wrap an > > io.TextIOWrapper instance around it? > > That works, but leaves TemporaryFile with a text mode that is somewhat > crippled. TemporaryFile unconditionally uses the default filesystem > encoding when in text mode so it can't be relied upon to hold > arbitrary strings. This is error prone and confusing IMO. > > An additional reason for adding newline and encoding: TemporaryFile > has always taken all of the optional arguments open() has, namely > 'mode' and 'bufsize'. There is a nice symmetry in adding these new > arguments as well. > > > -- > Adam Hupp | http://hupp.org/adam/ > -- --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