#356: BibMerge: IndexError while comparing records
----------------------+-----------------------------------------------------
Reporter: jlavik | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Component: BibMerge | Version:
Keywords: |
----------------------+-----------------------------------------------------
Using {{{record_diff(...)}}} in {{{bibmerge_differ.py}}} generates an
IndexError when comparing two records in BibRecord format. This happens in
the {{{compare_subfields(...)}}} function:
{{{
--Call--
> /usr/lib64/python2.4/site-
packages/invenio/bibmerge_differ.py(169)compare_subfields()
-> def compare_subfields(subfield1, subfield2):
(Pdb) subfield1
[('x', '2009-12-14')]
(Pdb) subfield2
[('x', '2009-12-14')]
.....
--Return--
> /usr/lib64/python2.4/site-
packages/invenio/bibmerge_differ.py(176)compare_subfields()->None
-> return compare_strings(subfield1[1], subfield2[1])
(Pdb) s
IndexError: 'list index out of range'
}}}
To cut a long story short, the call to {{{compare_strings(...)}}} is not
using the correct subscripts. A solution here could be to only pass the
tuples and not the enclosing list to {{{compare_subfields(...)}}}
As a side note, tests seems also to be missing for this module.
--
Ticket URL: <http://invenio-software.org/ticket/356>
Invenio <http://invenio-software.org>