Roundup Tracker - Issues

Issue 2167369

classification
Class.filter() fails if filterspec contains int value
Type: Severity: normal
Components: Database Versions:
process
Status: closed fixed
:
: richard : richard, rouilj, techtonik
Priority: normal :

Created on 2008-10-15 03:45 by techtonik, last changed 2016-07-11 02:14 by rouilj.

Messages
msg2596 Author: [hidden] (techtonik) Date: 2008-10-15 03:45
exception : 'int' object has no attribute 'split'
Python 2.5.1
E:\ENV\Python25\python.exe

The attributes are:

q:\roundup\backends\back_anydbm.py in _filter(self=<hyperdb.Class "nonce">, search_matches=None, filterspec={'salt': '3Ap6rC', 'server_url': '', 'timestamp': 1224044595}, proptree=proptree: proptree: timestamp proptree: salt proptree: server_url proptree: id, num_re=<_sre.SRE_Pattern object at 0x015700D0>)
 1646             elif isinstance(propclass, hyperdb.Number):
 1647                 if type(v) != type([]):
 1648                     v = v.split(',')
      v = 1224044595, global split = undefined
 1649                 l.append((OTHER, k, [float(val) for val in v]))


nonce Class is described as follows:
Class(db, "nonce",
                server_url = String(),
                timestamp = Number(),
                salt = String())
msg5833 Author: [hidden] (rouilj) Date: 2016-07-11 02:14
This is fixed in current code by handling the exception:

            elif isinstance(propclass, hyperdb.Number):
                if type(v) != type([]):
                    try :
                        v = v.split(',')
                    except AttributeError :
                        v = [v]
                l.append((OTHER, k, [float(val) for val in v]))

looks like it's part of:

changeset:   4364:0e81742d0e2f
user:        Ralf Schlatterbeck <...>
date:        Fri Mar 05 14:22:34 2010 +0000
files:       roundup/backends/back_anydbm.py test/db_test_base.py
description:
- unify number searching across backends
History
Date User Action Args
2016-07-11 02:14:04rouiljsetstatus: open -> closed
resolution: fixed
messages: + msg5833
nosy: + rouilj
2008-10-15 03:45:23techtonikcreate