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 — gh-93691: fix too broad source locations of for statement iterators by iritkatriel · Pull Request #120330 · python/cpython

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Jun 10, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Before this PR the error location covers the entire for-block (with body).

  • Issue: Bytecode positions seem way too broad #93691

Sorry, something went wrong.

Uh oh!

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

All reactions
iritkatriel added 2 commits June 10, 2024 22:29
@iritkatriel
pythongh-93691: fix too broad source locations of for statement itera…
de8e529
…tors
@iritkatriel
add news
f067774
@iritkatriel
iritkatriel requested a review from markshannon as a code owner June 10, 2024 21:32
@bedevere-app bedevere-app Bot mentioned this pull request Jun 10, 2024
Bytecode positions seem way too broad #93691
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Jun 10, 2024
@iritkatriel iritkatriel added needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes labels Jun 10, 2024
@iritkatriel
iritkatriel requested a review from carljm June 10, 2024 22:01
@iritkatriel
regen-all
6a3386c
@iritkatriel
iritkatriel requested a review from ericsnowcurrently as a code owner June 10, 2024 22:22
iritkatriel added 2 commits June 11, 2024 10:57
@iritkatriel
fix line tracing of multiline for statements
8aa33e1
@iritkatriel
update codegen test
6a9ca6d
carljm
carljm approved these changes Jun 11, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jun 11, 2024
@iritkatriel
iritkatriel merged commit 97b69db into python:main Jun 12, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Jun 12, 2024
@miss-islington-app

miss-islington-app Bot commented Jun 12, 2024

Copy link
Copy Markdown

Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 12, 2024
@iritkatriel @miss-islington
pythongh-93691: fix too broad source locations of for statement itera…
4994eaf
…tors (pythonGH-120330)

(cherry picked from commit 97b69db)

Co-authored-by: Irit Katriel <[email protected]>
@miss-islington-app

miss-islington-app Bot commented Jun 12, 2024

Copy link
Copy Markdown

Sorry, @iritkatriel, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 97b69db167be28a33688db436551a6c3c3ea4662 3.12
All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app miss-islington-app Bot assigned iritkatriel Jun 12, 2024
@bedevere-app

bedevere-app Bot commented Jun 12, 2024

Copy link
Copy Markdown

GH-120399 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 12, 2024
iritkatriel added a commit that referenced this pull request Jun 12, 2024
@miss-islington @iritkatriel
[3.13] gh-93691: fix too broad source locations of for statement iter…
39825a7
…ators (GH-120330) (#120399)

gh-93691: fix too broad source locations of for statement iterators (GH-120330)
(cherry picked from commit 97b69db)

Co-authored-by: Irit Katriel <[email protected]>
iritkatriel added a commit to iritkatriel/cpython that referenced this pull request Jun 12, 2024
@iritkatriel
[3.12] pythongh-93691: fix too broad source locations of for statemen…
dba9b0c
…t iterators (pythonGH-120330).

(cherry picked from commit 97b69db)

Co-authored-by: Irit Katriel <[email protected]>
@bedevere-bot

bedevere-bot commented Jun 12, 2024

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable LTO + PGO 3.13 has failed when building commit 39825a7.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1426/builds/109) and take a look at the build logs.
  4. Check if the failure is related to this commit (39825a7) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1426/builds/109

Summary of the results of the build (if available):

