[issue2551250] Weird error with PrioList of detectors

Ralf Schlatterbeck <[email protected]> Wed, 21 Dec 2022 18:36:05 +0000
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from Ralf Schlatterbeck:

I've recently moved a production tracker from python2 to python3.
Now I'm getting *occasionally* a Traceback

TypeError: '<' not supported between instances of 'function' and 'function'

when sorting detectors (auditors and reactors).
These are using a PrioList object which sorts on demand before iterating over auditors and/or reactors.
The idea there is that detectors can have a priority.
The objects in the list are 3-tuples with prio, name, function.
This should never try to look at the function unless we have two entries with the same prio (the default is 100 and this is seldomly set explicitly so they may all be the same) and name.

Since this is quite urgent for me I'll try to fix this by allowing a key function to be passed to the PrioList. This would then be something like "lambda x: x[:2]" so that we never compare function objects. This is probably the right thing to do.

What I find very confusing is that this should happen everytime when sorting the detectors. It doesn't.

----------
assignee: schlatterbeck
components: Interface
keywords: python3
messages: 7693
nosy: rouilj, schlatterbeck
severity: urgent
status: new
title: Weird error with PrioList of detectors
type: crash
versions: devel

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551250>
_________________________________________________