I believe there is a corner case in which `os.access` will not do the right thing, hence the convoluted approach you see here...  just navigated the git history to no avail.  At the very least, this should use `realpath` of `p` to resolve any symbolic links.