-
Notifications
You must be signed in to change notification settings - Fork 9
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
api returns a prefix of the json when requesting fulltext #33
Comments
This just worked for me, when I tried it on my browser. I just tried this on Colab, too, and it seems to work there.. Could you try that code on your system, and see if you get any errors? |
Hi again,
I tried the code in the Colab and it worked the first time I ran it but not
the second. I've attached a text file containing the error messages I got.
Also I tried using curl, in particular I did:
curl http://corpus-db.org/api/author/Dickens,%20Charles/fulltext
This also worked the first time but not the second, more specifically, the
first curl I ran returned the complete json but the second curl returned
only a prefix.
I also tried visiting the url via chrome and that also gave a prefix rather
than the entire json file.
I hope this helps.
Mathew
On Sun, Mar 31, 2019 at 2:47 PM Jonathan Reeve ***@***.***> wrote:
This just worked for me, when I tried it on my browser. I just tried this
on Colab, too, and it seems to work there.
<https://colab.research.google.com/drive/1pm7sP0Pfq0wk2pu3OR5zi90WcWM04TP0>.
Could you try that code on your system, and see if you get any errors?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#33 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AmewTnZG5SBU4j5KiVd_dBLOlpTbI4Ztks5vcS0BgaJpZM4cUf4_>
.
>> texts = requests.get('http://corpus-db.org/api/author/Dickens,%20Charles/fulltext')
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 302, in _error_catcher
yield
File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 597, in read_chunked
chunk = self._handle_chunk(amt)
File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 553, in _handle_chunk
value = self._fp._safe_read(amt)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 614, in _safe_read
raise IncompleteRead(b''.join(s), amt)
http.client.IncompleteRead: IncompleteRead(4310 bytes read, 5930 more expected)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 747, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 432, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 622, in read_chunked
self._original_response.close()
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 320, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(4310 bytes read, 5930 more expected)', IncompleteRead(4310 bytes read, 5930 more expected))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 652, in send
r.content
File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 825, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 750, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(4310 bytes read, 5930 more expected)', IncompleteRead(4310 bytes read, 5930 more expected))
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When requesting the full text, in some cases only a prefix of the json is returned. For example:
http://corpus-db.org/api/author/Dickens,%20Charles/fulltext
Doing so does not return the full json file. Instead each time I visit the page I get a different prefix of the entire json file.
The text was updated successfully, but these errors were encountered: