Hello invenio devs,

I've been experimenting with OAI in rc0 and found out that when exporting new records via oairepositoryupdater, i get the following exception:

>> 2011-04-01 15:19:22 -> TypeError: 'NoneType' object is not iterable
>>> >>> User details
No client information available

>>> >>> Traceback details
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/invenio/bibtask.py", line 754, in _task_run
    if callable(task_run_fnc) and task_run_fnc():
File "/usr/lib/python2.6/site-packages/invenio/oai_repository_updater.py", line 396, in oairepositoryupdater_task
    CFG_OAI_ID_FIELD])
File "/usr/lib/python2.6/site-packages/invenio/oai_repository_updater.py", line 476, in marcxml_filter_out_tags
    for datafield in record.get(field[0:3], None):
TypeError: 'NoneType' object is not iterable
Locals by frame, innermost last

[...]

I'm using the version that is shipped in the 1.0.0-rc0 version and from what I see the exact same version exists in the repository...

I barely know any python, but playing with this module, I changed the line in oai_repository_updater.py:
from
"for datafield in record.get(field[0:3], None):"
to
"for datafield in record.get(field[0:3], ''):"

so that it returns an empty value when the record doesn't have any tags referenced in CFG_OAI_ID_FIELD (ie when 'exporting' new records), and things seem to be working now. Can you verify it? Is this a valid workaround? Are you using something else instead?

Best regards,
Theodoropoulos Theodoros

Reply via email to