Aug-28-2020, 08:33 PM
I'm receiving the below error when attempting to use
Any help with understanding why this is happening is much appreciated!
os.remove()
if a directory is found to exist. I've seen suggestions of running the script in an admin command prompt, that did not help. Relevant code snippet is also below. Any help with understanding why this is happening is much appreciated!
Error:Traceback (most recent call last):
File "C:\Users\REMOVED\Python Apps\My Progs\test5.py", line 38, in <module>
os.remove(final_dest)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\REMOVED\\Python Apps\\My Progs\\test_folder\\test_folder'
final_dest = os.path.join(dest, basename) if os.path.exists(final_dest): os.remove(final_dest) os.mkdir(final_dest) else: os.mkdir(final_dest)