Ignore:
Timestamp:
Oct 28, 2017, 10:49:35 PM (2 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Handle infinite link chains in `isdir` and `isfile`

If `FTPHost.path.isdir` and `FTPHost.path.isfile` run into an infinite
link chain, return `False`, as the corresponding functions in
`os.path` do.

Before, `isdir` and `isfile` would raise a `PermanentError` with the
information that a recursive link chain was detected. This behavior,
in turn, led to a failure in `FTPHost.walk` (see ticket #107).

ticket: 107
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil/stat.py

    r1625 r1682  
    681681            if path in visited_paths:
    682682                # We had seen this path already.
    683                 raise ftputil.error.PermanentError(
     683                raise ftputil.error.RecursiveLinksError(
    684684                  "recursive link structure detected for remote path '{0}'".
    685685                  format(original_path))
Note: See TracChangeset for help on using the changeset viewer.