Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7530459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:55:02+00:00 2026-05-30T04:55:02+00:00

Python newb…beware! I am trying to recursively ftp some files. In the script below,

  • 0

Python newb…beware!

I am trying to recursively ftp some files. In the script below, I get an error:

Traceback (most recent call last):
  File "dump.py", line 7, in <module>
    for root,dirs,files in recursive:
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftputil.py", line 880, in walk
    if self.path.isdir(self.path.join(top, name)):
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftp_path.py", line 133, in isdir
    path, _exception_for_missing_path=False)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftputil.py", line 860, in stat
    return self._stat._stat(path, _exception_for_missing_path)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftp_stat.py", line 624, in _stat
    _exception_for_missing_path)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftp_stat.py", line 578, in __call_with_parser_retry
    result = method(*args, **kwargs)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftp_stat.py", line 543, in _real_stat
    lstat_result = self._real_lstat(path, _exception_for_missing_path)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftp_stat.py", line 502, in _real_lstat
    for stat_result in self._stat_results_from_dir(dirname):
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftp_stat.py", line 419, in _stat_results_from_dir
    lines = self._host_dir(path)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftp_stat.py", line 411, in _host_dir
    return self._host._dir(path)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftputil.py", line 811, in _dir
    descend_deeply=True)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftputil.py", line 578, in _robust_ftp_command
    self.chdir(path)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftputil.py", line 603, in chdir
    ftp_error._try_with_oserror(self._session.cwd, path)
  File "/usr/local/lib/python2.6/site-packages/ftputil/ftp_error.py", line 146, in _try_with_oserror
    raise PermanentError(*exc.args)
ftputil.ftp_error.PermanentError: 550 /usr/local/web: No such file or directory
Debugging info: ftputil 2.6, Python 2.6.5 (linux2)

Exited: 256

I have no idea what that means. However, when I change the directory to “/path/dir2” it works and prints out “file.txt”.

Here’s my directory structures:

/path/dir1/another/file.txt # I get the above error with this path
/path/dir2/another/file.txt # this works fine, even though the directories have the same structure

My script:
import ftputil

ftp = ftputil.FTPHost('ftp.site.com','user','pass')
recursive = ftp.walk("/path/dir1",topdown=True,onerror=None)
for root,dirs,files in recursive:
 for name in files:
  print name
ftp.close
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:55:03+00:00Added an answer on May 30, 2026 at 4:55 am

    Is there a symblolic link in /path/dir1/ that points back to /usr/local/web?

    If you want to step over this error you could put a try catch block in and log…

    ftp = ftputil.FTPHost('ftp.site.com','user','pass')
    try:
        recursive = ftp.walk("/path/dir1",topdown=True,onerror=None)
        for root,dirs,files in recursive:
             for name in files:
                   print name
    except Error e:
       print "Error: %s occurred" % (e)
    ftp.close
    

    the above will catch all errors. you can also import the specific error your getting and do this…

    import ftputil.ftp_error.PermanentError as PermanentError
    ftp = ftputil.FTPHost('ftp.site.com','user','pass')
    try:
        recursive = ftp.walk("/path/dir1",topdown=True,onerror=None)
        for root,dirs,files in recursive:
             for name in files:
                  print name
    except PermanentError e:
       print "Permanent Error: %s occurred" % (e)
    ftp.close
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Python newb here. I m trying to count the number of letter as in
I'm a python newb and am having trouble groking nested list comprehensions. I'm trying
Newb programmer here, I'm most familiar with Python but also learning C and Java,
Python beginner >>> import oauth2 Traceback (most recent call last): File , line 1,
Python newb here looking for some assistance... For a variable number of dicts in
Python newbie here. I'm writing a script that can dump some output to either
Alright, I'll preface this with the fact that I'm a GTK and Python newb,
Python's convention is that variables are created by first assignment, and trying to read
I'm a newb to Python so apologies in advance if my question looks trivial.
Python: How to get the caller's method name in the called method? Assume I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.