question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error when getting a word's summary

See original GitHub issue

` import wikipedia print(wikipedia.summary(“Ubuntu”))

    The code that caused this warning is on line 389 of the file C:\Users\karim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wikipedia\wikipedia.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor.
    
      lis = BeautifulSoup(html).find_all('li')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\Users\karim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wikipedia\util.py", line 28, in __call__
        ret = self._cache[key] = self.fn(*args, **kwargs)
      File "C:\Users\karim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wikipedia\wikipedia.py", line 231, in summary
        page_info = page(title, auto_suggest=auto_suggest, redirect=redirect)
      File "C:\Users\karim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wikipedia\wikipedia.py", line 276, in page
        return WikipediaPage(title, redirect=redirect, preload=preload)
      File "C:\Users\karim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wikipedia\wikipedia.py", line 299, in __init__
        self.__load(redirect=redirect, preload=preload)
      File "C:\Users\karim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\wikipedia\wikipedia.py", line 393, in __load
        raise DisambiguationError(getattr(self, 'title', page['title']), may_refer_to)
    wikipedia.exceptions.DisambiguationError: "bantu" may refer to:
    Bantu languages
    Bantu peoples
    Bantu knots
    Black Association for Nationalism Through Unity
    Bantu (band)
    Bantu (album)
    Bantu FC
    Bantu expansion
    Bantustan`

it used to work normally before but now i just randomly get this error for some reason.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

6reactions
wlerincommented, May 3, 2021

Auto suggestion is turned on by default for summary. This is mind-boggling terrible and the fact that it ever works is frankly miraculous. Turn it off:

wikipedia.summary("Ubuntu", auto_suggest=False)
1reaction
wlerincommented, Jul 6, 2021

@KairaNithin That looks like it’s working as intended? That query is too vague so of course it throws a DisambiguationError, but at least it didn’t get transformed into something completely different like with Ubuntu turning into bantu, even though there’s an Ubuntu page.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Word 2013 error in opening a document - Microsoft Community
Getting this message on opening a Word 2013 document. ... I get the message: Image. I have checked the document and there is...
Read more >
Typo (Typographical Error) | What is One Example of a Typo?
Lesson Summary · A typo is the shortened form of the words typographical error. · Typos may be used intentionally. · Typos are...
Read more >
Error analysis (linguistics) - Wikipedia
In linguistics, according to J. Richard et al., (2002), an error is the use of a word, speech act or grammatical items in...
Read more >
How to Approach Identifying Sentence Errors: SAT Writing ...
Before marking anything down, however, make sure you can articulate why the underlined word or phrase is wrong. Many answers may sound odd ......
Read more >
Overview of Error Analysis
Error analysis is a method used to document the errors that appear in learner language, determine whether those errors are systematic, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found