`uiop/filesystem` functions pass string arguments to `cl:pathname` instead of `ensure-pathname`
It's unclear to me whether this is intended behavior or not, but in either case it appears undocumented:
If you have a directory named /[foo
, which is a valid unix path but an invalid logical-pathname
, then (uiop:subdirectories "/[foo")
will signal an error (of type sb-kernel:namestring-parse-error
on sbcl), whereas (uiop:subdirectories (uiop:ensure-pathname "/[foo"))
will work without issue.
This appears to be because various functions e.g. uiop:ensure-absolute-pathname
have cond
clauses like
((stringp path) (ensure-absolute-pathname (pathname path) defaults on-error))
which calls cl:pathname
on string arguments. I believe this to be a bug.