backport Fix compatibility with python3 in putFile method
This commit is contained in:
parent
5c6156d326
commit
d56e953907
30
0009-Fix-compatibility-with-python3-in-putFile-method.patch
Normal file
30
0009-Fix-compatibility-with-python3-in-putFile-method.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 9fb1f6a731dab0c39ba138d29f310622d4f32d4d Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Korbar <tkorbar@redhat.com>
|
||||
Date: Mon, 14 Jan 2019 16:09:25 +0100
|
||||
Subject: [PATCH] Fix compatibility with python3 in putFile method
|
||||
|
||||
in python3 os.read returns byte object not a string which caused
|
||||
writing loop to be endless
|
||||
|
||||
by adding b'' comparison we hold compatibility both with python2
|
||||
and python3
|
||||
---
|
||||
cupspk.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/cupspk.py b/cupspk.py
|
||||
index 5b863b43..b7cbc0b3 100644
|
||||
--- a/cupspk.py
|
||||
+++ b/cupspk.py
|
||||
@@ -448,7 +448,7 @@ class Connection:
|
||||
if fd is not None:
|
||||
os.lseek (fd, 0, os.SEEK_SET)
|
||||
buf = os.read (fd, 512)
|
||||
- while buf != '':
|
||||
+ while buf != '' and buf != b'':
|
||||
os.write (tmpfd, buf)
|
||||
buf = os.read (fd, 512)
|
||||
else:
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
Name: system-config-printer
|
||||
Summary: a graphical tool for CUPS administration
|
||||
Version: 1.5.11
|
||||
Release: 22
|
||||
Release: 23
|
||||
License: GPLv2+
|
||||
URL: https://github.com/zdohnal/system-config-printer
|
||||
Source0: https://github.com/zdohnal/system-config-printer/archive/%{version}.tar.gz
|
||||
@ -16,6 +16,7 @@ Patch0005: 0005-Fix-TypeError-raised-by-debugprint-call.patch
|
||||
Patch0006: 0006-Fix-bad-use-of-NamedTemporaryFile.patch
|
||||
Patch0007: 0007-Fix-bad-call-of-cups-connection-getFile.patch
|
||||
Patch0008: 0008-Fix-writing-of-advanced-settings.patch
|
||||
Patch0009: 0009-Fix-compatibility-with-python3-in-putFile-method.patch
|
||||
|
||||
BuildRequires: libusb1-devel gcc gettext-devel systemd xmlto systemd-devel python3-devel
|
||||
BuildRequires: intltool cups-devel >= 1.2 desktop-file-utils >= 0.2.92 pkgconfig(glib-2.0)
|
||||
@ -91,6 +92,9 @@ rm -rf /var/cache/foomatic/foomatic.pickle
|
||||
exit 0
|
||||
|
||||
%changelog
|
||||
* Thu Dec 28 2023 liyuanyuan <liyuanyuan@xfusion.com> - 1.5.11-23
|
||||
- Fix compatibility with python3 in putFile method
|
||||
|
||||
* Tue Dec 12 2023 liyuanyuan <liyuanyuan@xfusion.com> - 1.5.11-22
|
||||
- Fix writing of advanced settings
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user