Open
Description
Bug report
realpath
tests if a file is a symlink using islink
, which just returns False
if the file does not exist. But then uses readlink
a bit later to test the source of the link, which throws an exception if the file does not exists. If the file is a symlink and is deleted between islink
and readlink
, we get a spurious exception.
This reproduces the error using code copy-pasted from Python 3.9: https://gist.github.com/bitonic/e0977aaa674523a9ffe0e77a96cd6cc7 .
Your environment
- CPython 3.9
- ArchLinux x86_64