According to the doc, mkpath(path) should always return path. However, currently (1.10.4) it returns dirname(path) if isdirpath(path), e.g., the / is removed if path ends with /.
Create all intermediate directories in the path as required. Directories are created with
the permissions mode which defaults to 0o777 and is modified by the current file
creation mask. Unlike mkdir, mkpath does not error if path (or parts of it)
already exists. However, an error will be thrown if path (or parts of it) points to an
existing file. Return path.
I would like to know if there is anyone who wants to keep the current behavior. If not, I will create a PR to fix it since it brings some trouble to me :)
According to the doc,
mkpath(path)
should always returnpath
. However, currently (1.10.4) it returnsdirname(path)
ifisdirpath(path)
, e.g., the/
is removed ifpath
ends with/
.I would like to know if there is anyone who wants to keep the current behavior. If not, I will create a PR to fix it since it brings some trouble to me :)
It will not break cases like #27071 , since