Skip to content

gh-142867: Fix trace --count showing annotations as missing#143161

Open
heathdutton wants to merge 2 commits into
python:mainfrom
heathdutton:gh-142867-fix-trace-count-missing-lines
Open

gh-142867: Fix trace --count showing annotations as missing#143161
heathdutton wants to merge 2 commits into
python:mainfrom
heathdutton:gh-142867-fix-trace-count-missing-lines

Conversation

@heathdutton

Copy link
Copy Markdown

With PEP 649 (deferred annotation evaluation), __annotate__ code objects are stored but not executed during normal program flow. The _find_lines() function was including lines from these code objects, causing them to incorrectly appear as not covered in trace output.

This fix skips __annotate__ code objects when determining executable lines.

@bedevere-app

bedevere-app Bot commented Dec 25, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@heathdutton heathdutton force-pushed the gh-142867-fix-trace-count-missing-lines branch from 66ef492 to 27aecaf Compare December 25, 2025 04:31
@heathdutton heathdutton force-pushed the gh-142867-fix-trace-count-missing-lines branch from 8d472d2 to 23dac04 Compare December 25, 2025 17:29
@urnest

urnest commented Feb 11, 2026

Copy link
Copy Markdown

built this commit and reran original bug report, confirm that this fixes the problem... the code change looks plausible (without knowing the code at all)

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 4, 2026
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants