File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,19 +141,19 @@ def _path_encoder(v: PathLike[str] | str) -> str:
141141
142142
143143def _path_validator (v : PathLike [str ] | str ) -> None :
144- """Validate that a given path exists and is a file.
144+ """Validate that a given path exists and is a file or directory .
145145
146146 :param v: The path to validate, which will be converted to a Path object
147147 :type v: PathLike[str] | str
148148 :raises PathError: If the path does not exist
149- :raises PathError: If the path exists but is not a file
149+ :raises PathError: If the path exists but is not a file or directory
150150 """
151151 p = Path (v )
152152 if not p .exists ():
153153 err = f"path does not exist: { p } "
154154 raise PathError (err )
155- if not p .is_file ():
156- err = f"path is not a file: { p } "
155+ if not p .is_file () and not p . is_dir () :
156+ err = f"path is not a file/directory : { p } "
157157 raise PathError (err )
158158
159159
You can’t perform that action at this time.
0 commit comments