-
Notifications
You must be signed in to change notification settings - Fork 226
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
Support non-ascii feedback #1384
Conversation
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.
Tested by submitting hello.c with a non-ASCII character. Autograding didn't hang. The output is as expected, indicating the error. Thanks for the quick fix!
Why are both changes needed? It seems that either change alone would allow output that's encoded as UTF-8 to be written to the file. It's not obvious to me what the force_encoding change will do to output that has stray binary characters in it (I've seen this in proxylab logs) |
With just the "wb" change, the following exception is still thrown from the
You're right though that just the force_encoding change would be sufficient |
I'll keep that in mind, but since Autolab currently would not even be able to return anything, even if they do see gibberish UTF8 logs (I'm assuming this is due to bugs or logging binary content that their proxy is serving) I think that's fine. |
I think I'm going to go with this instead:
Which will replace nulls and other non-iso characters with \xNN, but not all 8 bit chars. The question is do people prefer seeing \x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98 Different situations might want different results, but we can't really tell from the content |
In most cases I would say the former, I'll submit another PR with your fix which I agree is better. Thanks so much! |
if you want all hex, then change |
Also note that I had python on the brain when I wrote that and it is missing an end |
Description
See #975, issue recently resurfaced again with one of the courses in CMU
Motivation and Context
Confusing for students when no feedback is returned
How Has This Been Tested?
Test with the following file:
This will cause the compiler to output non-ASCII output as an error. With this PR Autolab will be able to process and return the feedback successfully.
Types of changes
Checklist:
Other issues / help required
If unsure, feel free to submit first and we'll help you along.