Hg0428
Hg0428

Reputation: 330

Fatal Python error: Cannot recover from stack overflow. In python

I was trying to make my own terminal and when I was adding the feature to make your own functions and use them I got this error:

Fatal Python error: Cannot recover from stack overflow.

EDIT: For everyone looking for help with a similar error, this problem is caused by a function calling itself too many times. That causes an error because python is so far deep into running the function over and over and over again.

Upvotes: 1

Views: 7134

Answers (1)

Samwise
Samwise

Reputation: 71454

The error you're getting indicates that you have a function called do which calls itself, probably in an infinite loop. When a function does that too many times (calls itself inside itself, which causes it to call itself inside itself inside itself...) you get what's called a "stack overflow".

If you don't do that, you won't get this error.

Upvotes: 2

Related Questions