Bug report
Bug description:
Hi! 馃憢 My goal was to find the site-packages path for a venv on a machine (a 3rd-party SAST tool at work requires to know the site-packages location).
I'm probably misusing the site.getsitepackages function but nevertheless I thought that it shouldn't return a site-packages path before first checking it exists.
Thank you and have a good one!
import site
print(
site.getsitepackages(prefixes=["/a/non/existant/venv/path"])
)
['/a/non/existant/venv/path/lib/python3.14/site-packages']
https://docs.python.org/3.15/library/site.html#site.getsitepackages
CPython versions tested on:
3.15
Operating systems tested on:
macOS
Linked PRs
Bug report
Bug description:
Hi! 馃憢 My goal was to find the site-packages path for a venv on a machine (a 3rd-party SAST tool at work requires to know the site-packages location).
I'm probably misusing the
site.getsitepackagesfunction but nevertheless I thought that it shouldn't return a site-packages path before first checking it exists.Thank you and have a good one!
https://docs.python.org/3.15/library/site.html#site.getsitepackages
CPython versions tested on:
3.15
Operating systems tested on:
macOS
Linked PRs
site.getsitepackages()doesn't check for existance聽#156524