yashsinghcodes/wik

Enters a recursive infinite loop when searching for disambiguation pages

Tossrock opened this issue · 2 comments

Observed behavior

Process hangs for a lengthy period and then throws a RecursionError when searching for a term that lands on a disambiguation page.

Expected behavior

Process returns the disambiguation page.

Steps to reproduce

Warning, enters an infinite loop

wik -s M1

Breaking the loop or allowing it to exceed the recursion depth limit yields:

  File "./wik/info.py", line 106, in getInfo
    if "may refer to:" in str(final_content[0]): term = searchInfo(term)
  File "./wik/info.py", line 135, in searchInfo
    getInfo(term)
  File "./wik/info.py", line 106, in getInfo
    if "may refer to:" in str(final_content[0]): term = searchInfo(term)
[ ... repeats until recursion depth exceeded ]
RecursionError: maximum recursion depth exceeded while calling a Python object

Have you installed wik through pip installer? (i.e. not from the source)

Since no response, i'm closing the issue. I think the issue was caused because pypi was few commits behind the source but is now updated to the latest version.