import uuid
import os.path
def processDirectory ( args, dirname, filenames ):
for filename in filenames:
print dirname,filename
print uuid.uuid5(dirname, filename)
os.path.walk(r'/usr/local/resin/', processDirectory, None )
2 回复
/usr/local/resin/ contrib
Traceback (most recent call last):
File "showFile.py", line 9, in <module>
os.path.walk(r'/usr/local/resin/', processDirectory, None )
File "/usr/local/lib/python2.7/posixpath.py", line 229, in walk
func(arg, top, names)
File "showFile.py", line 7, in processDirectory
print uuid.uuid5(dirname, filename)
File "/usr/local/lib/python2.7/uuid.py", line 552, in uuid5
hash = sha1(namespace.bytes + name).digest()
AttributeError: 'str' object has no attribute 'bytes'
运行报这个错误
添加回复
请先登陆