FrostyX / tracer

Tracer finds outdated running applications in your system
GNU General Public License v2.0
82 stars 24 forks source link

Make sure Collection.sorted doesn't traceback for None values #169

Closed FrostyX closed 3 years ago

FrostyX commented 3 years ago

Fix #151 Fix #156 RHBZ 1958779 RHBZ 1940718 MGABZ 28577

I was trying to fix this issue several times already and the best summary I could write was this one

https://github.com/FrostyX/tracer/issues/151#issuecomment-660066481

It doesn't any sense to me since the problematic line is

self.args.applications.with_helpers().exclude_types(types).sorted("helper")

which first filters only applications that have non-None helper and only those try to sort, i.e. when sorting there shouldn't be any None values.

Anyway, the issue is real and occurs to many people, so I am reworking the sorting function and making sure it doesn't traceback when some helper is None. I have no idea what are the problematic applications and how they will be displayed in the output but I guess everything is better than a traceback. And maybe it will help us move closer to a proper solution.

MichaelRiss commented 3 years ago

Thank you for your effort and sorry for not being able to bring forth a proper reproducible example. I kept seeing these errors from time to time, but without any discernible pattern.

FrostyX commented 3 years ago

sorry for not being able to bring forth a proper reproducible example. I kept seeing these errors from time to time, but without any discernible pattern.

Don't worry, I wasn't able to find one either. I hope the proposed solution fixes it and we won't be seeing the error anymore.