In article <[EMAIL PROTECTED]>, "Stephen J. Turnbull" <[EMAIL PROTECTED]> wrote:
> Guido van Rossum writes: > > > However, the old universal newlines feature also set an attibute named > > 'newlines' on the file object to a tuple of up to three elements > > giving the actual line endings that were observed on the file so far > > (\r, \n, or \r\n). This feature is not in PEP 3116, and it is not > > implemented. I'm tempted to kill it. Does anyone have a use case for > > this? > > I have run into files that intentionally have more than one newline > convention used (mbox and Babyl mail folders, with messages received > from various platforms). However, most of the time multiple newline > conventions is a sign that the file is either corrupt or isn't text. > If so, then saving the file may corrupt it. The newlines attribute > could be used to check for this condition. There is at least one Mac source code editor (SubEthaEdit) that is all too happy to add one kind of newline to a file that started out with a different line ending character. As a result I have seen a fair number of text files with mixed line endings. I don't see as many these days, though; perhaps because the current version of SubEthaEdit handles things a bit better. So perhaps it won't matter much for Python 3000. -- Russell _______________________________________________ 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