pylance-release
pylance-release copied to clipboard
`reportShadowedImports` doesn't report diagnostics for files that are overriding a `stdlib` module
Environment data
- Language Server version: 2024.6.1
- OS and version: XXX
- Python version (& distribution if applicable, e.g. Anaconda): XXX
Repro Steps
- Create a workspace in VSCode
- Set the
"reportShadowedImports": "error"
insettings.json
- Create 2 python files
sys.py
andmailbox.py
Expected behavior
I am expecting to see 2 diagnostics:
"xxx\folder1\mailbox.py" is overriding the stdlib module "mailbox"
and
"xxx\folder1\sys.py" is overriding the stdlib module "sys"
Actual behavior
Only getting 1 diagnostic:
"xxx\folder1\mailbox.py" is overriding the stdlib module "mailbox"
Only repros with certain stdlib
modules such as os
, json
, sys