You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prospector cannot run if a directory not owned by the current user is in the working directory or a subdirectory
This can happen if a docker volume is in the current working directory, for example.
To reproduce:
$ sudo mkdir root-owned
$ sudo chmod 700 root-owned/
$ prospector
Traceback (most recent call last):
File "/tmp/test/venv/bin/prospector", line 8, in <module>
sys.exit(main())
File "/tmp/test/venv/lib/python3.9/site-packages/prospector/run.py", line 173, in main
config = ProspectorConfig()
File "/tmp/test/venv/lib/python3.9/site-packages/prospector/config/__init__.py", line 30, in __init__
self.libraries = self._find_used_libraries(self.config, self.profile)
File "/tmp/test/venv/lib/python3.9/site-packages/prospector/config/__init__.py", line 169, in _find_used_libraries
for found_dep in autodetect_libraries(self.workdir):
File "/tmp/test/venv/lib/python3.9/site-packages/prospector/autodetect.py", line 93, in autodetect_libraries
libraries = find_from_path(path)
File "/tmp/test/venv/lib/python3.9/site-packages/prospector/autodetect.py", line 51, in find_from_path
names |= find_from_path(item_path)
File "/tmp/test/venv/lib/python3.9/site-packages/prospector/autodetect.py", line 46, in find_from_path
for item in os.listdir(path):
PermissionError: [Errno 13] Permission denied: '/tmp/test/root-owned'
Autodetection and also finding python files breaks. Directories which are not readable should be either skipped, or a warning issued, and if specified in the --ignore-paths command line, should be ignored before trying to inspect them.
The text was updated successfully, but these errors were encountered:
carlio
changed the title
[BUG] Prospector cannot run if a directory not owned by the current user is in the working directory or a subdirectory
[BUG] Prospector cannot run if the current user cannot read all directories in the workdir
Feb 25, 2022
Prospector cannot run if a directory not owned by the current user is in the working directory or a subdirectory
This can happen if a docker volume is in the current working directory, for example.
To reproduce:
Autodetection and also finding python files breaks. Directories which are not readable should be either skipped, or a warning issued, and if specified in the
--ignore-paths
command line, should be ignored before trying to inspect them.The text was updated successfully, but these errors were encountered: