File hp-setup-fix-python-crash-when-manually-importing-gz.patch of Package hplip

From 216b15eb68bd5cacd26ff554e244fc4ea50a1acf Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 15 Aug 2025 23:10:44 +0200
Subject: [PATCH 1/2] hp-setup: fix python crash when manually importing
 gzipped PPD

data read from gzip.GzipFile must be converted to a string, otherwise
the subsequent regex match will cause a python stacktrace.
---
 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 2608f95..962909b 100755
--- a/setup.py
+++ b/setup.py
@@ -552,7 +552,7 @@ else: # INTERACTIVE_MODE
                         if os.path.exists(file_path) and os.path.isfile(file_path):
 
                             if file_path.endswith('.gz'):
-                                nickname = gzip.GzipFile(file_path, 'r').read(4096)
+                                nickname = gzip.GzipFile(file_path, 'r').read(4096).decode("utf-8")
                             else:
                                 nickname = open(file_path, 'r').read(4096)
 
-- 
2.50.1

openSUSE Build Service is sponsored by