Unfortunately this did not seem to work. I implemented your suggestions but my script fails in the exact same way i.e. it gets to a file which it cannot read but the is_readable function returns that it is readable and my program proceeds to try and execute code which can't possibly succeed i.e. diffing two files, one of which it can't read.
Comment on Re^2: How to test if a file is readable on Win64?
If you SetErrorMode to 2 you won't get error popups that interrupt the program (but you won't be able to read file either)
if you use cacls you can see or change the ACL (permissions) if that is a problem