WordApi.getDefinitions and WordApi.getRelatedWords can raise urllib.error.HTTPError: HTTP Error 404: Not Found
Harmon758 opened this issue · 1 comments
Harmon758 commented
>>> from wordnik import swagger, WordApi
>>> client = swagger.ApiClient(API_KEY, "http://api.wordnik.com/v4")
>>> api = WordApi.WordApi(client)
>>> api.getRelatedWords("orange", relationshipTypes="rhyme")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python38\lib\site-packages\wordnik\WordApi.py", line 275, in getRelatedWords
response = self.apiClient.callAPI(resourcePath, method, queryParams,
File "C:\Program Files\Python38\lib\site-packages\wordnik\swagger.py", line 73, in callAPI
request = urllib.request.urlopen(requestParams)
File "C:\Program Files\Python38\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Program Files\Python38\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "C:\Program Files\Python38\lib\urllib\request.py", line 640, in http_response
response = self.parent.error(
File "C:\Program Files\Python38\lib\urllib\request.py", line 569, in error
return self._call_chain(*args)
File "C:\Program Files\Python38\lib\urllib\request.py", line 502, in _call_chain
result = func(*args)
File "C:\Program Files\Python38\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
This can also occur with WordApi.getDefinitions
and other relationship types such as synonym and antonym.
#7 is most likely referring to this issue as well.
gabrielmajosi commented
too fucking lazy to fix it