Repository navigation
Send user code stderr to the exercise console - #307
Open
Pranav-Singh-Devloper wants to merge 1 commit into
Open
Pranav-Singh-Devloper wants to merge 1 commit into
Pranav-Singh-Devloper wants to merge 1 commit into
Conversation
The user process was started with stderr=sys.stdout, i.e. RAM's own stdout. Python exercises only redirect sys.stderr to the console when WebGUI is imported, so tracebacks raised before that import never reached the user. Merge stderr into the console stdout instead. Fixes JdeRobot#306
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #306
The user process was started with
stderr=sys.stdout, which is RAM's own stdout (the container log). In Python exercises stderr only reaches the console afterimport WebGUI, becausestart_console()replacessys.stderrthere, so anything raised before that import was lost. Withstderr=subprocess.STDOUTthe process's stderr goes to the same console as its stdout. The C++ templates already reopen stderr on the console, so Python now behaves the same way.Testing (Image Classification):
import WebGUI: theNoSuchFiletraceback is now shown in the console (before: empty console).import WebGUIis shown once, not twice.import onnxruntime,torch,cv2andrclpyprint nothing to stderr in the RADI, so this adds no noise.black --checkpasses.Please merge together with JdeRobot/RoboticsAcademy#4101. Without it, every run shows two
Error sending message: socket is already closed.lines fromgui_interfacesin the console.Before
ram-stderr-before.mp4
After
ram-stderr-after.mp4