Zotero Parser breaks when trying to read a single page number.
Closed this issue · 2 comments
nischalsamji commented
While loading a .rdf file, the zotero parser breaks.
Dataset provided on request.
The parser works well when a date range is proper as specified.
<bib:pages>S1-S12</bib:pages>
The parser breaks when there is a single page number.
<bib:pages>1001</bib:pages>
with the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "zotero.py", line 181, in read
papers = ZoteroParser(path).parse()
File "t:\tethne\tethne\readers\base.py", line 279, in parse
self.postprocess_entry()
File "t:\tethne\tethne\readers\base.py", line 50, in postprocess_entry
getattr(self, processor_name)(self.data[-1])
File "zotero.py", line 136, in postprocess_pages
start, end = entry.pages
ValueError: need more than 1 value to unpack
nischalsamji commented
@erickpeirson please tell me the expected behavior of the postprocess_pages() to fix the bug.
erickpeirson commented
postprocess_pages should set pageStart
and pageEnd
attributes, if data are available. A single page number should belong to pageStart
, leaving pageEnd
unset.