Allow to remove a remaining file created during a failed add-on removal process (#17692)
Summary of the issue:
If you try to remove an add-on while the folder containing its files is opened in Windows Explorer, the removal fails and at next restart NVDA warns you of it. At subsequents restarts, the following error appears in the log:
ERROR - addonHandler.removeFailedDeletion (10:17:51.026) - MainThread (2736):
Failed to delete path C:\Users\Cyrille\AppData\Roaming\nvda\addons\tmptvtvvco8.delete, try removing manually
It's because this path was a temp file which could not be os.replace'd by the add-on's folder during the removal process since this folder was opened in Windows Explorer. Then at subsequent restarts, NVDA has code to remove such paths, but it only handles the case where this path is a folder, not a file.
Description of user facing changes
No more error logged forever after a failed add-on deletion attempt. and no need to clean up manually remaining ".delete" files.
Description of development approach
In addition to folder case, also handle file case in removeFailedDeletion.
No change log for such a little fix.