From 5bfffc2ca825983c48ddc503b4b2209bb534cc60 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 30 Apr 2017 04:13:44 +0200 Subject: [PATCH] Hardcode printing of "flowtext" warning to stderr Third-party applications obviously can not handle additional output on stdout nor can they be expected to do any weird stdout/sterr redirection as we do via `options.stdout` We probably shouldn't print anything in `scourString()` to start with unless we offer an option to disable all non-SVG output for third-party libraries to use. --- scour/scour.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scour/scour.py b/scour/scour.py index 722b1bb..83591a6 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -3328,7 +3328,7 @@ def scourString(in_string, options=None): if options.error_on_flowtext: raise Exception(errmsg) else: - print("WARNING: {}".format(errmsg), file=options.ensure_value("stdout", sys.stdout)) + print("WARNING: {}".format(errmsg), file=sys.stderr) # remove descriptive elements removeDescriptiveElements(doc, options)