[Python-Dev] str object going in Py3K

Bill Janssen janssen at parc.com
Wed Feb 15 22:27:15 CET 2006


Well, I probably am, but that's not the reason.  Reading has nothing
to do with it.

The default mode (text) corrupts data on write on a certain platform
(Windows) by inserting extra bytes in the data stream.  This bug
particularly exhibits itself when programs developed on Linux or Mac
OS X are then run on a Windows platform.  I think it's a bug to
default to a mode which modifies the data stream.  The default mode
should be 'binary'; people interested in exploiting the obsolete
Windows distinction between "text" and "binary" should have to use a
mode switch (I suggest "t") to put a file stream in 'text' mode.

Bill

> On 2/15/06, Bill Janssen <janssen at parc.com> wrote:
> > The default behavior of the current open() in opening files as text is
> > particularly grating.
> 
> Why? Are you perhaps one of those rare folks who read more binary data
> than text?
> 
> --
> --Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-Dev mailing list