Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib.error.HTTPError: HTTP Error 400: Bad Request #8

Closed
Code4SAFrankie opened this issue Nov 21, 2017 · 2 comments · Fixed by #11
Closed

urllib.error.HTTPError: HTTP Error 400: Bad Request #8

Code4SAFrankie opened this issue Nov 21, 2017 · 2 comments · Fixed by #11

Comments

@Code4SAFrankie
Copy link

from wikidata.client import Client
client = Client()
entity = client.get('20145', load=True)
Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\Anaconda3\lib\site-packages\wikidata\client.py", line 139, in get
entity.load()
File "C:\ProgramData\Anaconda3\lib\site-packages\wikidata\entity.py", line 239, in load
result = self.client.request(url)
File "C:\ProgramData\Anaconda3\lib\site-packages\wikidata\client.py", line 193, in request
response = self.opener.open(url)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 532, in open
response = meth(req, response)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 570, in error
return self._call_chain(*args)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

@Code4SAFrankie
Copy link
Author

Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)] on win32

@k----n
Copy link
Contributor

k----n commented Apr 6, 2018

This is because the entity does not exist.

'None" should probably be returned instead of raising an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants