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.

Infinite Recursion possible in 2.4

See original GitHub issue

We have a condition_dict containing the following function:

def need_further_steps(wizard):
    data = wizard.get_cleaned_data_for_step("0") or {}
    if data.get("no_invoices_needed", False):
        return False
    return True

The call to WizardView.get_cleaned_data_for_step then calls WizardView.get_form, which used to reference self.form_list, but the following commit changes this to self.get_form_list(), which then calls the user-supplied condition_dict functions, which then calls our need_further_steps function above, which calls WizardView.get_cleaned_data_for_step, and so on ad infinitum. https://github.com/jazzband/django-formtools/commit/533a83053deab2adeb72de079e813aae78b03c1a

Perhaps our custom condition function is bad, but it doesn’t seem too unreasonable?

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:37 (21 by maintainers)

github_iconTop GitHub Comments

5reactions
jsmacommented, Nov 17, 2022

Please revert 533a83053, which introduced a major bug and was not a proper solution for the new feature request (to dynamically add forms that aren’t in the initial form_list). For those that require this new feature, please provide a working example of your use cases and how you were doing this prior to 2.4. A proper API needs to be created and tested for this new feature request, without breaking existing documented functionality. That has not been done yet. A proper API shouldn’t require any hacks around infinite recursion errors, it should be designed so these errors are impossible.

2reactions
schinckelcommented, Nov 22, 2022

The latter - to come up with a proper solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite Recursion with Jackson JSON and Hibernate JPA issue
Since Jackson 1.6 you can use two annotations to solve the infinite recursion problem without ignoring the getters/setters during serialization: ...
Read more >
Adding package to devShell causes `error: stack overflow ...
The problem is that it's hard to give a useful error message in case of a stack overflow. You can't throw an exception...
Read more >
Out of memory. The likely cause is an infinite recursion within ...
I'm trying to apply the secant method to the function defined in fv, but I keep getting the out of memory message. ·...
Read more >
Appendix A Debugging - Green Tea Press
Infinite Recursion. Most of the time, infinite recursion causes the program to run for a while and then produce a Maximum recursion depth...
Read more >
What is infinite recursion? - Quora
Infinite recursion happens when a recursive function fails to stop recursing. Unless the design specification for the function says it should abuse resources ......
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