PlainError

AttributeError: 'NoneType' object has no attribute 'append'

Last checked 2026-11-11 · 3 fixes · reviewed answer

TL;DRThis Python error occurs when code tries to add an item to a list using append, but the variable holds None (nothing) instead of an actual list.

Most likely cause: A function or expression returned None and that value was stored in the variable used with append.

Try first: Find the exact line

Likely causes

  1. A function or expression returned None and that value was stored in the variable used with append.most likely
  2. The variable was never created or assigned a list before the append call.possible
  3. A conditional branch left the variable unset or set to None.less likely

How to fix it

Safest first: SafeChanges settingsDangerous
  1. Find the exact lineSafe

    Open the Python file and look for any line ending in .append( to identify where the error happens.

  2. Check the variable valueSafe

    Right before that line, add a temporary print statement to show what the variable actually contains.

  3. Ensure a list is assignedChanges settings

    Make sure the variable is set to an empty list [] or a returned list before any append is called.

If that didn't fix it

Run the script with a debugger or add more print statements around the failing line to trace the variable's value step by step.

When to see a technician

If this error appears in a larger application you did not write, ask the original developer or post the surrounding code on a programming forum.

Quick answers

What does AttributeError: 'NoneType' object has no attribute 'append' mean?
This Python error occurs when code tries to add an item to a list using append, but the variable holds None (nothing) instead of an actual list.
What causes AttributeError: 'NoneType' object has no attribute 'append'?
A function or expression returned None and that value was stored in the variable used with append. (most likely) The variable was never created or assigned a list before the append call. (possible) A conditional branch left the variable unset or set to None. (less likely)
How do I fix AttributeError: 'NoneType' object has no attribute 'append'?
Try these in order, safest first: 1. Find the exact line. 2. Check the variable value. 3. Ensure a list is assigned.
What if that didn't fix it?
Run the script with a debugger or add more print statements around the failing line to trace the variable's value step by step.
When should I see a technician?
If this error appears in a larger application you did not write, ask the original developer or post the surrounding code on a programming forum.
Did this fix it? Report a problem

Related errors

All Coding errors →