This is the error: Permission Error: Copying of text from this document is not allowed.
I am opening a .exe file on windows. So regular try except block does not seem to catch it. Neither does OSError.
This is the error: Permission Error: Copying of text from this document is not allowed.
I am opening a .exe file on windows. So regular try except block does not seem to catch it. Neither does OSError.
I solved it with the following:
try:
"""code here"""
except subprocess.CalledProcessError:
"""unlock files and try again"""
Try
exception PermissionError
Raised when trying to run an operation without the adequate access rights - for example filesystem permissions. Corresponds to errno EACCES and EPERM.
If you specified irrelevant Exception while trying to catch permission error, I wouldn't be surprised they it is caught