Bugs That Bite
Published in

Bugs That Bite

TypeError: cannot unpack non-iterable NoneType object

Forgetting to set a python variable or some related problem

Whenever you see NoneType in Python it usually means that something didn’t get set correctly. The other information is somewhat extraneous except possibly “unpack” because it gives you a clue what the program was trying to do, but your line of code will show you that as well.

Check your code to see that you set all the variables you think you set or the values you are passing into a function.

In my case I had inadvertently commented out the line of code returning a value from a function. That value was used in a subsequent function. That caused the value my program was trying to read to be null.

My program was trying to “unpack” a list of values returned from the function and hence the error:

TypeError: cannot unpack non-iterable NoneType object

Teri Radichel

If you liked this story please clap and follow:

Medium: Teri Radichel or Email List: Teri Radichel
Twitter: @teriradichel or @2ndSightLab
Requests services via LinkedIn: Teri Radichel or IANS Research

© 2nd Sight Lab 2022



Cybersecurity for Executives in the Age of Cloud on Amazon

Need Cloud Security Training? 2nd Sight Lab Cloud Security Training

Is your cloud secure? Hire 2nd Sight Lab for a penetration test or security assessment.

Have a Cybersecurity or Cloud Security Question? Ask Teri Radichel by scheduling a call with IANS Research.

Cybersecurity & Cloud Security Resources by Teri Radichel: Cybersecurity and Cloud security classes, articles, white papers, presentations, and podcasts



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store