From 84d9355125ad3574e63f0fe3a74f7a5a79430fb4 Mon Sep 17 00:00:00 2001 From: Tim Andersson Date: Thu, 25 Apr 2024 08:32:06 +0100 Subject: [PATCH] Revert "Fix: autopkgtest now returns content-length header again" This reverts commit b7807106233ad1230211626e4288232ee09a9c02. --- britney2/policies/autopkgtest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 1dd3be4..de7af7b 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -181,7 +181,8 @@ class AutopkgtestPolicy(BasePolicy): if not data: break f_out.write(data) - if http_code and os.path.getsize(new_file) != int(f.getheader('content-length')): + content_length = f.getheader('content-length') + if http_code and content_length and os.path.getsize(new_file) != content_length: self.logger.info('Short read downloading autopkgtest results') os.unlink(new_file) else: