Skip to content

Snekbox !eval output of exactly 11 lines is truncated #709

Closed

Description

@bast0006

If snekbox would return an output of exactly 11 lines, with 10 newline characters, it will truncate the final returning line without sending the output to be uploaded.

The source is a mismatch in the snekbox cog, within format_output--the number of lines to output is set to output.count("\n")and checked against > 10 but later output is sliced with output.split("\n")[:10].

.split() returns up to 11 items if there are exactly 10 \n's which results in the loss of the final line of output.

Testcase:
!e ```py
print(*range(11), sep="\n")
```
The final element (10) is missing.

Activity

  1. Akarys42 commented on Dec 25, 2019

    @Akarys42
    Contributor

    Hi, can I work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: frontendRelated to output and formattingp: 2 - normalNormal Prioritys: WIPWork In Progresst: bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions