I am trying to unzip a number of files that are password protected but I keep getting some permission error. I have tried to perform this operation running vscode as an administrator but I am still getting the same error.
Here is the code:
input_file = ".\\pa-dirty-price-crawler\\folders"
import zipfile
with zipfile.ZipFile(input_file, 'r') as zip_ref:
zip_ref.extractall(input_file, pwd=b'qpsqpwsr')
Here is the error:
Traceback (most recent call last):
File "c:/Users/usr/workspace/pa-dirty-price-crawler/src/outlook.py", line 23, in <module>
with zipfile.ZipFile(input_file, 'r') as zip_ref:
File "C:\ProgramData\Anaconda3\lib\zipfile.py", line 1240, in __init__
self.fp = io.open(file, filemode)
PermissionError: [Errno 13] Permission denied: '.\\pa-dirty-price-crawler\\folders'
I do not know of another library that can do this same operation but if anyone has suggestions in regards to getting this fixed I would really appreciate it.
Edit:
When I try to specify the entire file path name as so:
input_file = "C:\\Users\\usr\\workspace\\pa-dirty-price-crawler\\folders"
import zipfile
with zipfile.ZipFile(input_file, 'r') as zip_ref:
zip_ref.extractall(pwd=b'qpsqpwsr')
I still get this error:
Traceback (most recent call last):
File "c:/Users/usr/workspace/pa-dirty-price-crawler/src/outlook.py", line 23, in <module>
with zipfile.ZipFile(input_file, 'r') as zip_ref:
File "C:\ProgramData\Anaconda3\lib\zipfile.py", line 1240, in __init__
self.fp = io.open(file, filemode)
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\usr\\workspace\\pa-dirty-price-crawler\\folders'