I am creating a small utility that can be used to download and install updates for games that don't run through storefronts that automate the process. For the most part, it's been working perfectly!
As part of the testing, we've discovered that hidden files seem to confound the extraction process. It consistently results in this error:
PermissionError: [Errno 13] Permission denied: 'E:\path\hidden.txt'
I wasn't able to find much in the way of hidden files and Python interacting, but I did find this old question noting that Python itself is unable to handle hidden files in "standard" modes (like r, w, etc) due to how the underlying Win32 API is used. I tried using a similar solution for my code but had no luck. I dug a bit into the zipfile module itself to see what I could find and noticed this:
mode: The mode can be either read 'r', write 'w', exclusive create 'x', or append 'a'.
Am I right in thinking that this means there's no way to proceed from here using the zipfile module? In any case, any suggestions on how to proceed are certainly welcome!
The relevant sections of code I'm using is as follows:
updateFile = zipfile.ZipFile(updateTarget, 'r')
updateFile.extractall()
updateFile.close()
Using this as is results in a PermissionError. I've also tried the other three available modes. Ideally, the unzip process would proceed as normally and overwrite the hidden files.
Edit 1: Running as administrator has no effect on the process.
Edit 2: A bit more experimenting revealed that as long as the original file (the one to be overwritten) is not hidden, the extraction proceeds smoothly, though the resultant file will not be hidden (even though the downloaded archive's version of the file is set to hidden).
Edit 3: Per Thomas' suggestion in the comments, I looked into it using Process Monitor which I have no experience with so. I have no clue what I'm looking at really other than the process failed. See screenshot below: