sys.stdin and two CTRL-Ds

John Machin sjmachin at lexicon.net
Mon Jul 3 04:17:51 EDT 2006


On 3/07/2006 4:45 PM, Lawrence D'Oliveiro wrote:
> In article <44a76bb1 at news.eftel.com>,
>  John Machin <sjmachin at lexicon.net> wrote:
> 
>> On 2/07/2006 3:48 PM, Lawrence D'Oliveiro wrote:
>>> In article <44A6DD6E.5000502 at lexicon.net>,
>>>  John Machin <sjmachin at lexicon.net> wrote:
>>>
>>>> -u unbuffers sys.stdout 
>>>> and sys.stderr (and makes them binary, which wouldn't be a good idea on 
>>>> a Windows box).
>>> Why not?
>> If binary, '\n' would appear as LF alone rather than CR LF.
> 
> Why should that matter?

Because the contents of the output would be different. Haven't you ever 
wondered why (or read the manuals that explain why) Python, C , etc file 
I/O libraries have a text mode and a binary mode?

> I thought Windows (the NT line) was 
> POSIX-compliant.

What on earth gave you that idea?




More information about the Python-list mailing list