Skip to content
This repository has been archived by the owner on Jan 13, 2019. It is now read-only.

How to deal with IncompleteRead problem? #2

Open
li-xinyang-me opened this issue Dec 23, 2014 · 0 comments
Open

How to deal with IncompleteRead problem? #2

li-xinyang-me opened this issue Dec 23, 2014 · 0 comments

Comments

@li-xinyang-me
Copy link

Exception in thread Thread-34:0:36:47
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "it-ebooks-dl.py", line 150, in _dl_start
    self._dl_worker(self._saved_list[num])
  File "it-ebooks-dl.py", line 188, in _dl_worker
    data = response.read()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 512, in read
    s = self._safe_read(self.length)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 664, in _safe_read
    raise IncompleteRead(b''.join(s), amt)
http.client.IncompleteRead: IncompleteRead(79077 bytes read, 27929599 more expected)
Exception in thread Thread-31:d Time: 2:37:13
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "it-ebooks-dl.py", line 150, in _dl_start
    self._dl_worker(self._saved_list[num])
  File "it-ebooks-dl.py", line 188, in _dl_worker
    data = response.read()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 512, in read
    s = self._safe_read(self.length)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/http/client.py", line 664, in _safe_read
    raise IncompleteRead(b''.join(s), amt)
http.client.IncompleteRead: IncompleteRead(19357756 bytes read, 5579686 more expected)

Normally the program continue downloading when encourter this problem but sometime it does not continue and has to start over again from book number 1.

Using single thread for downloading seems solve the issue, unstable internet connection might be the source of issue. Finally get the work done, thank you.

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

No branches or pull requests

1 participant