【发布时间】:2021-11-07 07:08:05
【问题描述】:
这是我的代码:
gitlab_restore = tarfile.open("PATH/gitconf.tar")
gitlab_restore.extract("/opt/destination/path")
gitlab_restore.close()
当我运行它时发生了这个错误
2021-11-07 09:44:37,139 - root - ERROR - [Errno 13] Permission denied: '/opt/destination/path'
如何设置 tarfile 模块的 root 权限以在 /opt 上写入?
【问题讨论】:
标签: python extract root tar tarfile