Click to see traceback logs
remote: Enumerating objects: 16, done.        
remote: Counting objects:   7% (1/13)        
remote: Counting objects:  15% (2/13)        
remote: Counting objects:  23% (3/13)        
remote: Counting objects:  30% (4/13)        
remote: Counting objects:  38% (5/13)        
remote: Counting objects:  46% (6/13)        
remote: Counting objects:  53% (7/13)        
remote: Counting objects:  61% (8/13)        
remote: Counting objects:  69% (9/13)        
remote: Counting objects:  76% (10/13)        
remote: Counting objects:  84% (11/13)        
remote: Counting objects:  92% (12/13)        
remote: Counting objects: 100% (13/13)        
remote: Counting objects: 100% (13/13), done.        
remote: Compressing objects:   8% (1/12)        
remote: Compressing objects:  16% (2/12)        
remote: Compressing objects:  25% (3/12)        
remote: Compressing objects:  33% (4/12)        
remote: Compressing objects:  41% (5/12)        
remote: Compressing objects:  50% (6/12)        
remote: Compressing objects:  58% (7/12)        
remote: Compressing objects:  66% (8/12)        
remote: Compressing objects:  75% (9/12)        
remote: Compressing objects:  83% (10/12)        
remote: Compressing objects:  91% (11/12)        
remote: Compressing objects: 100% (12/12)        
remote: Compressing objects: 100% (12/12), done.        
remote: Total 16 (delta 1), reused 6 (delta 1), pack-reused 3        
From https://github.com/python/cpython
 * branch                  3.13       -> FETCH_HEAD
Note: switching to '39825a7533ccf1aa0343d14fe88015db4ee6ef93'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 39825a7533 [3.13] gh-93691: fix too broad source locations of for statement iterators (GH-120330) (#120399)
Switched to and reset branch '3.13'

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [Makefile:3121: clean-retain-profile] Error 1 (ignored)
ar: unable to copy file 'libpython3.13.a'; reason: Success
make[2]: *** [Makefile:1047: libpython3.13.a] Error 1
make[1]: *** [Makefile:877: profile-gen-stamp] Error 2
make: *** [Makefile:889: profile-run-stamp] Error 2
All reactions

Sorry, something went wrong.

Uh oh!

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

iritkatriel added a commit that referenced this pull request Jun 13, 2024
@iritkatriel
[3.12] gh-93691: fix too broad source locations of for statement iter…
5a6cc3c
…ators (GH-120330 (#120405)

[3.12] gh-93691: fix too broad source locations of for statement iterators (GH-120330).
(cherry picked from commit 97b69db)
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
@iritkatriel @mrahtz
pythongh-93691: fix too broad source locations of for statement itera…
0808b02
…tors (python#120330)
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@iritkatriel @estyxx
pythongh-93691: fix too broad source locations of for statement itera…
e0de365
…tors (python#120330)
@15r10nk

15r10nk commented Aug 18, 2024

Copy link
Copy Markdown
Contributor

hi @iritkatriel, I integraded the bytecode changes into executing and was confused why the source-ranges changed for for-loops but not for comprehensions?

class Foo:
    def __iter__(self):
        assert False

a = [x for x in Foo()]

output (Python 3.12.5):

Traceback (most recent call last):
  File "/home/frank/projects/executing/codi.py", line 5, in <module>
    a = [x for x in Foo()]
        ^^^^^^^^^^^^^^^^^^
  File "/home/frank/projects/executing/codi.py", line 3, in __iter__
    assert False
           ^^^^^
AssertionError

Is there a reason for this or have they simply been forgotten?

All reactions

Sorry, something went wrong.

Uh oh!

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

@iritkatriel

iritkatriel commented Aug 18, 2024

Copy link
Copy Markdown
Member Author

That a different story. Let's reopen the issue or create a new one for compressions.

15r10nk reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

@iritkatriel iritkatriel mentioned this pull request Aug 19, 2024
Source locations too broad for list comprehension iterable expression #123142
Closed
@iritkatriel

iritkatriel commented Aug 19, 2024

Copy link
Copy Markdown
Member Author

New issue: #123142

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk hugovk removed the needs backport to 3.12 only security fixes label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@carljm carljm carljm approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner

Uh oh!

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

Assignees

@iritkatriel iritkatriel

Labels

None yet

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.

5 participants

@iritkatriel @bedevere-bot @15r10nk @carljm @hugovk
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.