Open
Description
https://github.com/COMP1511UNSW/autotest/blob/main/explain_output_differences.py#L379
# ...
if len(line) > max_line_length_shown:
line = line[0:max_line_length_shown] + " ..."
line = line.encode("unicode_escape").decode("ascii")
if leave_colorization:
line = line.replace(r"\x1b", "\x1b")
if leave_tabs:
line = line.replace(r"\t", "\t")
line = line.replace(r"\\", "\\")
# ...
I would like to see the line line = line.encode("unicode_escape").decode("ascii")
removed ideally,
but @hexDoor has pointed out that this may be necessary to escape things away such as ANSI colour codes.
Unfortunately it escapes normal characters that are of multi-byte width (eg. other language codepoints, emojis, etc.)
Can we make it less restrictive, i.e. normally render displayable characters, and just escape dangerous/non-displayable bytes away?
Metadata
Metadata
Assignees
Labels
No labels