F
F
foxiko2019-10-24 14:10:25
Python
foxiko, 2019-10-24 14:10:25

How not to catch a timeout with the pythonic Dropbox API?

I'm using the Python lib DropboxAPI to upload videos to the cloud. The Internet connection is good, the speed is normal, but from time to time very often the download is interrupted with a timeout. For example, now a 70-megabyte video did not download. If so, here's the exception:

ConnectionError(ProtocolError('Connection aborted.', timeout('The write operation timed out',)),)

How can this be prevented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Forevka69, 2019-10-24
@Forevka69

try:
    ....
except ConnectionError:
    print('Ошибка, надо загружать файл по новой')

D
Dimonchik, 2019-10-24
@dimonchik2013

dbx = dropbox.Dropbox(DROPBOX_API_KEY, timeout=None)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question