Use the method 'del(..)' instead of deleting the file directly.