You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to retrieve an env variable from the dapr.config.settings class. If the variable is not present, an attribute error should be issued.
E.g.
fromdapr.confimportsettingsx=settings.APP_PORT# Not exist -> throw recursion error
Actual Behavior
When the variable not exists, a maximum recursion error is thrown and not a attribute error. This happens because the settings class use getattr method to lookup for non existing env variables. Within the method, getattr(..) is called, which caused a new recursive call.
The problem can be easily solved by removing the getattr method.
Steps to Reproduce the Problem
Test example code.
Release Note
RELEASE NOTE: Fix RecursionError when calling non-existing env variable from settings class
The text was updated successfully, but these errors were encountered:
I updated the open PR for this issue to instead throw an AttributeError whenever you try to access a property that is not implemented.
EDIT: Your issue was filed correctly - I got confused because I looked at the PR that was opened first (thought it was from you, but was from someone else). The updates I made to that PR should give you exactly what you want -- an AttributeError for properties that don't exist / are not supported.
Expected Behavior
I want to retrieve an env variable from the dapr.config.settings class. If the variable is not present, an attribute error should be issued.
E.g.
Actual Behavior
When the variable not exists, a maximum recursion error is thrown and not a attribute error. This happens because the settings class use getattr method to lookup for non existing env variables. Within the method, getattr(..) is called, which caused a new recursive call.
The problem can be easily solved by removing the getattr method.
Steps to Reproduce the Problem
Test example code.
Release Note
RELEASE NOTE:
Fix RecursionError when calling non-existing env variable from settings class
The text was updated successfully, but these errors were encountered: