HI,in my flask app i tried using multiple commands to delete a not empty directory:
shutil.rmtree(path)
The first says dir not empty which is strange because this cmd supposed to delete not empty dirs
os.remove(os.path.join(path,filename))
os.rmdir(path)
The two above raises this error OSError: [Errno 16] Device or resource busy
Third i tried executing linux commands with the help of os module
os.system('rm -rf "{}"'.format(path))
this only deletes the files but the dir is still present and to clarify these commands works perfectly in my computer before uploading the changes to pythonanywhere. and thank you in advance for taking time to read my question and trying to help