From 939978beec07bd625ca0714658d1bbc4d682b3a7 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Wed, 11 Dec 2019 01:27:56 +0000 Subject: [PATCH] Handle EOF from the HTTP payload parser correctly Note that this should never matter anyway because the response is already run through the payload parser before. --- qwarc/aiohttp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qwarc/aiohttp.py b/qwarc/aiohttp.py index 1c97927..b4d79fb 100644 --- a/qwarc/aiohttp.py +++ b/qwarc/aiohttp.py @@ -133,10 +133,11 @@ class ClientResponse(aiohttp.client_reqrep.ClientResponse): while True: chunk = self._rawData.responseData.read(1048576) if not chunk: - if data: - parser.feed_data(data) break eof, data = parser.feed_data(chunk) + # data can only not be None if eof is True, so there is no need to actually do anything about it + if eof: + break if not eof: parser.feed_eof()