Explain Python traceback code

Paste a Python traceback and Vibe explains what went wrong: which line in your code failed, how the program got there and what the error on the last line means.

traceback.txt

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe15 lines selected

Press Explain it for the sample, or paste your own code first.

What this Python traceback sample shows

reading order
most recent call last means the list runs from the first call at the top to the line that failed at the bottom: main() on line 19 called order_total(order) on line 16, and line 10 failed. The error itself is on the last line, so that's the place to start reading.
frames
Each File "...", line N, in name entry is one call that was still running, with the line it had reached. in <module> is the script's top level. in <genexpr> is the generator expression inside sum(...), which Python runs as its own small function, so line 10 appears twice.
the error line
KeyError: 'qty' means the code asked a dictionary for a key it doesn't have, and names the key. The ~ and ^ marks under the code point at the part that failed, item["qty"]. In orders.json, the second order's item has "quantity": 3, not "qty".
chained errors
When code catches one error and raises another, Python prints both tracebacks. A plain raise ValueError(...) inside except KeyError put During handling of the above exception, another exception occurred: between them. With raise ... from e, the line read The above exception was the direct cause of the following exception:.

Good to know

  • Run with Python 3.14.7 in a test folder, which is why the paths start with /home/sam/shop. On your computer they show where your own script is.
  • A1 25.0 was printed before the traceback: the first order was fine, and output from before a crash stays on screen. The traceback goes to a different place, stderr: with 2>/dev/null only A1 25.0 was left. The script ended with exit code 1.

Watch out: A quick fix can hide the problem instead of solving it. item.get("qty") only moved the crash, to TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'. item.get("qty", 1) stopped the error but printed A2 4, counting 3 items as 1 without a word. Reading quantity when qty is missing printed the right A2 12.

Explain Python traceback code beside your editor

Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

Opening the .dmg the first time
  1. Open the .dmg and drag Unvibe to Applications.
  2. Open it once; macOS says it can't verify it. Click Done.
    macOS dialog: Unvibe Not Opened, with Done and Move to Trash
    Real screen, macOS 15
  3. System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open