GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 3.11 backtrace visual indicators are too verbose · Issue #93883 · python/cpython

3.11 backtrace visual indicators are too verbose #93883

New issue
Copy link
New issue
Copy link
Closed
Closed
3.11 backtrace visual indicators are too verbose#93883
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@belm0
belm0
opened on Jun 16, 2022
Issue body actions

I understand that the new visual indicators can be disabled, but we shouldn't have to choose between guaranteed 50% longer backtraces and pertinent column information.

Often, the visual indicator spans the entire line for a large percentage of the backtrace. (I've seen cases in our app where it's true for 100% of the backtrace.)

Proposal: elide the indicators when they span the whole line

Elide traceback column indicators when the entire line of the frame is implicated. This reduces traceback length and draws more attention to the remaining (very relevant) indicators.

before:

Traceback (most recent call last):
  File "query.py", line 99, in <module>
    bar()
    ^^^^^
  File "query.py", line 66, in bar
    foo()
    ^^^^^
  File "query.py", line 37, in foo
    magic_arithmetic('foo')
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "query.py", line 18, in magic_arithmetic
    return add_counts(x) / 25
           ^^^^^^^^^^^^^
  File "query.py", line 24, in add_counts
    return 25 + query_user(user1) + query_user(user2)
                ^^^^^^^^^^^^^^^^^
  File "query.py", line 32, in query_user
    return 1 + query_count(db, response['a']['b']['c']['user'], retry=True)
                               ~~~~~~~~~~~~~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable

after:

Traceback (most recent call last):
  File "query.py", line 99, in <module>
    bar()
  File "query.py", line 66, in bar
    foo()
  File "query.py", line 37, in foo
    magic_arithmetic('foo')
  File "query.py", line 18, in magic_arithmetic
    return add_counts(x) / 25
           ^^^^^^^^^^^^^
  File "query.py", line 24, in add_counts
    return 25 + query_user(user1) + query_user(user2)
                ^^^^^^^^^^^^^^^^^
  File "query.py", line 32, in query_user
    return 1 + query_count(db, response['a']['b']['c']['user'], retry=True)
                               ~~~~~~~~~~~~~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable
Reacted by Ariya ISIHARA, Thomas Grainger, Daniël van Noord, Oleg Iarygin, dskrypa and Zac Hatfield-Dodds

Activity

  1. belm0
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jun 16, 2022
  2. belm0 commented on Jun 19, 2022

    @belm0
    belm0
    on Jun 19, 2022
    ContributorAuthor
    More actions

    I've prototyped the change for traceback.py. Making the equivalent change to C traceback code and updating documentation is still required. I'd like to hear if this change has some support from Python devs before putting more time into the PR.

  3. Zac-HD commented on Jun 23, 2022

    @Zac-HD
    Zac-HD
    on Jun 23, 2022
    Contributor
    More actions

    I am very, very keen on this change! Thanks very much @belm0 for thinking of this and implementing a patch 😍

    Reacted by John Belmonte, Terry Jan Reedy, Thomas Grainger and dskrypa
  4. belm0
    added a commit that references this issue on Jun 24, 2022

    pythongh-93883: elide traceback indicators when possible

    bd99c32
  5. belm0 commented on Jun 24, 2022

    @belm0
    belm0
    on Jun 24, 2022
    ContributorAuthor
    More actions

    PR #93994 is ready for review

  6. pablogsal
    added a commit that references this issue on Jul 11, 2022

    gh-93883: elide traceback indicators when possible (#93994)

    da71751
  7. miss-islington
    added a commit that references this issue on Jul 11, 2022

    pythongh-93883: elide traceback indicators when possible (pythonGH-93994

    40ccf13
  8. pablogsal
    added a commit that references this issue on Jul 11, 2022

    gh-93883: Fix some tests involving traceback formatting (#94737)

    1fdc35e
  9. belm0
    added 3 commits that reference this issue on Jul 11, 2022

    [3.11] pythongh-93883: elide traceback indicators when possible (pyth…

    b2f98c3

    pythongh-93883: Fix some tests involving traceback formatting (python…

    915d03e

    [3.11] pythongh-93883: elide traceback indicators when possible (pyth…

    7f94a11
  10. miss-islington
    added a commit that references this issue on Jul 11, 2022

    [3.11] gh-93883: elide traceback indicators when possible (GH-93994) (G…

    45896f2
  11. belm0 commented on Jul 11, 2022

    @belm0
    belm0
    on Jul 11, 2022
    ContributorAuthor
    More actions

    The refinement is merged and backported to 3.11 for the beta4 release.

    Reacted by Alex Waygood, Oleg Iarygin, Zac Hatfield-Dodds and Terry Jan Reedy
  12. belm0
    closed this as completedon Jul 11, 2022
  13. hroncok
    added 2 commits that reference this issue on Jul 13, 2022

    Adjust tests for a last minute Python 3.11 change in the traceback fo…

    f33070e

    Adjust tests for a last minute Python 3.11 change in the traceback fo…

    09b2c95
  14. nitzmahone
    added 2 commits that reference this issue on Sep 8, 2022

    Adjust tests for a last minute Python 3.11 change in the traceback fo…

    33a9713

    Adjust tests for a last minute Python 3.11 change in the traceback fo…

    142ee0c
  15. imgbot
    added 2 commits that reference this issue on Apr 18, 2026

    Adjust tests for a last minute Python 3.11 change in the traceback fo…

    ce9ddd3

    Adjust tests for a last minute Python 3.11 change in the traceback fo…

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.