New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The e2e script's output is mangled #283
Comments
Just to clarify: Are you usually reading the output of the script via
the terminal or via a file? If the the former or if both outputs are
redirected to a single file, why not redirect them to two separate
files? If two separate files make it hard to track which error message
belong to which query then using stdout for the query information and
stderr for the error messages is probably not a good idea. What do you
think?
…On 11.09.2019 17:19, Florian Kramer wrote:
I've had problems with the e2e scipts error messages appearing nowhere
near the query that failed for ages by now. Finally decided to take a
close look. The query information is written to |stdout| while the
errors go to |stderr|. As the two streams are not flushed after a
message is written the buffering employed by the terminal leads to an
unreadable mixture of the two being printed. A simple (but not
necessarily elegant) solution would be using |sys.stdout.flush()| and
|sys.stderr.flush()| after every batch of messages.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#283>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADKSFHBX7CS7VVDTWLAD2UDQJED7XANCNFSM4IVVNCXA>.
|
Hmm, I have mixed feelings on this. On one hand writing errors to stderr and other output to stdout is common practice, on the other hand I see your issue and also think the explicit flushing isn't too elegant. I think since these errors are basically part of the intended output of the e2e script and not reallt an error of the script itself it would make sense to just send them to stdout.. What do you think @hannahbast @floriankramer |
+1 for writing all messages to stdout |
Switched all printing to stderr to printing to stdout. Fixes #283.
I've had problems with the e2e scipts error messages appearing nowhere near the query that failed for ages by now. Finally decided to take a close look. The query information is written to
stdout
while the errors go tostderr
. As the two streams are not flushed after a message is written the buffering employed by the terminal leads to an unreadable mixture of the two being printed. A simple (but not necessarily elegant) solution would be usingsys.stdout.flush()
andsys.stderr.flush()
after every batch of messages.The text was updated successfully, but these errors were encountered: