Idiomatic portable way to strip line endings?

Guido van Rossum guido at
Tue Dec 18 04:55:38 CET 2001

Chris Barker <chrishbarker at> writes:

> To deal with all these problems (which become perhaps more common on
> Mac OS-X), there was discussion on python-dev about creating a
> "Universal Text File" type that would read files with any mixed
> combination of *nix, DOS and Mac line endings (and maybe do
> something smart on VMS as well). The goal would be able to have it
> work with Python code as well as files opened with open(), and also
> on pipes and other text streams.
> I know Guido, Jack Jansen and I had some discussion about it, and I
> think Jack put a little work into it, but I'm not sure where it
> sits.

--Guido van Rossum (home page:

More information about the Python-list mailing list