diff --git a/augur/__main__.py b/augur/__main__.py index d69eae231..59f89dd8f 100644 --- a/augur/__main__.py +++ b/augur/__main__.py @@ -14,11 +14,21 @@ def main(): # Explicitly enable universal newlines mode so we do the right thing. newline=None, + + # By default, stdout is line-buffered when interactive (e.g. for + # consistent stdio interleaving) but block-buffered when not for (I + # assume) better performance. ) # Apply the above to stderr as well. sys.stderr.reconfigure( errors="backslashreplace", newline=None, + + # Always line-buffer stderr since we only use it for messaging, not + # data output. This is the Python default from 3.9 onwards, but we + # also run on 3.8 where it's not. Be consistent regardless of Python + # version. + line_buffering=True, ) return augur.run( argv[1:] )