Re: [Python-3000] Universal newlines support in Python 3.0

2007-08-13 Thread Russell E Owen
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

Re: [Python-3000] Universal newlines support in Python 3.0

2007-08-12 Thread Paul Moore
On 11/08/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 8/11/07, Tony Lownds <[EMAIL PROTECTED]> wrote: > > Is this ok: when newline='\r\n' or newline='\r' is passed, only that > > string is used to determine > > the end of lines. No translation to '\n' is done. > > I *think* it would be more

Re: [Python-3000] Universal newlines support in Python 3.0

2007-08-11 Thread Greg Ewing
Stephen J. Turnbull wrote: > But if there's more than one line ending used, that's not good > enough. If there's more than one, then you're in trouble anyway. In the usual case where there is only one, it provides a way of finding out what it is. -- Greg __

Re: [Python-3000] Universal newlines support in Python 3.0

2007-08-11 Thread Tony Lownds
On Aug 11, 2007, at 10:29 AM, Guido van Rossum wrote: >> Is this ok: when newline='\r\n' or newline='\r' is passed, only that >> string is used to determine >> the end of lines. No translation to '\n' is done. > > I *think* it would be more useful if it always returned lines ending > in \n (not \r

Re: [Python-3000] Universal newlines support in Python 3.0

2007-08-11 Thread Guido van Rossum
On 8/11/07, Tony Lownds <[EMAIL PROTECTED]> wrote: > > On Aug 10, 2007, at 11:23 AM, Guido van Rossum wrote: > > > Python 3.0 currently has limited universal newlines support: by > > default, \r\n is translated into \n for text files, but this can be > > controlled by the newline= keyword parameter

Re: [Python-3000] Universal newlines support in Python 3.0

2007-08-11 Thread Tony Lownds
On Aug 10, 2007, at 11:23 AM, Guido van Rossum wrote: > Python 3.0 currently has limited universal newlines support: by > default, \r\n is translated into \n for text files, but this can be > controlled by the newline= keyword parameter. For details on how, see > PEP 3116. The PEP prescribes that

Re: [Python-3000] Universal newlines support in Python 3.0

2007-08-10 Thread Stephen J. Turnbull
Greg Ewing writes: > Guido van Rossum wrote: > > 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). > > I

Re: [Python-3000] Universal newlines support in Python 3.0

2007-08-10 Thread Greg Ewing
Guido van Rossum wrote: > 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). I've never used it, but I can see how it c

Re: [Python-3000] Universal newlines support in Python 3.0

2007-08-10 Thread Tony Lownds
On Aug 10, 2007, at 11:23 AM, Guido van Rossum wrote: > Python 3.0 currently has limited universal newlines support: by > default, \r\n is translated into \n for text files, but this can be > controlled by the newline= keyword parameter. For details on how, see > PEP 3116. The PEP prescribes that

[Python-3000] Universal newlines support in Python 3.0

2007-08-10 Thread Stephen J. Turnbull
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

[Python-3000] Universal newlines support in Python 3.0

2007-08-10 Thread Guido van Rossum
Python 3.0 currently has limited universal newlines support: by default, \r\n is translated into \n for text files, but this can be controlled by the newline= keyword parameter. For details on how, see PEP 3116. The PEP prescribes that a lone \r must also be translated, though this hasn't been impl