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/
_______________________________________________
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

Reply via email to