goldsmith / Wikipedia

A Pythonic wrapper for the Wikipedia API
https://wikipedia.readthedocs.org/
MIT License
2.88k stars 519 forks source link

Return exact page title match instead of suggestion if it exists. #310

Open wlerin opened 2 years ago

wlerin commented 2 years ago

Fixes #279 and related.

There are already at least four proposed fixes to this bug ( #305 #297 #287 #253 ), but none of them quite succeed so here's a fourth attempt. Of course, considering the maintainer hasn't been seen since 2018 I doubt there's going to be any movement on any of them.

theptrk commented 1 month ago

This should be merged

theptrk commented 1 month ago

There could probably still be an issue If results was empty and suggestions is empty you dont raise the correct error

        # if there is no suggestion or search results, the page doesn't exist
        raise PageError(title)