Use os.path.exists to check for file existence, instead of "can we open this file for reading". Fixes #6710