I use shutil.copy to copy files from one place to another. If a file with the same name already exists at the destination location, it is usually normal and overwritten. However, if the destination is read-only, it throws an error that is prohibited by permission.
What is the most elegant way to handle this? Is there any other shutil function that will deal with the permissions issue, or should I check permissions for the file I am copying ever?
source share