---
source: crates/ruff/src/rules/pylint/mod.rs
---
invalid_envvar_value.py:3:11: PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
  |
3 | import os
4 | 
5 | os.getenv(1)  # [invalid-envvar-value]
  |           ^ PLE1507
6 | os.getenv("a")
7 | os.getenv("test")
  |

invalid_envvar_value.py:7:15: PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
   |
 7 | os.getenv("test")
 8 | os.getenv(key="testingAgain")
 9 | os.getenv(key=11)  # [invalid-envvar-value]
   |               ^^ PLE1507
10 | os.getenv(["hello"])  # [invalid-envvar-value]
11 | os.getenv(key="foo", default="bar")
   |

invalid_envvar_value.py:8:11: PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
   |
 8 | os.getenv(key="testingAgain")
 9 | os.getenv(key=11)  # [invalid-envvar-value]
10 | os.getenv(["hello"])  # [invalid-envvar-value]
   |           ^^^^^^^^^ PLE1507
11 | os.getenv(key="foo", default="bar")
12 | os.getenv(key=f"foo", default="bar")
   |

invalid_envvar_value.py:12:15: PLE1507 Invalid type for initial `os.getenv` argument; expected `str`
   |
12 | os.getenv(key=f"foo", default="bar")
13 | os.getenv(key="foo" + "bar", default=1)
14 | os.getenv(key=1 + "bar", default=1)  # [invalid-envvar-value]
   |               ^^^^^^^^^ PLE1507
15 | 
16 | AA = "aa"
   |


