Catch corner case where the path we expect to open, as a file, is actually
a directory.