Python:提取tar.gz时权限被拒绝

时间:2017-12-24 15:35:00

标签: python-2.7

我想提取文件夹中的所有tar.gz,但我得到[Errno 13]权限被拒绝。我经历过与问题相关的不同帖子,但没有任何帮助。甚至在tar.gz中提取特定成员也会产生同样的错误。有人可以帮助解决可能出错的问题吗?

I want to create a script for unzip (.tar.gz) file via (Python)

Python: Extracting specific files with pattern from tar.gz without extracting the complete file

Overwrite existing read-only files when using Python's tarfile

tar = tarfile.open(fname, "r:gz")
tar.extractall()
tar.close()

1 个答案:

答案 0 :(得分:0)

您是以本地用户身份运行吗?这是在Unix / Linux上运行吗?运行python脚本的帐户是否具有您尝试写入的文件夹的相应权限?