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 — bpo-43950: Print columns in tracebacks (PEP 657) by ammaraskar · Pull Request #26958 · python/cpython

Conversation

@ammaraskar

@ammaraskar ammaraskar commented Jun 29, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This pull request implements the relevant bits in traceback printing to utilize the new co_positions and PyCode_Addr2... APIs to print carets for column locations.

All the internal structures, and data representation are subjected to change in future PRs as we add optimizations.

https://bugs.python.org/issue43950

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jun 29, 2021
@bedevere-bot bedevere-bot added the awaiting review label Jun 29, 2021
@ammaraskar ammaraskar added skip news and removed skip news labels Jun 29, 2021
@ammaraskar
ammaraskar force-pushed the codeobject_changes branch 8 times, most recently from d69a6a4 to 6d4302d Compare July 2, 2021 01:44
@ammaraskar ammaraskar changed the title bpo-43950: Make compiler output more source offsets. bpo-43950: Print columns in tracebacks (PEP 657) Jul 2, 2021
@ammaraskar ammaraskar mentioned this pull request Jul 2, 2021
bpo-43950: Initial base implementation for PEP 657 #26955
Merged
@pablogsal

pablogsal commented Jul 2, 2021

Copy link
Copy Markdown
Member

@ammaraskar Ground control to major tom, commencing countdown engines on

Rebase time!

isidentical reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

isidentical
isidentical reviewed Jul 2, 2021
View reviewed changes
Comment thread Python/traceback.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

isidentical
isidentical reviewed Jul 2, 2021
View reviewed changes
Comment thread Python/traceback.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal
pablogsal marked this pull request as ready for review July 2, 2021 14:21
@pablogsal
pablogsal requested review from brettcannon, encukou, ericsnowcurrently, markshannon, ncoghlan, terryjreedy, tiran and warsaw as code owners July 2, 2021 14:21
@pablogsal
pablogsal force-pushed the codeobject_changes branch from 6d4302d to 1fd558c Compare July 2, 2021 14:21
@pablogsal
pablogsal removed request for brettcannon, encukou and ncoghlan July 2, 2021 14:21
isidentical
isidentical reviewed Jul 4, 2021
View reviewed changes
Comment thread Python/traceback.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

isidentical
isidentical reviewed Jul 4, 2021
View reviewed changes
Comment thread Python/traceback.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

isidentical
isidentical reviewed Jul 4, 2021
View reviewed changes
Comment thread Python/traceback.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

isidentical
isidentical reviewed Jul 4, 2021
View reviewed changes
Comment thread Python/traceback.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal

pablogsal commented Jul 4, 2021

Copy link
Copy Markdown
Member

@pablogsal would you mind cleaning up the byte_to_character_offset_in_line function here.

Yeah, I will do that. Could you address first @isidentical feedback?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ammaraskar ammaraskar mentioned this pull request Jul 4, 2021
bpo-43950: Add option to opt-out of PEP-657 #27023
Merged
@ammaraskar
Address feedback from @isidentical
9a31711
@ammaraskar
ammaraskar force-pushed the codeobject_changes branch from 73bcea3 to 9a31711 Compare July 4, 2021 19:59
ammaraskar and others added 3 commits July 4, 2021 16:09
@ammaraskar
Remove TODO about highlighting to end
83f0260
@ammaraskar
Remove stale TODO
1a5a4cf
@pablogsal
Move byte_offset_to_character_offset to the parser API
58e2f7f
@pablogsal
pablogsal force-pushed the codeobject_changes branch 6 times, most recently from e0b1f4b to 58e2f7f Compare July 4, 2021 22:24
pablogsal
pablogsal approved these changes Jul 4, 2021
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Jul 4, 2021
@pablogsal
pablogsal merged commit 5644c7b into python:main Jul 4, 2021
@bedevere-bot bedevere-bot removed the awaiting merge label Jul 4, 2021
@pablogsal
pablogsal deleted the codeobject_changes branch July 4, 2021 23:14
@pablogsal

pablogsal commented Jul 5, 2021

Copy link
Copy Markdown
Member

@ammaraskar Can you open the prs for the follow-ups?

#26958 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ammaraskar

ammaraskar commented Jul 5, 2021

Copy link
Copy Markdown
Member Author

#27023 for the config change, working on the traceback.py refactor + a bpo issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ammaraskar

ammaraskar commented Jul 5, 2021

Copy link
Copy Markdown
Member Author

https://bugs.python.org/issue44569 for the traceback.py change, PR for it coming soon.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal pablogsal mentioned this pull request Apr 13, 2022
Include column offsets for bytecode instructions #88116
Closed
@hroncok hroncok mentioned this pull request Jun 18, 2022
support for Python 3.11 ipython/ipyparallel#726
Merged
graingert
graingert reviewed Nov 2, 2022
View reviewed changes
Comment thread Lib/traceback.py
"""
if f is None:
f = sys._getframe().f_back.f_back
f = sys._getframe().f_back.f_back.f_back.f_back

@graingert graingert Nov 2, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem correct -

Python 3.11.0 | packaged by conda-forge | (main, Oct 25 2022, 06:18:27) [GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import traceback
>>> traceback.walk_stack(None)
<generator object walk_stack at 0x7f308f4c4700>
>>> list(traceback.walk_stack(None))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/graingert/anaconda3/envs/dask-distributed-311/lib/python3.11/traceback.py", line 332, in walk_stack
    f = sys._getframe().f_back.f_back.f_back.f_back
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'f_back'
>>> 

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@pablogsal pablogsal Nov 2, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't comment on merged pull requests because they are not monitored and you risk no one looking at your comment. Always open a new issue :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@graingert graingert mentioned this pull request Nov 2, 2022
traceback.walk_stack(None) yields frames from higher in the stack on 3.11 #99013
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@graingert graingert graingert left review comments
@pablogsal pablogsal pablogsal approved these changes
@isidentical isidentical isidentical left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@ammaraskar @pablogsal @terryjreedy @isidentical @graingert @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.