[Python-Dev] Simplify the file-like-object interface

Bill Janssen janssen at parc.com
Wed Sep 14 02:52:16 CEST 2005


> This [text/binary] distinction is
> supported by the basic file operations in the C library. To open a
> text file in binary mode is technically an error (although in many OSs
> you'll get away with it).

It's one of those "technical" errors that really isn't an error (from
Python).  On the other hand, opening a file in text mode will cause
real data damage to binary files on Windows.  Let some
platform-specific library for that platform preserve it, if it cares
to.

I see no point in keeping this distinction in Python, even for those
platforms bone-headed enough to preserve it.  And the default
certainly shouldn't be to the mode which loses data.

Bill


More information about the Python-Dev mailing list