Code review comment for lp:~jml/launchpad/subunit-by-default

Revision history for this message
Gavin Panella (allenap) wrote :

> > An alternative for all the logs is to open them line buffered,
> > assuming that works as advertised.
>
> How do you do that?
>
> jml

For stdout I think you can open a new file object with line buffering
enabled (untested):

  my_stdout = os.fdopen(sys.stdout.fileno(), 'w', 1)

For regular files, it's similar:

  fd = open('fred.txt', 'w', 1)

« Back to merge proposal