Skip to content

Commit

Permalink
Apply @akidata's fix re #965 + changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Dec 15, 2013
1 parent 46ff4d8 commit 9b58343
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/changelog.rst
Expand Up @@ -4,6 +4,9 @@
Changelog
=========

* :bug:`965 major` Tweak IO flushing behavior when in linewise (& thus
parallel) mode so interwoven output is less frequent. Thanks to `@akidata`
for catch & patch.
* :release:`1.8.0 <2013-09-20>`
* :feature:`931` Allow overriding of `.abort` behavior via a custom
exception-returning callable set as :ref:`env.abort_exception
Expand Down
6 changes: 5 additions & 1 deletion fabric/io.py
Expand Up @@ -50,7 +50,11 @@ def __init__(self, chan, attr, stream, capture, timeout):

def _flush(self, text):
self.stream.write(text)
self.stream.flush()
# Actually only flush if not in linewise mode.
# When linewise is set (e.g. in parallel mode) flushing makes
# doubling-up of line prefixes, and other mixed output, more likely.
if not env.linewise:
self.stream.flush()
self.write_buffer.extend(text)

def loop(self):
Expand Down

0 comments on commit 9b58343

Please sign in to comment.