python - FTP OS.Walk goes into endless loop -


simply trying list files remote ftp folder contains 1 file (/public_html/data/ ['testfile.txt']). os.walk returns same filename on , on in endless loop until don't manually interrupt. code is:

import ftptool f a_host = f.ftphost.connect("someftpsite", user="user", password="pass") (dirname, subdirs, files) in a_host.walk("/public_html/data"):     print (dirname, files) 

output looks this:

/public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] 

/// manually interrupted @ point///

i don't know sure, have @ subdirs. ftp server may returning '.' on listing, , looking @ ftptool code, may recur on again , again.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -