#488: Fix OverflowError in /record/{recid} URLs
-----------------------+-----------------
 Reporter:  jcaffaro   |      Owner:
     Type:  defect     |     Status:  new
 Priority:  major      |  Milestone:
Component:  WebSearch  |    Version:
 Keywords:  intbitset  |
-----------------------+-----------------
 Accessing /record/{recid} URLs with long int recids (i.e. recid >
 sys.maxint) makes intbitset crash:

 {{{
 Traceback (most recent call last):
   File "/usr/lib/python2.6/dist-packages/invenio/webinterface_handler.py",
 line 376, in _handler
     return root._traverse(req, path, False, guest_p)
   File "/usr/lib/python2.6/dist-packages/invenio/webinterface_handler.py",
 line 237, in _traverse
     result = _check_result(req, obj(req, form))
   File "/usr/lib/python2.6/dist-
 packages/invenio/websearch_webinterface.py", line 453, in __call__
     (auth_code, auth_msg) = check_user_can_view_record(user_info,
 self.recid)
   File "/usr/lib/python2.6/dist-packages/invenio/search_engine.py", line
 285, in check_user_can_view_record
     restricted_collections = get_restricted_collections_for_recid(recid)
   File "/usr/lib/python2.6/dist-packages/invenio/search_engine.py", line
 244, in get_restricted_collections_for_recid
     return [row[0] for row in restricted_collections if recid in
 HitSet(row[1])]
   File "intbitset.pyx", line 265, in lib.intbitset.intbitset.__contains__
 (intbitset.c:2566)
 OverflowError: long int too large to convert to int
 Locals by frame, innermost last
 }}}

 Not sure if it would be better to support long int in intbitset
 (unnecessary?) or wash the input recid so that it is downsized to
 sys.maxint
 http://docs.python.org/library/stdtypes.html#numeric-types-int-float-long-
 complex

-- 
Ticket URL: <http://invenio-software.org/ticket/488>
Invenio <http://invenio-software.org>

Reply via email to