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

Connection is being broken for long downloading sessions #33

Open
KhazAkar opened this issue Nov 5, 2020 · 0 comments
Open

Connection is being broken for long downloading sessions #33

KhazAkar opened this issue Nov 5, 2020 · 0 comments

Comments

@KhazAkar
Copy link

KhazAkar commented Nov 5, 2020

Hi,
I wanted to download my rather big collection from packtpub (~430 books) and after some long time this errors end execution of script.
Python 3.9, Fedora 33.
`
Traceback (most recent call last):###############################################1 | 292k/423k [01:39<00:43, 2.99kKB/s]
File "/usr/local/lib/python3.9/site-packages/urllib3/contrib/pyopenssl.py", line 294, in recv_into
return self.connection.recv_into(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/OpenSSL/SSL.py", line 1840, in recv_into
self._raise_ssl_error(self._ssl, result)
File "/usr/lib/python3.9/site-packages/OpenSSL/SSL.py", line 1663, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (104, 'ECONNRESET')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 360, in _error_catcher
yield
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 442, in read
data = self._fp.read(amt)
File "/usr/lib64/python3.9/http/client.py", line 458, in read
n = self.readinto(b)
File "/usr/lib64/python3.9/http/client.py", line 502, in readinto
n = self.fp.readinto(b)
File "/usr/lib64/python3.9/socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "/usr/local/lib/python3.9/site-packages/urllib3/contrib/pyopenssl.py", line 299, in recv_into
raise SocketError(str(e))
OSError: (104, 'ECONNRESET')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 750, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 494, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 459, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/lib64/python3.9/contextlib.py", line 135, in exit
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.9/site-packages/urllib3/response.py", line 378, in _error_catcher
raise ProtocolError('Connection broken: %r' % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: OSError("(104, 'ECONNRESET')")', OSError("(104, 'ECONNRESET')"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/khazakar/downloadedwithgit/packtpub-downloader/main.py", line 226, in
main(sys.argv[1:])
File "/home/khazakar/downloadedwithgit/packtpub-downloader/main.py", line 218, in main
download_book(filename, url)
File "/home/khazakar/downloadedwithgit/packtpub-downloader/main.py", line 111, in download_book
for chunk in tqdm(r.iter_content(chunk_size=1024), total=math.ceil(total//1024), unit='KB', unit_scale=True):
File "/usr/local/lib/python3.9/site-packages/tqdm/_tqdm.py", line 1000, in iter
for obj in iterable:
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 753, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: OSError("(104, 'ECONNRESET')")', OSError("(104, 'ECONNRESET')"))
`

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

No branches or pull requests

1 participant