diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-05-09 14:52:14 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-05-09 14:52:14 +0300 |
commit | 1c1999662da0b3fcfcfa224118809e8b236bb318 (patch) | |
tree | 84c02f6c435c983e06cd256333176001f1c65c44 | |
parent | f86d245067d334d7b241f4bf1a69a7cae68c8197 (diff) | |
download | vmdb2-1c1999662da0b3fcfcfa224118809e8b236bb318.tar.gz |
Change: flush progress output after every write
-rw-r--r-- | NEWS | 9 | ||||
-rw-r--r-- | vmdb/runcmd.py | 2 |
2 files changed, 11 insertions, 0 deletions
@@ -1,6 +1,15 @@ NEWS for vmdb2, the Debian disk image builder ============================================================================= +Version 0.15+git, not yet released +------------------------------------ + +* Progress output is now flushed after every write. This matters, when + the output goes to a pipe, because then Python would buffer the + output, meaning that progress output gets delayed until the buffer + fills up, and that's useless. + + Version 0.15, released 2020-05-05 ------------------------------------ diff --git a/vmdb/runcmd.py b/vmdb/runcmd.py index ae4a6d0..7cd6406 100644 --- a/vmdb/runcmd.py +++ b/vmdb/runcmd.py @@ -35,12 +35,14 @@ def set_verbose_progress(verbose): def error(msg): logging.error(msg, exc_info=True) sys.stderr.write('ERROR: {}\n'.format(msg)) + sys.stderr.flush() def progress(msg): logging.info(msg) if _verbose: sys.stdout.write('{}\n'.format(msg)) + sys.stdout.flush() def runcmd(argv, **kwargs): |