Merge pull request #42 from resync/issue-41

Fix handling of missing Content-Length
This commit is contained in:
Simeon Warner 2021-03-18 14:00:12 -04:00 committed by GitHub
commit 8c603fa4cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,7 +101,7 @@ class ListBaseWithIndex(ListBase):
self.logger.debug(
"Read %d bytes from %s" %
(self.content_length, uri))
except KeyError:
except (KeyError, TypeError):
# If we don't get a length then c'est la vie
self.logger.debug("Read ????? bytes from %s" % (uri))
pass
@ -170,7 +170,7 @@ class ListBaseWithIndex(ListBase):
try:
self.content_length = int(fh.info()['Content-Length'])
self.bytes_read += self.content_length
except KeyError:
except (KeyError, TypeError):
# If we don't get a length then c'est la vie
pass
self.logger.info(