Merge pull request #735 from vladimir-v-diaz/add_comment_for_socket_behavior

Explain via comment how to deal with socket exceptions.  Address #728.
This commit is contained in:
Vladimir Diaz 2018-05-30 11:30:29 -04:00 committed by GitHub
commit 76ca2e8364
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -257,7 +257,10 @@ def _download_file(url, required_length, STRICT_REQUIRED_LENGTH=True):
temp_file = securesystemslib.util.TempFile()
try:
# Open the connection to the remote file.
# Open the connection to the remote file. _open_connection() can raise
# socket connection exceptions (such as SSLError). Connection errors of
# this kind can be minimized by adjusting the socket timeout in
# settings.py.
connection = _open_connection(url)
# We ask the server about how big it thinks this file should be.