Page MenuHomePhabricator

Catch exception for Dissemin papers without expected author names
Closed, ResolvedPublic

Description

On [[Philantropy]]

OAbot
Oops! Something went wrong.

Error:
list index out of range
Traceback (most recent call last):
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/data/project/oabot/www/python/venv/local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/data/project/oabot/www/python/src/app.py", line 140, in process
context = get_proposed_edits(page_name, force)
File "/data/project/oabot/www/python/src/app.py", line 229, in get_proposed_edits
filtered = list(filter(lambda e: e.proposed_change, all_templates))
File "./oabot/main.py", line 325, in add_oa_links_in_references
edit.propose_change(only_doi)
File "./oabot/main.py", line 112, in propose_change
dissemin_paper_object = get_dissemin_paper(reference)
File "./oabot/main.py", line 223, in get_dissemin_paper
if date[:4] == paper_year and ratio(authors[0].get("last", ""), paper_authorlast) > 0.75:
IndexError: list index out of range

It's easy to avoid the error but I'm not sure whether to assume a suggestion is bad or good when the author names can't be used (cf. T228702).

Event Timeline

Nemo_bis triaged this task as Medium priority.Sep 24 2019, 1:54 PM
Nemo_bis added subscribers: Awkwafaba, OABot.
Nemo_bis removed a subscriber: OABot.

This seems like a pretty important bug… I would not get held up by design worries: just make sure no exception is thrown!

Yes, you are right. I was not being particular about the fix, I just lacked motivation as long as the queue of suggestions ran in the tens of thousands for months. Now I'm working on refreshing the suggestions as there is more demand/need.

The simple fix at https://github.com/dissemin/oabot/pull/71 avoids an exception on all the cases reported so far. I'll fix the hdl test today and then merge it.

Nemo_bis claimed this task.