You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then if I query "Bœuf (animal)", it is still good, but "Bœuf_(animal)" raises a PageError telling me that "bœuf animal" does not exist. It's like when processing the underscore, the parentheses were discarded (or something else, I don't know, I haven't checked the code).
In [17]: p = wikipedia.page('Bœuf (animal)')
In [18]: p = wikipedia.page('Bœuf_(animal)')
---------------------------------------------------------------------------
PageError Traceback (most recent call last)
<ipython-input-18-108f8ec12884> in <module>()
----> 1 p = wikipedia.page('Bœuf_(animal)')
/home/jehan/.local/lib/python3.4/site-packages/wikipedia/wikipedia.py in page(title, pageid, auto_suggest, redirect, preload)
274 # if there is no suggestion or search results, the page doesn't exist
275 raise PageError(title)
--> 276 return WikipediaPage(title, redirect=redirect, preload=preload)
277 elif pageid is not None:
278 return WikipediaPage(pageid=pageid, preload=preload)
/home/jehan/.local/lib/python3.4/site-packages/wikipedia/wikipedia.py in __init__(self, title, pageid, redirect, preload, original_title)
297 raise ValueError("Either a title or a pageid must be specified")
298
--> 299 self.__load(redirect=redirect, preload=preload)
300
301 if preload:
/home/jehan/.local/lib/python3.4/site-packages/wikipedia/wikipedia.py in __load(self, redirect, preload)
343 if 'missing' in page:
344 if hasattr(self, 'title'):
--> 345 raise PageError(self.title)
346 else:
347 raise PageError(pageid=self.pageid)
PageError: Page id "bœuf animal" does not match any pages. Try another id!
The text was updated successfully, but these errors were encountered:
There is no text processing going on, the change in text ('Bœuf_(animal)' -> "bœuf animal") comes from Wikipedia's suggestion system (enabled by the auto_suggestion=True parameter of wikipedia.page()). However, the suggestions were not used correctly, which is to be fixed (#131).
I encountered a funny behavior of your API.
My test was using French Wikipedia.
If I query the pages "Bos taurus" and "Bos_taurus", they both work fine and are the same. Until now all good:
Then if I query "Bœuf (animal)", it is still good, but "Bœuf_(animal)" raises a PageError telling me that "bœuf animal" does not exist. It's like when processing the underscore, the parentheses were discarded (or something else, I don't know, I haven't checked the code).
The text was updated successfully, but these errors were encountered: