Re: when does newlines get set in universal newlines mode?

2015-05-04 Thread Davide Mancusi
>> 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.

Cheers,
Davide
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: when does newlines get set in universal newlines mode?

2015-05-05 Thread Davide Mancusi
I just opened a bug report:

http://bugs.python.org/issue24126

We'll see what they say.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: when does newlines get set in universal newlines mode?

2015-05-05 Thread Davide Mancusi
> Cool. I suggest posting in the tracker thread the exact Python
> version(s) you've tested this with, in case it matters.

Done. Good point.
-- 
https://mail.python.org/mailman/listinfo/python-list