-
Notifications
You must be signed in to change notification settings - Fork 44
Keep stdout stderr #522
Keep stdout stderr #522
Conversation
python/res/job_queue/ert_script.py
Outdated
""" @rtype: str """ | ||
return self.__stdout | ||
|
||
@stderr.setter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having public read&write properties with names stdout
and stderr
is in my opinion a bit misleading, it is not stdout
and stderr
as such you are manipulating here after all, but rather the string content which has been written to the respective streams.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeh, agreed.
Did a quick test on how it feels when using the existing defaultStackTrace
in ErtScript
. That might be the most "how the rest works", but I think ErtScript
still should keep the results and have it available.
f168d68
to
59c113d
Compare
Alright, a bit back and forth here.. I've renamed the variables to stdoutdata and stderrdata, the same names as the python documentation has and removed the setters, should be less misleading? Added some tests as well. |
aabcabc
to
b2709ab
Compare
I think so yes. |
26c987f
to
039d731
Compare
Did some final changes to this one.
|
sys.exc.traceback has been deprecated since 1.5 sys.info() is also the only one of these functions that are python 3 compatible
039d731
to
1afaaec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
Issue
Continues the work on equinor/ert#194
Does include commits from #520, but I'll rebase and fix everything.. The #520 will probably be merged first anyway.
Approach
First off, use
communicate
fromPopen
when usingPIPE
in order to collect and make sure that the program does not deadlock.A bit unsure how the error should propagate upwards on this one, and who should be responsible for storing the result. I think I made the proper call on where to put it.
This isn't complete, using
PIPE
also means that the stdout and stderr isn't sent to terminal, I'll fix that before it's merged so this doesn't change current behaviour