If you want to check whether two file paths are the same, use Path.samefile().
Path.samefile()
My previous tips on pathlib.