我在Windows 8.1上使用shutdownil python模块在Python版本3.7.3上遇到此错误。 为什么rmtree尝试访问Recycle而不是我使用它的路径?
>>> import shutil
>>> shutil.rmtree('/')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python373\lib\shutil.py", line 513, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Python373\lib\shutil.py", line 392, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Python373\lib\shutil.py", line 392, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Python373\lib\shutil.py", line 374, in _rmtree_unsafe
onerror(os.scandir, path, sys.exc_info())
File "C:\Python373\lib\shutil.py", line 371, in _rmtree_unsafe
with os.scandir(path) as scandir_it:
PermissionError: [WinError 5] Access is denied: '/$Recycle.Bin\\S-1-5-19'