question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RecursionError: maximum recursion depth exceeded while calling a Python object

See original GitHub issue

When two tables have foreign keys that reference each other:

Traceback (most recent call last):
  File "/Users/tekumara/.local/bin/sqlite_web", line 8, in <module>
    sys.exit(main())
  File "/Users/tekumara/.local/pipx/venvs/sqlite-web/lib/python3.7/site-packages/sqlite_web/sqlite_web.py", line 841, in main
    initialize_app(args[0], options.read_only, password, options.url_prefix)
  File "/Users/tekumara/.local/pipx/venvs/sqlite-web/lib/python3.7/site-packages/sqlite_web/sqlite_web.py", line 812, in initialize_app
    dataset = SqliteDataSet('sqlite:///%s' % filename, bare_fields=True)
  File "/Users/tekumara/.local/pipx/venvs/sqlite-web/lib/python3.7/site-packages/playhouse/dataset.py", line 48, in __init__
    **kwargs)
  File "/Users/tekumara/.local/pipx/venvs/sqlite-web/lib/python3.7/site-packages/playhouse/reflection.py", line 764, in generate_models
    _create_model(table, models)
  File "/Users/tekumara/.local/pipx/venvs/sqlite-web/lib/python3.7/site-packages/playhouse/reflection.py", line 688, in _create_model
    _create_model(dest, models)
  File "/Users/tekumara/.local/pipx/venvs/sqlite-web/lib/python3.7/site-packages/playhouse/reflection.py", line 688, in _create_model
    _create_model(dest, models)
  File "/Users/tekumara/.local/pipx/venvs/sqlite-web/lib/python3.7/site-packages/playhouse/reflection.py", line 688, in _create_model
    _create_model(dest, models)
  [Previous line repeated 989 more times]
  File "/Users/tekumara/.local/pipx/venvs/sqlite-web/lib/python3.7/site-packages/playhouse/reflection.py", line 684, in _create_model
    for foreign_key in database.foreign_keys[table]:
RecursionError: maximum recursion depth exceeded while calling a Python object

peewee 3.14.8

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
coleifercommented, Feb 15, 2022

There’s a new peewee (3.14.9) on pypi now that contains the fix.

0reactions
tekumaracommented, Feb 16, 2022

Fantastic thank you for the fast fix @coleifer I can confirm it works! 🙌

Read more comments on GitHub >

github_iconTop Results From Across the Web

maximum recursion depth exceeded while calling a Python ...
This means that each call to your recursive function will create a function call stack and because there is a limit of stack...
Read more >
maximum recursion depth exceeded while calling a Python ...
When we run the recursion function for a large number of times, recursion error is thrown. Python has a limit on the number...
Read more >
(Python) RecursionError: maximum recursion depth exceeded
The Python "RecursionError: maximum recursion depth exceeded" occurs when a function is being called so many times that the invocations exceed ...
Read more >
Python RecursionError: Maximum Recursion Depth Exceeded ...
A Python RecursionError exception is raised when the execution of your program exceeds the recursion limit of the Python interpreter.
Read more >
Python: Maximum Recursion Depth Exceeded [How to Fix It]
The maximum recursion depth in Python is 1000. To check it, call sys.getrecursionlimit() function. To change it, call sys.setrecursionlimit().
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found