From 22b272f3afc1a3f3b83b764b7745a662bc0aa234 Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Sun, 10 May 2015 20:58:35 +0200 Subject: [PATCH] avoid buffering stdout output on pipes (bnc#930137) https://bugzilla.opensuse.org/show_bug.cgi?id=930137 --- osc-wrapper.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osc-wrapper.py b/osc-wrapper.py index 820473fa..4ceb7545 100755 --- a/osc-wrapper.py +++ b/osc-wrapper.py @@ -5,6 +5,7 @@ import locale import sys +import os from osc import commandline, babysitter @@ -21,6 +22,10 @@ except NameError: #reload, neither setdefaultencoding are in python3 pass +# avoid buffering output on pipes (bnc#930137) +if sys.stdout.name == '': + sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) + osccli = commandline.Osc() r = babysitter.run(osccli)