[Pythonmac-SIG] Re: [Python-Dev] Import hook to do end-of-line conversion?

Guido van Rossum guido@digicool.com
Sat, 07 Apr 2001 13:57:10 -0500


> > > The same goes for file objects in text mode...

Yes.

> > probably -- but changing can break stuff (in theory, at least), and
> > may require a PEP.  changing the compiler is more of a bugfix, really...

Yes.

> But if we only fix the compiler, we'll get complaints that other
> things don't work, eg. bogus tracebacks due to a non-fixed
> linecache.py, broken IDE's, etc.

Yes.

> Btw. I can't seem to think of any examples that would break after
> such a change.  I mean, who would depend on a \n text file with
> embedded \r's?

On Unix, currently, tell() always give you a number that exactly
matches the number of characters you've read since the beginning of
the file.  This would no longer be true.  In general, code written on
Unix with no expectation to ever leave Unix, can currently be sloppy
about using binary mode, and open binary files in text mode.  Such
code could break.  I'm sure there's plenty such code around (none
written by me :-).

--Guido van Rossum (home page: http://www.python.org/~guido/)