Previously ensure_basedir("hi.txt") would fail, since os.path.dirname("hi.txt") == "" and it wasn't clear what that meant. This PR makes it so that dirname == "" is treated as the current working directory, which is assumed to exist.
This choice allows downstream operations to work with paths like "hi.txt" without having to explicitly write "./hi.txt".
Previously
ensure_basedir("hi.txt")
would fail, sinceos.path.dirname("hi.txt") == ""
and it wasn't clear what that meant. This PR makes it so thatdirname == ""
is treated as the current working directory, which is assumed to exist.This choice allows downstream operations to work with paths like
"hi.txt"
without having to explicitly write"./hi.txt"
.