Skip to content

Allow the repl to show source code and complete tracebacks #110805

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

Closed
pablogsal opened this issue Oct 13, 2023 · 0 comments
Closed

Allow the repl to show source code and complete tracebacks #110805

pablogsal opened this issue Oct 13, 2023 · 0 comments
Labels
3.13 bugs and security fixes type-feature A feature request or enhancement

Comments

@pablogsal
Copy link
Member

pablogsal commented Oct 13, 2023

Currently the REPL doesn't show traceback source or augmented information for the source that is typed in the repl itself:

>>> def f(x):
...    1/x
...
>>> f(0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in f
ZeroDivisionError: division by zero

To improve user experience, we want the REPL to be able to treat source lines thar were typed directly as any other kind and show proper tracebacks:

>>> def f(x):
...    1/x
...
>>> f(0)
Traceback (most recent call last):
  REPL, line 1, in <module>
    f(0)
  REPL, line 2, in f
    1/x
    ~^~
ZeroDivisionError: division by zero

Linked PRs

pablogsal added a commit that referenced this issue Oct 13, 2023
…REPL tracebacks (#110814)

Fix test_peg_generator after the change in the parser for REPL tracebacks
@sunmy2019 sunmy2019 added the type-feature A feature request or enhancement label Oct 13, 2023
@merwok merwok added the 3.13 bugs and security fixes label Oct 24, 2023
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
…r for REPL tracebacks (python#110814)

Fix test_peg_generator after the change in the parser for REPL tracebacks
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
…r for REPL tracebacks (python#110814)

Fix test_peg_generator after the change in the parser for REPL tracebacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants