[issue2551159] cl.filter fails if filterspec is None

John Rouillard <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from John Rouillard:

I am implementing basic charting for my tracker. It uses the results of
an index page and plots a pie graph by the first group parameter.
The description is at: https://wiki.roundup-tracker.org/QueryResultPieCharts

At one point I call:

   issues = cl.filter(matches, filterspec, sort = [('+', 'id')],
                      group = group)

If my index is displaying all items in the tracker, the filterspec is
None.  I then get the following traceback:

 roundup/hyperdb.py in _proptree(self=<hyperdb.Class "issue">,
        filterspec=None, exact_match_spec={}, sortattr=[('+',
        'priority'), ('+', 'id')], retr=0)

 1573         proptree = Proptree(self.db, self, '', self.getprops(), retr=retr)
 1574         for exact, spec in enumerate((filterspec, exact_match_spec)):
 1575             for key, v in spec.items():
      key = undefined, v = undefined, spec = None, global items = undefined
 1576                 keys = key.split('.')
 1577                 p = proptree

my claim is that a None filter should create a non-filtering proptree
that will return all issues when evaluated. But I am not sure if that
is valid later in the code.

Also I am using the sqlite backend.

I can work around this by setting the filterspec passed to cl.filter
to something that will evaluate to true for every issue. But I don't
know if there is such a filter.

The other alternative is to evaulate filterspec and if None call
something other than cl.filter, maybe cl.getnodeids() but that seems
to be a bandaid over the underlying problem.

Ralf you know this code better than I do, any thoughts on how to fix
this?

----------
messages: 7337
nosy: rouilj, schlatterbeck
severity: normal
status: new
title: cl.filter fails if filterspec is None
type: crash

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551159>
_________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.