-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Non-dict default with a dict value breaks Group.all #6648
Copy link
Copy link
Open
Labels
Category: Core - API - ConfigThis is related to the `redbot.core.config` module and `redbot.core.drivers` package.This is related to the `redbot.core.config` module and `redbot.core.drivers` package.Status: Needs DiscussionNeeds more discussion.Needs more discussion.Type: BugUnexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Metadata
Metadata
Assignees
Labels
Category: Core - API - ConfigThis is related to the `redbot.core.config` module and `redbot.core.drivers` package.This is related to the `redbot.core.config` module and `redbot.core.drivers` package.Status: Needs DiscussionNeeds more discussion.Needs more discussion.Type: BugUnexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
What Red version are you using?
3.5.20
What were you trying to do?
If a config key defaults to a non-dict value (ie, that key is not a Group), storing a dict to that key causes
scope.all()to error when trying to recursively fetch the default values for that dict's keys. I am only able to reproduce this issue for.all, directly accessing the key does not produce an error.It is unclear whether this should be considered a user error (mixing Groups and Values) and should be entirely prevented or if this should be considered a bug with Config and an additional check should be added in
nested_updateto handle this edge case.What did you expect to happen?
No error
What actually happened?
How can we reproduce this error?
Example of broken code
Example alternative that does not break (not mixing groups and values)
This issue applies to values at all depths
Anything else?
Found by unknown
Discussion for reference:
https://discord.com/channels/133049272517001216/160386989819035648/1467179303262486613
https://discord.com/channels/133049272517001216/171665724262055936/1467617566204891339