fs.errors

Defines the Exception classes thrown by PyFilesystem objects.

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)

An exception thrown when a FS could not be created.

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

Exception raised when a target destination already exists.

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

Exception raised when trying to make a directory that already exists.

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

Exception raises when a directory was expected.

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

Exception raised when a directory to be removed is not empty.

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

Exception raises when opening a file in exclusive mode.

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

Exception raises when a file was expected.

exception fs.errors.FilesystemClosed(msg=None)

An exception thrown when attempting to use a closed filesystem.

exception fs.errors.FSError(msg=None)

Base exception class for the FS module.

exception fs.errors.IllegalBackReference(path)

Exception raised when 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)

Exception raised when operations encounter storage space trouble.

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

The path contains characters that are invalid on this filesystem.

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

Base exception for fs paths that can’t be mapped on to the underlaying filesystem.

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

Raised when there is no URL for a given path.

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

Base exception class for errors associated with a specific operation.

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

Filesystem took too long.

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

Exception for errors to do with a path string.

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

Permissions error.

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

Exception raised when operations encounter remote connection trouble.

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

Base exception class for error associated with a specific resource.

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

Exception raised when a resource is the wrong type.

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

Exception raised when a resource can’t be used because it is locked.

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

Exception raised when a required resource is not found.

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

Exception raised for operations that are not supported by the FS.