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

Misleading documentation for uncapitalized-environment-variables (SIM112) #14353

Open
Zeckie opened this issue Nov 15, 2024 · 0 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@Zeckie
Copy link

Zeckie commented Nov 15, 2024

https://docs.astral.sh/ruff/rules/uncapitalized-environment-variables/

On Windows, environment variables are case-insensitive and are converted to uppercase, so using lowercase environment variables can lead to subtle bugs.

The current wording is a little vague, and makes it sound like it is Windows that converts the environment variable names to uppercase. In reality, Windows preserves the case of environment variables. Some environment variables that are built into windows use mixed / lower case (for example Path, SystemRoot, windir). The limitation / case conversion seems to be in os.environ (more in python/cpython#73010).

Also, it doesn't explain or give any examples of how using lowercase variable names might lead to the "subtle bugs".

@MichaReiser MichaReiser added the documentation Improvements or additions to documentation label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants