PDA

View Full Version : [ViX_Misc] Subtle Trashcan bug when file not found in loop of found files



ahlstart
30-10-22, 22:02
(Copied from github issue #796)
In enigma2/lib/python/Tools/Trashcan.py, line 185 in class "CleanTrashTask" method "work" accesses the variable st regardless of whether setting it with "st = os.stat(fn)" on line 182 succeeds or not. The exception (FileNotFoundError) is caught but only a diagnostic is printed, the program logic keeps on as if nothing bad had happened. Adding "continue" on line 184.5 would probably solve this. </copy>

Revision 011b50 had "pass" on line 185 but it does not seem to be the correct keyword.
I created a testbed program and it seemed to recover correctly with "continue", going immediately to next file and avoiding use of uninitialised variable "st".