commit:     03552ba817ef8851f763cd8274bbaf154cb60d8b
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  1 19:14:23 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  1 19:14:23 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=03552ba8

DeadUrl: don't crash if nvalid utf-8 data is returned by the server

It was crashing for the URL: 
ftp://ftp.wspse.de/pub/linux/wspse/mp3c-0.31.tar.bz2

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgcheck/checks/network.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/pkgcheck/checks/network.py b/src/pkgcheck/checks/network.py
index 64e54280..6ac29d49 100644
--- a/src/pkgcheck/checks/network.py
+++ b/src/pkgcheck/checks/network.py
@@ -170,6 +170,8 @@ class _UrlCheck(NetworkCheck):
             result = DeadUrl(attr, url, str(e.reason), pkg=pkg)
         except socket.timeout as e:
             result = DeadUrl(attr, url, str(e), pkg=pkg)
+        except UnicodeDecodeError:
+            ...  # ignore ftp:// URLs that return binary data
         return result
 
     def task_done(self, pkg, attr, future):

Reply via email to