Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

PythonConsoleLexer has broken traceback highlighting if no module location provided in traceback #2226

Closed
dbader opened this issue Sep 10, 2022 · 2 comments
Assignees
Labels
S-major severity: major T-bug type: a bug

Comments

@dbader
Copy link

dbader commented Sep 10, 2022

Example 1 (broken)

Input:

>>> exec('"')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
    "
     ^
SyntaxError: EOL while scanning string literal

Result:
Screen Shot 2022-09-09 at 4 54 46 PM

馃憜 Notice the two missing lines in the output, starting with the Traceback (most recent call last): line. This is a "real" traceback generated by the Python 3.9 REPL.

Example 2 (okay)

Adding a module location to the 2nd file location (, in <module>) restores the missing "Traceback ..." line and renders as expected:

>>> exec('"')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1, in <module>
    "
     ^
SyntaxError: EOL while scanning string literal

Result:
Screen Shot 2022-09-09 at 4 56 35 PM

Adding a comma (,) after the 2nd File "<string>", line 1 is enough to make the "Traceback ..." line appear (although it won't get the correct highlighting):

Screen Shot 2022-09-09 at 4 59 47 PM

Versions

@jeanas
Copy link
Contributor

jeanas commented Sep 10, 2022

Ouch, this looks pretty serious.

@jeanas jeanas self-assigned this Sep 10, 2022
@jeanas jeanas added T-bug type: a bug S-major severity: major labels Sep 10, 2022
@birkenfeld
Copy link
Member

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-major severity: major T-bug type: a bug
Projects
None yet
Development

No branches or pull requests

3 participants