Home > Net >  What does it mean when an error shows multiple files in a Python traceback?
What does it mean when an error shows multiple files in a Python traceback?

Time:09-10

I get the following error (edited out some parts, but same structure):

  File "./project/calcs.py", line 43, in getVar
    var = await olf.getOrg(*args, **kwargs)

  File "./project/subView.py", line 177, in getOrg
    undo = force.getLength()

  File "./project/stack/refine.py", line 89, in getLength
    for eTL in getLength():

blablabla.blablabla.issue: Can't redirect user

Am I supposed to look at the very FIRST error line to address the issue? Is it a chronology?

So in this case, I would be obliged to address calcs.py @ line 43 to fix that issue? I wouldn't be able to fix it by, let's say, addressing the 2nd error or the last one, correct?

Is that also the way to look at any python error trackback?

CodePudding user response:

You are probably looking at a stack trace which is ordered chronologically (oldest call first). In your case this means var = await olf.getOrg(*args, **kwargs) ran first which then ended up calling undo = force.getLength() and then for eTL in getLength(): which failed.

  • Related