[issue39625] Traceback needs more details

2020-12-07 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> stack tracebacks should give the relevant class name

___
Python tracker 

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



[issue39625] Traceback needs more details

2020-02-17 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue39625] Traceback needs more details

2020-02-16 Thread Ammar Askar


Ammar Askar  added the comment:

I don't know how common this situation is, the fact that all constructors go to 
__init__ here makes it a little tough in this case but normally you'd be able 
to tell by the function name.

One potential solution might be to show which file the error came from like 
this:

Traceback (most recent call last):
  File "D:\x.py", line 13, in 
c = C(C1("C1"), C2("C2"))
TypeError: [D:\x.py:6] __init__() missing 1 required positional argument: 'p'

This is a pretty trivial change in ceval.c:3779 but might make the errors 
pretty long unless (especially now that co_filename is an absolute path) we 
chop them off to just the name of the file.

Including the frame information for the function about to be called would be 
much more difficult.

Overall this situation might not be worth improving because it's so rare but 
having the function location in the error might be worth having just as an 
extra information point.

--
nosy: +ammar2

___
Python tracker 

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



[issue39625] Traceback needs more details

2020-02-15 Thread SilentGhost


Change by SilentGhost :


--
components: +Interpreter Core
nosy: +vstinner
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue39625] Traceback needs more details

2020-02-15 Thread szb512


szb512  added the comment:

I think it is the "C2" class. Traceback is probably refering to that class.

--
nosy: +sdcards

___
Python tracker 

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



[issue39625] Traceback needs more details

2020-02-13 Thread Andrew Wall


New submission from Andrew Wall :

I encountered a question on Stackoverflow where, unusually, a Traceback was 
given in full, but I couldn't diagnose the problem.

It was like this:

Traceback (most recent call last):
  File "soFailedTraceback.py", line 15, in 
c = C(C1("C1"), C2("C2"))
TypeError: __init__() missing 1 required positional argument: 'p'

What I am claiming is missing is info about class C1:
  File "soFailedTraceback.py", line 8, in 
def __init__(self, s1, p):


Here is the file soFailedTraceback.py:
#soFailedTraceback

class C:
def __init__(self, c1, p):
pass

class C1:
def __init__(self, s1, p):
pass

class C2:
def __init__(self, s1):
pass

c = C(C1("C1"), C2("C2"))

I find the Traceback confusing, because it so happens there are two classes 
which have required positional argument "p", but python does not directly show 
which class it is.

--
messages: 361953
nosy: Andrew Wall
priority: normal
severity: normal
status: open
title: Traceback needs more details
type: enhancement
versions: Python 3.8

___
Python tracker 

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