From 32d3b2568205ac5d65ae2cb69fb628568c7c7ea8 Mon Sep 17 00:00:00 2001 From: liyuan Date: Mon, 6 Nov 2023 23:48:27 +0800 Subject: [PATCH] Fix bad call of cups connection getFile --- ...-bad-call-of-cups-connection-getFile.patch | 30 +++++++++++++++++++ system-config-printer.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0007-Fix-bad-call-of-cups-connection-getFile.patch diff --git a/0007-Fix-bad-call-of-cups-connection-getFile.patch b/0007-Fix-bad-call-of-cups-connection-getFile.patch new file mode 100644 index 0000000..c2f606f --- /dev/null +++ b/0007-Fix-bad-call-of-cups-connection-getFile.patch @@ -0,0 +1,30 @@ +From eb13a5061d176b813345867942ccaf8f5cf3d6c6 Mon Sep 17 00:00:00 2001 +From: Tomas Korbar +Date: Mon, 19 Nov 2018 13:43:39 +0100 +Subject: [PATCH] Fix bad call of cups connection getFile + +--- + troubleshoot/ErrorLogFetch.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/troubleshoot/ErrorLogFetch.py b/troubleshoot/ErrorLogFetch.py +index d7807899..3840dbc8 100644 +--- a/troubleshoot/ErrorLogFetch.py ++++ b/troubleshoot/ErrorLogFetch.py +@@ -69,11 +69,11 @@ class ErrorLogFetch(Question): + with NamedTemporaryFile (delete=False) as tmpf: + success = False + try: +- c.getFile ('/admin/log/error_log', tmpf.file) ++ c.getFile ('/admin/log/error_log', file = tmpf) + success = True + except cups.HTTPError: + try: +- os.remove (tmpf.file) ++ os.remove (tmpf.name) + except OSError: + pass + +-- +2.33.0 + diff --git a/system-config-printer.spec b/system-config-printer.spec index d1e9745..6244b63 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -3,7 +3,7 @@ Name: system-config-printer Summary: a graphical tool for CUPS administration Version: 1.5.11 -Release: 20 +Release: 21 License: GPLv2+ URL: https://github.com/zdohnal/system-config-printer Source0: https://github.com/zdohnal/system-config-printer/archive/%{version}.tar.gz @@ -14,6 +14,7 @@ Patch0003: 0003-Set-programe-name-for-scp-dbus-service-as-well.patch Patch0004: 0004-Fix-typo-in-debugprint-call.patch 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 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) @@ -89,6 +90,9 @@ rm -rf /var/cache/foomatic/foomatic.pickle exit 0 %changelog +* Fri Nov 24 2023 liyuanyuan - 1.5.11-21 +- Fix bad call of cups connection getFile + * Thu Nov 09 2023 liyuanyuan - 1.5.11-20 - Fix bad use of NamedTemporaryFile -- Gitee