我在views.py文件中尝试以下代码:
def list_of_files(request):
obj = Hdfs()
hdfs_path = obj.abspath(path)
hd = obj.listdir_recursive(hdfs_path)
i=iter(hd)
print i.next()
return path
并收到以下错误:
[19/Aug/2016 23:50:24 +0000] middleware INFO Processing exception: isdir() takes exactly 1 argument (2 given): Traceback (most recent call last):
File "/home/dm10/Desktop/akira/akiradatabench-backend/build/env/local/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/dm10/Desktop/akira/akiradatabench-backend/build/env/local/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/transaction.py", line 371, in inner
return func(*args, **kwargs)
File "/home/dm10/Desktop/akira/akiradatabench-backend/apps/finder/src/finder/views.py", line 43, in list_of_files
print i.next()
File "/home/dm10/Desktop/akira/akiradatabench-backend/desktop/libs/hadoop/src/hadoop/fs/hadoopfs.py", line 233, in listdir_recursive
if self.isdir(path):
TypeError: isdir() takes exactly 1 argument (2 given)