when does newlines get set in universal newlines mode?
Terry Reedy
tjreedy at udel.edu
Mon May 4 13:38:43 EDT 2015
On 5/4/2015 9:35 AM, Davide Mancusi wrote:
>>> I believe this is a bug.
>>
>> I'm not sure it is, actually; imagine the text is coming in one
>> character at a time (eg from a pipe), and it's seen "alpha\r". It
>> knows that this is a line, so it emits it; but until the next
>> character is read, it can't know whether it's going to be \r or \r\n.
>> What should it do? Read another character, which might block? Put "\r"
>> into .newlines, which might be wrong? Once it sees the \n, it knows
>> that it was \r\n (or rather, it assumes that files do not have lines
>> of text terminated by \r followed by blank lines terminated by \n -
>> because that would be stupid).
>
> I think this is a good point. However, I will probably submit a bug
> report anyway and let the devs make their decisions. It is at least a
> documentation bug.
Be sure to report the exact python binary you are using, as reported
when you start the interactive interpreter or Idle shell.
--
Terry Jan Reedy
More information about the Python-list
mailing list