-
Notifications
You must be signed in to change notification settings - Fork 55
Maximum recursion depth exceeded in comparison error #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's not good. I can't see a problem with the code you posted. However, there are ways recursion can happen, for example if you set a state variable (eg, Also, in 0.32 there is a bug that the "trigger on any change" form of Or it could be a bug in pyscript. If so, trying to recreate the bug with as simple a test case as possible would be the goal. If you are willing to edit the code for pyscript, the first thing to do would be to get more information about where the internal error occurs. In
with
|
I did the change in the core py file and run test with both 0.32 and the new 1.0 and I get the same result but the trace shows where. I have put the definitions for the part that are included in this scenario. If we need more deep dive I can see if I can clone my HA instance and create a small test case.
|
This won't likely fix the issue, but the debugging data it provides might help resolve this. Instead of using In PyScript 1.0.0, do this: # state.set('input_number.accumulate_purchased_cost',temp)
input_number.accumulate_purchased_cost.set_value(value=temp) |
Thanks for the trace information. The recursion error appears to be inside This issue reports the same error from
As @dlashua points out, the better way to set an
This works in 1.0.0 too, and as @dlashua notes, in 1.0.0 you can also use the new short-form service-as-method call instead. The Setting aside the service call workaround, I don't yet see what attributes can cause
with this:
For 0.32, it's at line 108. |
Just a short feedback. input_number.accumulate_purchased_cost.set_value(value=temp) works ok. It has now running for more then 16h without any issue. I will do the change above and rerun the old way and see what will happen. |
I have now done the change in state.py and rerun the test and below statements now works ok. input_number.accumulate_purchased_cost = temp
state.set('input_number.accumulate_purchased_cost',temp) So with this change it look like everything works as expected. Which statement is the preferred one? |
Either should be fine, but for Thanks for checking that the attribute copy avoids the issue. I don't know what the root cause is. It's some sort of interaction between HASS and Python related to I'll commit a fix to add the attribute copy. |
I have this definition
This works for a while but after 1-2h I get "maximum recursion depth exceeded in comparison". I can't find the place where I have introduced a recursion call.
I have also tried
but the result is the same. Any insight what I have done wrong is appreciated.
Pyscript version: 0.32
debug log:
The text was updated successfully, but these errors were encountered: