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

Question:

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?

Asked By: Yen

||

Answers:

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.

Answered By: Allan Wind
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.