Skip to content
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

[Config] Prevent registering defaults for inaccessible identifiers #6290

Open
Flame442 opened this issue Feb 7, 2024 · 1 comment · May be fixed by #6459
Open

[Config] Prevent registering defaults for inaccessible identifiers #6290

Flame442 opened this issue Feb 7, 2024 · 1 comment · May be fixed by #6459
Assignees
Labels
Category: Core - API - Config This is related to the `redbot.core.config` module and `redbot.core.drivers` package. Status: In Progress There's a PR open to deal with this, or an org member is working on this internally Type: Enhancement Something meant to enhance existing Red features.

Comments

@Flame442
Copy link
Member

Flame442 commented Feb 7, 2024

What component of Red (cog, command, API) would you like to see improvements on?

Config

Describe the enhancement you're suggesting.

When registering defaults, we already check that the key is not a Python identifier, however we do not ever check whether the key is an existing attribute of Group or Value that will cause the __getattr__ method to never be called. Examples include:

  • default
  • defaults
  • identifier_data
  • is_value

And more!

A similar check should be added to ensure the key is actually going to be accessible, in order to prevent confusion.

Anything else?

No response

@Flame442 Flame442 added Type: Enhancement Something meant to enhance existing Red features. Status: Needs Discussion Needs more discussion. Category: Core - API - Config This is related to the `redbot.core.config` module and `redbot.core.drivers` package. labels Feb 7, 2024
@Kreusada
Copy link
Member

Kreusada commented Feb 8, 2024

+1 on this, would be an important addition especially with the default identifier as I see that getting used occasionally.

@Kreusada Kreusada added Status: PRs Welcome No one is currently assigned to this issue, but we'd be grateful if anyone made a PR. and removed Status: Needs Discussion Needs more discussion. labels Feb 8, 2024
@Kreusada Kreusada self-assigned this Oct 18, 2024
@Kreusada Kreusada added Status: In Progress There's a PR open to deal with this, or an org member is working on this internally and removed Status: PRs Welcome No one is currently assigned to this issue, but we'd be grateful if anyone made a PR. labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core - API - Config This is related to the `redbot.core.config` module and `redbot.core.drivers` package. Status: In Progress There's a PR open to deal with this, or an org member is working on this internally Type: Enhancement Something meant to enhance existing Red features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants