PermissionError: [WinError 5] Access is denied while `shutil.rmtree(id)`
Barbara reported the following error when executing get_openneuro_info.py
on Windows.
C:\Users\User\Documents\Uni\Psychologie\Praktikum_Ontology\Python\openneuro-collector>get_openneuro_info.py datasets.txt
Traceback (most recent call last):
File "C:\Users\User\Documents\Uni\Psychologie\Praktikum_Ontology\Python\openneuro-collector\get_openneuro_info.py", line 149, in <module>
main(sys.argv)
File "C:\Users\User\Documents\Uni\Psychologie\Praktikum_Ontology\Python\openneuro-collector\get_openneuro_info.py", line 88, in main
shutil.rmtree(id)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 740, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 613, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 613, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 613, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 618, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 616, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Zugriff verweigert: 'ds000001\\.git\\objects\\pack\\pack-42dedf37d1a55d77a74b526f0c40e02a6bb48db9.idx'