Skip to content

invalid-envvar-value does not support StrEnum #10840

@stdedos

Description

@stdedos

Bug description

import os

from enum import StrEnum


class Env(StrEnum):
    """Env"""

    LOG_LEVEL = "LOG_LEVEL"
    """Set the log level"""


# pylint: disable-next=invalid-envvar-name # Probably false-positive: https://github.com/pylint-dev/pylint/issues/10840
os.getenv(Env.LOG_LEVEL, "INFO")

Configuration

Command used

uv run pylint a.py

Pylint output

************* Module a
a.py:13:0: W0012: Unknown option value for 'disable-next', expected a valid pylint message and got 'invalid-envvar-name' (unknown-option-value)
a.py:14:0: E1507: os.getenv does not support a.Env.LOG_LEVEL type argument (invalid-envvar-value)

-----------------------------------
Your code has been rated at 0.00/10

Expected behavior

Nothing. StrEnum or <enum>.name resolve to str, which are valid type arguments

Pylint version

pylint 4.0.4
astroid 4.0.3
Python 3.12.3 (main, Jan  8 2026, 11:30:50) [GCC 13.3.0]

OS / Environment

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs decision 🔒Needs a decision before implemention or rejection

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions