From 54e0ba935ac20b0d558f3472c4faa2fc33cfed92 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 11 Jan 2011 12:08:36 +0000 Subject: [PATCH] minor update --- lib/core/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index bf8147d3e..676adff6e 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -426,9 +426,10 @@ def dataToStdout(data, forceOutput=False): if forceOutput or (conf.verbose > 0) and not getCurrentThreadData().disableStdOut: try: sys.stdout.write(data) - sys.stdout.flush() except UnicodeEncodeError: - print data.encode(conf.dataEncoding) + sys.stdout.write(data.encode(conf.dataEncoding)) + finally: + sys.stdout.flush() def dataToSessionFile(data): if not conf.sessionFile or kb.suppressSession: