update/fix for an issue reported by nightman (IncompleteRead: IncompleteRead(1284 bytes read))

This commit is contained in:
Miroslav Stampar 2010-11-12 22:57:33 +00:00
parent 27735b14df
commit 06a872fc99

View File

@ -243,7 +243,7 @@ class Connect:
debugMsg = "got HTTP error code: %d (%s)" % (code, status) debugMsg = "got HTTP error code: %d (%s)" % (code, status)
logger.debug(debugMsg) logger.debug(debugMsg)
except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine), e: except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead), e:
tbMsg = traceback.format_exc() tbMsg = traceback.format_exc()
if "URLError" in tbMsg or "error" in tbMsg: if "URLError" in tbMsg or "error" in tbMsg:
@ -254,6 +254,9 @@ class Connect:
warnMsg = "the target url responded with an unknown HTTP " warnMsg = "the target url responded with an unknown HTTP "
warnMsg += "status code, try to force the HTTP User-Agent " warnMsg += "status code, try to force the HTTP User-Agent "
warnMsg += "header with option --user-agent or -a" warnMsg += "header with option --user-agent or -a"
elif "IncompleteRead" in tbMsg:
warnMsg = "there was an incomplete read error while retrieving data "
warnMsg += "from the target url"
else: else:
warnMsg = "unable to connect to the target url" warnMsg = "unable to connect to the target url"