From 44ea9545dde35a1eceffc49605e84d83ed928497 Mon Sep 17 00:00:00 2001 From: Simeon Warner Date: Thu, 18 Mar 2021 13:30:27 -0400 Subject: [PATCH] Handle missing Content-Length --- resync/list_base_with_index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resync/list_base_with_index.py b/resync/list_base_with_index.py index bf6c6e1..b8f74ef 100644 --- a/resync/list_base_with_index.py +++ b/resync/list_base_with_index.py @@ -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(