From 0653bd33058eb7059fe142fd1b165bebff2a2ccb Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Sat, 1 Jun 2024 16:01:49 +0200 Subject: [PATCH] PICARD-2919: fix download of GIF images (and maybe others) Issue is the data downloaded is QtCore.QBytesArray object, and it wasn't convert to bytes. So ensure it is converted before passing it to image detection methods. --- picard/webservice/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/picard/webservice/__init__.py b/picard/webservice/__init__.py index 69b649e23..f27c4ca00 100644 --- a/picard/webservice/__init__.py +++ b/picard/webservice/__init__.py @@ -572,12 +572,13 @@ class WebService(QtCore.QObject): log.debug("Response received: %s", document) except Exception as e: log.error("Unable to parse the response for %s -> %s", display_reply_url, e) - document = reply.readAll() + document = bytes(reply.readAll()) error = e finally: handler(document, reply, error) else: - handler(reply.readAll(), reply, error) + # readAll() returns QtCore.QByteArray, so convert to bytes + handler(bytes(reply.readAll()), reply, error) ratecontrol.adjust(hostkey, slow_down)