Exception classes thrown by filesystem operations.

Errors relating to the underlying filesystem are translated in to one of the following exceptions.

All Exception classes are derived from FSError which may be used as a catch-all filesystem exception.

exception fs.errors.CreateFailed(msg=None, exc=None)

Bases: fs.errors.FSError

Filesystem could not be created.

exception fs.errors.DestinationExists(path, exc=None, msg=None)

Bases: fs.errors.ResourceError

Target destination already exists.

exception fs.errors.DirectoryExists(path, exc=None, msg=None)

Bases: fs.errors.ResourceError

Directory already exists.

exception fs.errors.DirectoryExpected(path, exc=None, msg=None)

Bases: fs.errors.ResourceInvalid

Operation only works on directories.

exception fs.errors.DirectoryNotEmpty(path, exc=None, msg=None)

Bases: fs.errors.ResourceError

Attempt to remove a non-empty directory.

exception fs.errors.FileExists(path, exc=None, msg=None)

Bases: fs.errors.ResourceError

File already exists.

exception fs.errors.FileExpected(path, exc=None, msg=None)

Bases: fs.errors.ResourceInvalid

Operation only works on files.

exception fs.errors.FilesystemClosed(msg=None)

Bases: fs.errors.FSError

Attempt to use a closed filesystem.

exception fs.errors.FSError(msg=None)

Bases: exceptions.Exception

Base exception for the fs module.

exception fs.errors.IllegalBackReference(path)

Bases: exceptions.ValueError

Too many backrefs exist in a path.

This error will occur if the back references in a path would be outside of the root. For example, "/foo/../../", contains two back references which would reference a directory above the root.


This exception is a subclass of ValueError as it is not strictly speaking an issue with a filesystem or resource.

exception fs.errors.InsufficientStorage(path=None, exc=None, msg=None)

Bases: fs.errors.OperationFailed

Storage is insufficient for requested operation.

exception fs.errors.InvalidCharsInPath(path, msg=None)

Bases: fs.errors.InvalidPath

Path contains characters that are invalid on this filesystem.

exception fs.errors.InvalidPath(path, msg=None)

Bases: fs.errors.PathError

Path can’t be mapped on to the underlaying filesystem.

exception fs.errors.MissingInfoNamespace(namespace)

Bases: exceptions.AttributeError

An expected namespace is missing.

exception fs.errors.NoSysPath(path, msg=None)

Bases: fs.errors.PathError

The filesystem does not provide sys paths to the resource.

exception fs.errors.NoURL(path, purpose, msg=None)

Bases: fs.errors.PathError

The filesystem does not provide an URL for the resource.

exception fs.errors.OperationFailed(path=None, exc=None, msg=None)

Bases: fs.errors.FSError

A specific operation failed.

exception fs.errors.OperationTimeout(path=None, exc=None, msg=None)

Bases: fs.errors.OperationFailed

Filesystem took too long.

exception fs.errors.PathError(path, msg=None)

Bases: fs.errors.FSError

Base exception for errors to do with a path string.

exception fs.errors.PermissionDenied(path=None, exc=None, msg=None)

Bases: fs.errors.OperationFailed

Not enough permissions.

exception fs.errors.RemoteConnectionError(path=None, exc=None, msg=None)

Bases: fs.errors.OperationFailed

Operations encountered remote connection trouble.

exception fs.errors.RemoveRootError(path=None, exc=None, msg=None)

Bases: fs.errors.OperationFailed

Attempt to remove the root directory.

exception fs.errors.ResourceError(path, exc=None, msg=None)

Bases: fs.errors.FSError

Base exception class for error associated with a specific resource.

exception fs.errors.ResourceInvalid(path, exc=None, msg=None)

Bases: fs.errors.ResourceError

Resource has the wrong type.

exception fs.errors.ResourceLocked(path, exc=None, msg=None)

Bases: fs.errors.ResourceError

Attempt to use a locked resource.

exception fs.errors.ResourceNotFound(path, exc=None, msg=None)

Bases: fs.errors.ResourceError

Required resource not found.

exception fs.errors.ResourceReadOnly(path, exc=None, msg=None)

Bases: fs.errors.ResourceError

Attempting to modify a read-only resource.

exception fs.errors.Unsupported(path=None, exc=None, msg=None)

Bases: fs.errors.OperationFailed

Operation not supported by the filesystem.