【发布时间】:2011-11-05 21:31:57
【问题描述】:
我想更改当前目录树中所有文件的文件权限。我正在尝试打开每个目录并打开文件并使用os.chmod() 更改权限,但出现错误。
import os
import stat
for files in os.walk('.'):
os.chmod(files,stat.S_IXGRP)
我得到的错误是:
File "delhis.py", line 4, in ? os.chmod(files,stat.S_IXGRP) TypeError: coercing to Unicode: need string or buffer, tuple found
【问题讨论】:
-
请告诉我们你得到了什么。
-
@All 这是我得到的错误:文件“delhis.py”,第 4 行,在? os.chmod(files,stat.S_IXGRP) TypeError: coercing to Unicode: need string or buffer, tuple found
标签: python