backport fix AttributeError when IO busy and press ctrl c

This commit is contained in:
xzf1234 2023-05-05 16:50:52 +08:00
parent 342c30b78c
commit a965e8d155
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From 759e7a5586f279efd41b65b2f84e0dd3bcf77fbd Mon Sep 17 00:00:00 2001
From: chenhaixing123 <chenhaixing@huawei.com>
Date: Wed, 22 Feb 2023 17:27:04 +0800
Subject: [PATCH] fix AttributeError when IO busy and press ctrl c
Conflict:The content of "index" and "@@" are adapted
Reference:https://github.com/rpm-software-management/dnf/pull/1899/commits/759e7a5586f279efd41b65b2f84e0dd3bcf77fbd
---
dnf/conf/config.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dnf/conf/config.py b/dnf/conf/config.py
index 3cb561b..202fd44 100644
--- a/dnf/conf/config.py
+++ b/dnf/conf/config.py
@@ -233,8 +233,9 @@ class MainConf(BaseConfig):
self.tempfiles = []
def __del__(self):
- for file_name in self.tempfiles:
- os.unlink(file_name)
+ if hasattr(self, 'tempfiles'):
+ for file_name in self.tempfiles:
+ os.unlink(file_name)
@property
def get_reposdir(self):
--
2.33.1.windows.1

View File

@ -3,7 +3,7 @@
Name: dnf
Version: 4.2.23
Release: 10
Release: 11
Summary: A software package manager that manages packages on Linux distributions.
License: GPLv2+ and GPLv2 and GPL
URL: https://github.com/rpm-software-management/dnf
@ -28,6 +28,7 @@ Patch6002: backport-fix-remove-when-no-repos-are-enabled.patch
Patch6003: backport-set-default-value-for-variable-to-prevent-crash.patch
Patch6004: backport-pass-whole-url-in-relativeUrl-to-packageTarget-for-rpm-url-download.patch
Patch6005: backport-ignore-processing-variable-files-with-unsupported-encoding.patch
Patch6006: backport-fix-AttributeError-when-IO-busy-and-press-ctrl-c.patch
BuildArch: noarch
BuildRequires: cmake gettext systemd bash-completion python3-sphinx
@ -218,6 +219,11 @@ popd
%{_mandir}/man8/%{name}-automatic.8*
%changelog
* Fri May 5 2023 xzf1244 <xzf1244@hust.edu.cn> 4.2.23-11
- CVE:NA
- SUG:NA
- DESC:dnf:fix AttributeError when io busy and press ctrl c
* Tue Feb 14 2023 chenhaixing <chenhaixing@huawei.com> - 4.2.23-10
- Type:bugfix
- CVE:NA