Steven D'Aprano schreef op de 2e dag van de slachtmaand van het jaar 2012:
> On Fri, 02 Nov 2012 23:22:53 +0100, Peter Kleiweg wrote:
>
> > In Python 3.1 and 3.2
> >
> > At start-up, the value of sys.stdin.newlines is None, which means,
> > universal newline should be enabled. But it isn't.
>
>
Steven D'Aprano wrote:
> On Fri, 02 Nov 2012 23:22:53 +0100, Peter Kleiweg wrote:
>
>> In Python 3.1 and 3.2
>>
>> At start-up, the value of sys.stdin.newlines is None, which means,
>> universal newline should be enabled. But it isn't.
>
> What makes you think it is not enabled?
$ python3 -c '
On Fri, 02 Nov 2012 23:22:53 +0100, Peter Kleiweg wrote:
> In Python 3.1 and 3.2
>
> At start-up, the value of sys.stdin.newlines is None, which means,
> universal newline should be enabled. But it isn't.
What makes you think it is not enabled?
sys.stdin.newlines shows you the newlines actually
In Python 3.1 and 3.2
At start-up, the value of sys.stdin.newlines is None, which
means, universal newline should be enabled. But it isn't.
So I do this:
sys.stdin = io.TextIOWrapper(sys.stdin.detach(), newline=None)
Now, sys.stdin.newlines is still None, but universal newline is
enabled.
W