[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-08 Thread Mark Shannon


Change by Mark Shannon :


--
priority: release blocker -> 
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I'm inclined to leave it as is

I am fine with that, if you think this is not a bug, close the issue and remove 
the release blocker :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-07 Thread Andre Roberge


Andre Roberge  added the comment:

While I filed the original report, I am in agreement that accurate information 
for debugging tools is definitely more important than the quick summary shown 
in the traceback, and that the change likely represents an improvement in 
situations more realistic than the contrived example I gave.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-07 Thread Mark Shannon


Mark Shannon  added the comment:

This is a tricky one.
Which is the "correct" line appears to be subjective.

I'm inclined to leave it as is, as the tracing sequence seems better in the 
case of method chaining.
See https://github.com/python/cpython/blob/main/Lib/test/test_compile.py#L890

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Mark, take a look as soon as possible as beta4 is this week

--
nosy: +pablogsal
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-07 Thread Alex Hall


Alex Hall  added the comment:

(meant to say "so I'm pulling in @Mark.Shannon)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-07 Thread Alex Hall


Alex Hall  added the comment:

I believe this is the outcome of https://bugs.python.org/issue39316 which I 
filed, so I'm pulling in . Naturally I think the new behaviour is not a bug but 
a feature.

I think it's more important for the traceback to show the attribute access 
(`two`) than the value (`one`). That's what the frame was doing at the time 
which led to the error.

The difference becomes even more important when calling a method with no 
arguments. Given this script:

class A:
def b(self):
1 / 0


x = (
A()
.b()
)


The 3.9 traceback points to the line with `A()` in the `` frame, while 
3.10 correctly points to `.b()`, which makes the following line 'in b' make 
more sense.

Where the old behaviour has really gotten to me is when I run the pycharm 
debugger and put a breakpoint on the .b() line and it never gets hit. Not being 
sure what lines 'count', I sometimes defensively put breakpoints on a cluster 
of lines, then spend more time removing them later. Having that fixed in 3.10 
is great.

--
components: +Interpreter Core
nosy: +Mark.Shannon, alexmojaki
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44576] AttributeError: incorrect line identified in Python 3.10

2021-07-07 Thread Andre Roberge


New submission from Andre Roberge :

Consider the following program

# example.py
one = 1
two = "two"
a = [one
.
two]

Running this program with Python versions before 3.10, yields the following 
traceback:

Traceback (most recent call last):
  File "C:\Users\andre\example.py", line 3, in 
a = [one
AttributeError: 'int' object has no attribute 'two'

The line shown correctly includes the 'int' object. I have verified that this 
is the case for Python 3.6 to 3.9 inclusively.

However, with Python version 3.10.0b3, the following traceback is generated:

Traceback (most recent call last):
  File "C:\Users\andre\example.py", line 5, in 
two]
AttributeError: 'int' object has no attribute 'two'

--
messages: 397067
nosy: aroberge
priority: normal
severity: normal
status: open
title: AttributeError: incorrect line identified in Python 3.10
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com