diff --git a/hplip-pil.patch b/hplip-pil.patch new file mode 100644 index 0000000..2784b54 --- /dev/null +++ b/hplip-pil.patch @@ -0,0 +1,18 @@ +diff --git a/installer/dcheck.py b/installer/dcheck.py +index 3d0624e..1817819 100644 +--- a/installer/dcheck.py ++++ b/installer/dcheck.py +@@ -366,11 +366,11 @@ def get_xsane_version(): + + def get_pil_version(): + try: +- from PIL import Image ++ import PIL + except ImportError: + return '-' + else: +- return Image.PILLOW_VERSION ++ return PIL.__version__ + + def get_libpthread_version(): + try: diff --git a/hplip-unicodeerror.patch b/hplip-unicodeerror.patch new file mode 100644 index 0000000..f98c7a3 --- /dev/null +++ b/hplip-unicodeerror.patch @@ -0,0 +1,18 @@ +diff --git a/base/sixext.py b/base/sixext.py +index 0bf4fc4..311bf72 100644 +--- a/base/sixext.py ++++ b/base/sixext.py +@@ -110,11 +110,11 @@ if PY3: + + + def to_string_utf8(s): +- return s.decode("utf-8") ++ return s.decode("utf-8", 'ignore') + + + def to_string_latin(s): +- return s.decode("latin-1") ++ return s.decode("latin-1", 'ignore') + + + def to_unicode(s, enc=None): diff --git a/hplip.spec b/hplip.spec index 2fcdd1e..c1f01ea 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.19.12 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ and MIT and BSD and IJG and Public Domain and GPLv2+ with exceptions and ISC Url: https://developers.hp.com/hp-linux-imaging-and-printing @@ -123,6 +123,12 @@ Patch48: hplip-missing-drivers.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1772698 # reported upstream https://bugs.launchpad.net/hplip/+bug/1853002 Patch49: hplip-missing-laserjet2200.patch +# sixext has problems with python3 strings (bz#1573430) +# reported https://bugs.launchpad.net/bugs/1480152 +Patch50: hplip-unicodeerror.patch +# the version attribute in python-pillow got changed again.. +# https://bugs.launchpad.net/hplip/+bug/1863620 +Patch51: hplip-pil.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python3-pillow @@ -381,6 +387,9 @@ rm prnt/hpcups/ErnieFilter.{cpp,h} prnt/hpijs/ernieplatform.h %patch48 -p1 -b .missing-drivers # 1772698 - Can't setup printer (HP LJ 2200): no attributes found in model.dat %patch49 -p1 -b .missing-laserjet-2200 +# 1573430 - sixext.py:to_string_utf8:UnicodeDecodeError: 'utf-8' codec can't decode bytes +%patch50 -p1 -b .unicodeerror +%patch51 -p1 -b .pil sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ @@ -687,6 +696,10 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio %changelog +* Mon Feb 17 2020 Zdenek Dohnal - 3.19.12-4 +- 1573430 - sixext.py:to_string_utf8:UnicodeDecodeError: 'utf-8' codec can't decode bytes +- fix pillow version check + * Wed Jan 29 2020 Fedora Release Engineering - 3.19.12-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild