Chris-Dobbins / listdupes

A duplicate file checking utility for the command-line, written in Python with no external dependencies.
BSD 2-Clause "Simplified" License
2 stars 0 forks source link

Certain nested folders that contain files used by apps cause error, disappears on local search #25

Open geblerj opened 2 years ago

geblerj commented 2 years ago

When you try to run listdupes.py on folders that contain other folders with files being used by apps, you will get a TypeError: '<' not supported between instances of 'NoneType' and 'str' error (figure 1).

Fig 1

No error caused when you run listdupes.py on the same folder when the app isn't running (figure 2).

Fig 2

However, whenever you run listdupes.py on any of those nested folders even while the app is still running, the error goes away (figure 3).

Fig 3

(NOTE: there are 8 folders within IndexedDB, I just didn't include them all in the picture. None of them throws an error when listdupes is ran on them.)

Chris-Dobbins commented 2 years ago

Aaah that's interesting. I figured that TypeError was probably from a sorting operation, seeing this work really narrows it down.

Windows doesn't seem to like Python reading from that directory while Teams is reading from it. Python raises some kind of OSError object, listdupes catches it and stores info from the object, but the code I wrote to handle that assumes an OSError will always provide a file name. Turns out that's not true. So, if the OSError doesn't provide that directory's name, that would explain why attempting to sort the error info fails.

I wanna study a few parts of this, but I should have a likely fix for this ready for testing in a day or two.

Chris-Dobbins commented 2 years ago

@geblerj give this a try with v6.0.0-beta.4.1. My hope is this new version prevents the app from crashing with that TypeError, and allows it to log whatever error is being raised when reading IndexedDB. If that works can you post the listdupes_unread_files_log file here, I'm curious what the error is called.

geblerj commented 2 years ago

Hey, sorry I haven't been active recently, I've been busy with a move and work. Do you still want me to test it on 4.1 or the new 6 release?

geblerj commented 2 years ago

Just tried it with 4.1, and there was no error message, but here is the log listdupes_unread_files_log.txt

They're all folders except for the LOCK file (which is an empty file)