Ignore:
Timestamp:
Dec 25, 2015, 3:20:49 PM (4 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Explain why we change into the directory to check the existence

In case of virtual directories (#86) we may not see an existining
directory in a listing of the parent directory. Successfully changing
into a directory is a more reliable way to prove its existence.

With the implemented approach, we may still run into problems, if we
can't change into the directory even though it exists. Changing into a
directory `a` may fail if we don't have the permission to do so. In
that case, however, trying to make a child directory `a/b` may fail
anyway.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil/host.py

    r1618 r1630  
    650650                next_directory = (self.sep +
    651651                                  self.path.join(*directories[:index+1]))
     652                # If we have "virtual directories" (see #86), just
     653                # listing the parent directory won't tell us if a
     654                # directory actually exists. So try to change into the
     655                # directory.
    652656                try:
    653657                    self.chdir(next_directory)
Note: See TracChangeset for help on using the changeset viewer.