I've been tinkering with the os module for a few days encountered this error. Can't seem to fix it. Here is an example:
import os
os.chdir('C:\\Users\\User\\Desktop')
os.rename('odin', 'ddin')
print (os.listdir())
And this is the error:
PermissionError: [WinError 5] Access is denied: 'odin' -> 'ddin'
Any help?