This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients benjamin.peterson, gjb1002, gvanrossum, pitrou, pjenvey, stutzbach
Date 2011-12-15.14:27:01
SpamBayes Score 9.699352e-12
Marked as misclassified No
Message-id <1323959199.3345.7.camel@localhost.localdomain>
In-reply-to <1323876594.8.0.471569022136.issue13601@psf.upfronthosting.co.za>
Content
> Line-buffering should be good enough since in practice errors messages
> are always terminated by a newline.

What I think too.

> I'm hesitant to make it line-buffered by default when directed to a
> file, since this could significantly slow down a program that for some
> reason produces super-voluminous output (e.g. when running a program
> with heavy debug logging turned on).

The slow-down is impressive in relative terms (6x) but the timings are
still small in absolute value:

$ ./python -m timeit -s "f=open('/dev/null', 'a', buffering=4096)" "f.write('log message\n')"
10000000 loops, best of 3: 0.156 usec per loop
$ ./python -m timeit -s "f=open('/dev/null', 'a', buffering=1)" "f.write('log message\n')"
1000000 loops, best of 3: 0.961 usec per loop
History
Date User Action Args
2011-12-15 14:27:02pitrousetrecipients: + pitrou, gvanrossum, gjb1002, pjenvey, benjamin.peterson, stutzbach
2011-12-15 14:27:01pitroulinkissue13601 messages
2011-12-15 14:27:01pitroucreate