Some plagiarism comparison page returns 500
kevinyang372 opened this issue · 0 comments
kevinyang372 commented
[2021-01-27 08:37:09,194] ERROR in app: Exception on /compare/19/1 [GET]
Traceback (most recent call last):
File "/Users/kevin/Desktop/Github/code-eval/venv/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/Users/kevin/Desktop/Github/code-eval/venv/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/kevin/Desktop/Github/code-eval/venv/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/kevin/Desktop/Github/code-eval/venv/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Users/kevin/Desktop/Github/code-eval/venv/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/kevin/Desktop/Github/code-eval/venv/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/kevin/Desktop/Github/code-eval/web/utils.py", line 115, in decorated_function
return f(*args, **kwargs)
File "web/blueprints/compare.py", line 20, in compare
parsed1, parsed2 = p.highlight_diff()
File "/Users/kevin/Desktop/Github/code-eval/web/plagiarism.py", line 260, in highlight_diff
d = self.ast_match_wrapper(self.tree_1, self.tree_2)
File "/Users/kevin/Desktop/Github/code-eval/web/plagiarism.py", line 253, in ast_match_wrapper
res = func(node1, node2)
File "/Users/kevin/Desktop/Github/code-eval/web/plagiarism.py", line 229, in func
elif not func(v, getattr(node2, k), next_parent):
File "/Users/kevin/Desktop/Github/code-eval/web/plagiarism.py", line 246, in func
if not func(node1[i], node2[i]):
File "/Users/kevin/Desktop/Github/code-eval/web/plagiarism.py", line 229, in func
elif not func(v, getattr(node2, k), next_parent):
File "/Users/kevin/Desktop/Github/code-eval/web/plagiarism.py", line 246, in func
if not func(node1[i], node2[i]):
IndexError: list index out of range