# HG changeset patch # User Patrick Mezard # Date 2007-01-10 19:35:27 # Node ID 6ea8a3b805ee5ce9794ca653e85c40ac86ec468d # Parent bf329bda51a61033667bf8d657a4affa4a9315bf Flush stderr after write. stderr can be buffered under win32 when redirected to a file, including stdout. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -385,6 +385,9 @@ class ui(object): if not sys.stdout.closed: sys.stdout.flush() for a in args: sys.stderr.write(str(a)) + # stderr may be buffered under win32 when redirected to files, + # including stdout. + if not sys.stderr.closed: sys.stderr.flush() except IOError, inst: if inst.errno != errno.EPIPE: raise