This was an oversight in #15654 since `os.path.isfile` checks that the something is a file in the current filesystem.